array-object-alt v1.0.0
Use an object where an array is required (See examples)
š Homepage
Install
npm install array-object-alt
Run tests
npm run test
Functions
o2a(o) ā
Converts an object into an array while preserving keys in 'keys' property
Kind: global function
Returns: Array
Param | Type |
---|---|
o | Object |
a2o(a) ā
Converts an array into an object. If the object was converted into array using above method, it will read keys from the keys property
Kind: global function
Returns: Object
Param | Type |
---|---|
a | Array |
patch(key)
Patches a function so it can be called (always async) with first argument as object instead of an array
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
key | string | "$o" | The patch name |
call(cb, ...args) ā
Useful to call the function (sync) with 1st arguments as object instead of array
Kind: global function
Returns: Promise
Param | Type |
---|---|
cb | Callback |
...args | any |
callAsync(cb, ...args) ā
Useful to call the function (async) with 1st arguments as object instead of array
Kind: global function
Returns: Result
Param | Type |
---|---|
cb | Callback |
...args | any |
Author
š¤ Praveen Ranjan Keshri
š¤ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a āļø if this project helped you!
š License
Copyright Ā© 2021 Praveen Ranjan Keshri. This project is ISC licensed.
This README was generated with ā¤ļø by readme-md-generator
2 years ago