@wuchuhengtools/helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.18 • Public • Published

helper助手库

Installing

$ npm i @wuchuhengtools/helper

Usage

import {fileToBase64, obj2Query, query2Obj, getHash} from "@wuchuhengtools/helper"

fileToBase64(file).then(bash64 => console.log(bash64)) // image:sdafasfasd....
obj2Query({foo: 1, bar: 2}) // return ?foo=1&bar=2
query2Obj('foo=1&bar=2') // return {bar: 2, foo: 1}
getHash('1234')  // sdfkasjfasdkskskfsadf ...
getHash('1234')  // sdfkasjfasdkskskfsadf ...
copyStringToClipboard(str: string) // coped string

// debounce
const debounceHandler = debounce((data: {hello: string}) => {
    // todo something ...
}, 1000)
debounceHandler({hello: 'Are you OK?'})

// throttling 
const throttlingHandler = throttling(() => {
    // todo something ...
}, 1000)
throttlingHandler()

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @wuchuhengtools/helper

Weekly Downloads

0

Version

1.0.18

License

MIT

Unpacked Size

6.7 kB

Total Files

6

Last publish

Collaborators

  • wuchuheng