@the-/util-array

15.4.12 • Public • Published

@the-/util-array

npm Version

Array utility of the-framework

Installation

$ npm install @the-/util-array --save

Usage

'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))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/util-array

Weekly Downloads

13

Version

15.4.12

License

MIT

Unpacked Size

42.6 kB

Total Files

21

Last publish

Collaborators

  • okunishinishi