1.0.4 • Published 6 years ago

@kingjs/descriptor.nested.array.for-each v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@kingjs/descriptor.nested.array.for-each

Invokes a callback on each value of a array tree.

Usage

Replace the name of the person followed with the object representing the person being followed like this:

var forEach = require('@kingjs/descriptor.nested.array.for-each');

var tree = [['bob'], 'chris', 'alice'];

var result = { };
forEach(
  tree,
  x => result[x] = true
)

result:

[
  bob: true,
  chris: true,
  alice: true
]

API

declare function forEach(
  tree: NestedDescriptor,
  callback: (value) => any,
  thisArg?
)

Interfaces

Parameters

  • tree: The array tree whose values are going to be updated.
  • callback: Used to update values of tree:
    • value: The current value.
  • thisArg: The this argument to pass to callback.

Install

With npm installed, run

$ npm install @kingjs/descriptor.nested.array.for-each

License

MIT

Analytics