@wuchuhengtools/helper
v1.0.18
Published
```shell $ npm i @wuchuhengtools/helper
Downloads
7
Readme
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:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- 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