Array utility of the-framework
npm install @the-/util-array@the-/util-array
==========
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[bd_repo_url]: https://github.com/the-labo/the
[bd_npm_url]: http://www.npmjs.org/package/@the-/util-array
[bd_npm_shield_url]: http://img.shields.io/npm/v/@the-/util-array.svg?style=flat
Array utility of the-framework
Installation
-----
``bash`
$ npm install @the-/util-array --save
Usage
---------
`javascript
'use strict'
const { keyPathMap, uniqueFilter } = require('@the-/util-array')
async function tryExample() {
console.log(
['foo', 'bar', 'foo'].filter(uniqueFilter()), // => ['foo', 'bar']
)
console.log(
[{ foo: { bar: 10 } }, { foo: { bar: 20 } }].map(keyPathMap('foo.bar')), // => [10,20]
)
}
tryExample().catch((err) => console.error(err))
``
- module:@the-/util-array
- .keyPathMap(keyPath,options)
- .randomFind()
- .shuffleSort()
- .uniqueFilter(options)
See API Guide for more detail
License
-------
This software is released under the MIT License.
Links
------
+ [THE Labo][the_labo_url]
[the_labo_url]: https://github.com/the-labo