@mj-studio/js-util
TypeScript icon, indicating that this package has built-in type declarations

1.1.20 • Public • Published

JavaScript utilities for MJ Studio

ogimage-1260-630

JS Check


Install

yarn add @mj-studio/js-util
npm install @mj-studio/js-util

Usage

  • isPromise : check is promise
  • isPlainObject : check is plain object
  • camelCase : convert snake_case string to camelCase
  • camelCaseObject : convert keys of object to camelCased
  • convertJsonKeys : convert keys of json object to something others
  • replaceJsonKeysRecursively : replace json value matchs with key selector
  • replaceJsonValuesRecursively : replace json key matches with key selector
  • filterJsonKeys : filter keys of json object to something others
  • reverseObjectKeyValues : reverse key and value in object
  • groupByArray : group object as arrays with key a provider callback
  • groupByObject : group object as objects with key a provider callback
  • doBatch : 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

Readme

Keywords

none

Package Sidebar

Install

npm i @mj-studio/js-util

Weekly Downloads

915

Version

1.1.20

License

MIT

Unpacked Size

236 kB

Total Files

50

Last publish

Collaborators

  • mj_studio