1.0.18 • Published 2 years ago

@wuchuhengtools/helper v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago