@mj-studio/js-util
v1.1.20
Published
Custom JavaScript Utilities for MJ Studio
Downloads
3,813
Readme
JavaScript utilities for MJ Studio
Install
yarn add @mj-studio/js-util
npm install @mj-studio/js-util
Usage
isPromise
: check is promiseisPlainObject
: check is plain objectcamelCase
: convert snake_case string to camelCasecamelCaseObject
: convert keys of object to camelCasedconvertJsonKeys
: convert keys of json object to something othersreplaceJsonKeysRecursively
: replace json value matchs with key selectorreplaceJsonValuesRecursively
: replace json key matches with key selectorfilterJsonKeys
: filter keys of json object to something othersreverseObjectKeyValues
: reverse key and value in objectgroupByArray
: group object as arrays with key a provider callbackgroupByObject
: group object as objects with key a provider callbackdoBatch
: with list, do something with batched manner and return results of callback as a list- And.. other things!
Promise helper
withTimeout
: set max running time of promise, if exceeds it will reject.withMinimumResolveTime
: set minimum running time of promise