yarn add @mj-studio/js-util
npm install @mj-studio/js-util
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!
withTimeout
: set max running time of promise, if exceeds it will reject.withMinimumResolveTime
: set minimum running time of promise