open-index/open-npm huggingface dataset:
npm package: @ndhoule/after
Description: Wrap a function in a function that will invoke the original function when invoked n or more times.
Author: Nathan Houle
Latest version: 1.0.0

# after [![CI][ci-badge]][ci-link]

Wrap a function `fn` in a function that will invoke `fn` when invoked `n` or more times.

## Installation

```sh
$ npm install @ndhoule/after
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/after
[ci-badge]: https://travis-ci.org/ndhoule/after.svg?branch=master
npm package: @ndhoule/arity
Description: Wrap a function in a function that expects a given number of arguments.
Author: Nathan Houle
Latest version: 2.0.0

# arity [![CI][ci-badge]][ci-link]

Wrap a function in a function that expects a given number of arguments.

## Installation

```sh
$ component install ndhoule/arity
$ npm install @ndhoule/arity
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/arity
[ci-badge]: https://travis-ci.org/ndhoule/arity.svg?branch=master
npm package: @ndhoule/clone
Description: Deeply clone an input object.
Author: Nathan Houle
Latest version: 1.0.0

# clone [![CI][ci-badge]][ci-link]

Deeply clones a source object.

## Installation

```sh
$ npm install @ndhoule/clone
```

## API

### `clone(target : *)` => *

Deeply copies an input object.

```javascript
var a = { a: 1 };
var cloned = clone(a);

console.log(cloned); //=> { a: 1 }
console.log(cloned === a); //=> false
```

## Acknowledgements

Based on [component/clone](https://github.com/component/clone).

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/clone
[ci-badge]: https://travis-ci.org/ndhoule/clone.svg?branch=master
npm package: @ndhoule/compose
Description: Compose a list of functions into a single function.
Author: Nathan Houle
Latest version: 2.0.1

# compose [![CI][ci-badge]][ci-link]

Compose a list of functions into a single function.

## Installation

```sh
$ component install ndhoule/compose
$ npm install @ndhoule/compose
```

## API

### `compose(...funcs: Function)`

Creates a function that is the [composition](https://en.wikipedia.org/wiki/Function_composition) of a list of functions, where each function is passed the return value of the previous function.

Compose is right-associative, which means functions are called in right-to-left order. For example, the operation `h(g(f()))` is represented as `compose(h, g, f)`.

```javascript
var add = function(a, b) { return a + b; };
var square = function(x) { return x * x; };
var addThenSquare = compose(square, add);

addThenSquare(1, 2); //=> 9
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/compose
[ci-badge]: https://travis-ci.org/ndhoule/compose.svg?branch=master
npm package: @ndhoule/curry
Description: Wrap a function in a function that will repeatedly return a new wrapper function until all expected arguments have been provided.
Author: Nathan Houle
Latest version: 2.0.1

# curry [![CI][ci-badge]][ci-link]

Wrap a function in a function that will repeatedly return a new wrapper function until all expected arguments have been provided.

## Installation

```sh
$ component install ndhoule/curry
$ npm install @ndhoule/curry
```

## API

### `curry(func : Function, arity : number)`

Accepts a function `func` and returns a new function that, when invoked, will repeatedly return a new wrapper function until all expected arguments have been provided.

```javascript
var addThreeItems = function(a, b, c) { return a + b + c; };
var curriedAddThreeItems = curry(addThreeItems);
curriedAddThreeItems(2)(3)(4);
//=> 9

var curriedReduce = curry(reduce);
var add = function(a, b) { return a + b; };
var sumArray = curriedReduce(add, 0);
sumArray([1, 2, 3]);
//=> 6
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/curry
[ci-badge]: https://travis-ci.org/ndhoule/curry.svg?branch=master
npm package: @ndhoule/defaults
Description: Copies owned, enumerable properties from a source object(s) to a target object when the value of that property on the source object is `undefined`.
Author: Nathan Houle
Latest version: 2.0.1

# defaults [![CI][ci-badge]][ci-link]

Copies owned, enumerable properties from a source object(s) to a target object when the value of that property on the source object is `undefined`.

## Installation

```sh
$ component install ndhoule/defaults
$ npm install @ndhoule/defaults
```

## API

### `defaults(target : Object, sources : ...Object)` => Object

Copies owned, enumerable properties from a source object(s) to a target object when the value of that property on the source object is `undefined`.

```javascript
var a = { a: 1 };
var b = { a: 2, b: 2 };

defaults(a, b);
console.log(a); //=> { a: 1, b: 2 }
```

### `defaults.deep(target : Object, sources : ...Object)` => Object

Deeply copies owned, enumerable properties from a source object(s), recursing on object properties, to a target object when the value of that property on the source object is `undefined`.

```javascript
var a = { a: 1, b: { c: 3 } };
var b = { a: 2, b: { d: 4 } };

defaults(a, b);
console.log(a); //=> { a: 1, b: { c: 3, d: 4} }
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/defaults
[ci-badge]: https://travis-ci.org/ndhoule/defaults.svg?branch=master
npm package: @ndhoule/drop
Description: Produce a new array composed of all but the first n elements of an input collection.
Author: Nathan Houle
Latest version: 2.0.0

# drop [![CI][ci-badge]][ci-link]

Produce a new array composed of all but the first `n` elements of an input `collection`.

## Installation

```sh
$ component install ndhoule/drop
$ npm install @ndhoule/drop
```

## API

### `drop(count : number, collection : Array) => Array`

Produce a new array composed of all but the first `n` elements of an input `collection`.

```javascript
drop([1, 2, 3]); // => [2, 3]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/drop
[ci-badge]: https://travis-ci.org/ndhoule/drop.svg?branch=master
npm package: @ndhoule/each
Description: Iterate over a collection, invoking a function for each element.
Author: Nathan Houle
Latest version: 2.0.1

# each [![CI][ci-badge]][ci-link]

Iterate over a collection, invoking a function for each element in the collection.

## Installation

```sh
$ component install ndhoule/each
$ npm install @ndhoule/each
```

## API

### `each(iterator : Function, collection : Array|Object|string) => undefined`

Iterate over an input collection, invoking an `iterator` function for each element in the collection, passing to the iterator three arguments: `(value, index, collection)`.

The `iterator` function can end iteration early by returning `false`.

```javascript
var log = console.log.bind(console);

each(log, ['a', 'b', 'c']);
//-> 'a', 0, ['a', 'b', 'c']
//-> 'b', 1, ['a', 'b', 'c']
//-> 'c', 2, ['a', 'b', 'c']
//=> undefined

each(log, 'tim');
//-> 't', 2, 'tim'
//-> 'i', 1, 'tim'
//-> 'm', 0, 'tim'
//=> undefined

// Note: Iteration order not guaranteed across environments
each(log, { name: 'tim', occupation: 'enchanter' });
//-> 'tim', 'name', { name: 'tim', occupation: 'enchanter' }
//-> 'enchanter', 'occupation', { name: 'tim', occupation: 'enchanter' }
//=> undefined
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/each
[ci-badge]: https://travis-ci.org/ndhoule/each.svg?branch=master
npm package: @ndhoule/entries
Description: Utility to get key-value pairs from an object
Author: Nathan Houle
Latest version: 2.0.0

# entries [![CI][ci-badge]][ci-link]

Utility to get key-value pairs from an object.

## Installation

```sh
$ component install ndhoule/entries
$ npm install @ndhoule/entries
```

## API

### `entries(object : Object)`

Return a nested array containing an object's iterable, own key-value pairs.

```javascript
entries({ a: 1, b: 2 });
// => [['a', 1], ['b', 2]]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/arity
[ci-badge]: https://travis-ci.org/ndhoule/arity.svg?branch=master
npm package: @ndhoule/every
Description: Check if a `predicate` function returns true for all values in a `collection`.
Author: Nathan Houle
Latest version: 2.0.1

# every [![CI][ci-badge]][ci-link]

Check if a `predicate` function returns true for all values in a `collection`.

## Installation

```sh
$ component install ndhoule/every
$ npm install @ndhoule/every
```

## API

### `every(predicate : Function, collection : Array|Object|String)`

```js
var isEven = function(num) { return num % 2 === 0; };

every(isEven, []); // => false
every(isEven, [1, 2]); // => false
every(isEven, [2, 4, 6]); // => true
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/every
[ci-badge]: https://travis-ci.org/ndhoule/every.svg?branch=master
npm package: @ndhoule/extend
Description: Extend an object with the properties of another.
Author: Nathan Houle
Latest version: 2.0.0

# extend [![CI][ci-badge]][ci-link]

Extend an object with the properties of another.

## Installation

```sh
$ component install ndhoule/extend
$ npm install @ndhoule/extend
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/extend
[ci-badge]: https://travis-ci.org/ndhoule/extend.svg?branch=master
npm package: @ndhoule/foldl
Description: Apply a function to each value in a collection, accumulating the results into a single return value.
Author: Nathan Houle
Latest version: 2.0.1

# foldl [![CI][ci-badge]][ci-link]

Apply a function to each value in a collection, accumulating the results into a single return value.

## Installation

```sh
$ component install ndhoule/foldl
$ npm install @ndhoule/foldl
```

## API

### `reduce(iterator : Function, accumulator : *, collection : Array|Object)`

Reduces all the values in a collection down into a single value. Does so by iterating through the collection from left to right, repeatedly calling an `iterator` function and passing to it four arguments: `(accumulator, value, index, collection)`.

```javascript
foldl(function(total, n) {
  return total + n;
}, 0, [1, 2, 3]);
//=> 6

var phonebook = { bob: '555-111-2345', tim: '655-222-6789', sheila: '655-333-1298' };

foldl(function(results, phoneNumber) {
 if (phoneNumber[0] === '6') {
   return results.concat(phoneNumber);
 }
 return results;
}, [], phonebook);
// => ['655-222-6789', '655-333-1298']
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/foldl
[ci-badge]: https://travis-ci.org/ndhoule/foldl.svg?branch=master
npm package: @ndhoule/includes
Description: Determine whether or not a value is contained by a given collection.
Author: Nathan Houle
Latest version: 2.0.1

# includes [![CI][ci-badge]][ci-link]

Determine whether or not a value is contained by a given collection.

Uses [SameValueZero][] (the algorithm used by Object.is) for equality comparisons.

## Installation

```sh
$ component install ndhoule/includes
$ npm install @ndhoule/includes
```

## API

### `includes(searchElement : *, collection : Object|Array|string) => boolean`

```javascript
includes(2, [1, 2, 3]);
//=> true

includes(4, [1, 2, 3]);
//=> false

includes(2, { a: 1, b: 2, c: 3 });
//=> true

includes('a', { a: 1, b: 2, c: 3 });
//=> false

includes('abc', 'xyzabc opq');
//=> true

includes('nope', 'xyzabc opq');
//=> false
```

## License

Released under the [MIT license](LICENSE.md).


[SameValueZero]: https://esdiscuss.org/topic/samevaluezero-comparator-and-compatibility
[ci-link]: https://travis-ci.org/ndhoule/includes
[ci-badge]: https://travis-ci.org/ndhoule/includes.svg?branch=master
npm package: @ndhoule/invoker
Description: Creates a function that invokes a given method.
Author: Nathan Houle
Latest version: 2.0.0

# invoker [![CI][ci-badge]][ci-link]

Creates a function that invokes a given method.

## Installation

```sh
$ component install ndhoule/invoker
$ npm install @ndhoule/invoker
```

## API

### `invoker(method : Function|string) => Function(receiver, ...args)`

Accepts a method name or a function, and returns a function that invokes that method on a receiver.

```javascript
var map = invoker('map');
map([1, 2, 3], function(num) {
  return num + 1;
});
//=> [2, 3, 4]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/invoker
[ci-badge]: https://travis-ci.org/ndhoule/invoker.svg?branch=master
npm package: @ndhoule/keys
Description: Create an array of the owned/enumerable keys of an input object.
Author: Nathan Houle
Latest version: 2.0.0

# keys [![CI][ci-badge]][ci-link]

Create an array of the owned/enumerable keys of an input object.

## Installation

```sh
$ component install ndhoule/keys
$ npm install @ndhoule/keys
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/keys
[ci-badge]: https://travis-ci.org/ndhoule/keys.svg?branch=master
npm package: @ndhoule/map
Description: Apply a function to a each element of a collection and return a new array of results.
Author: Nathan Houle
Latest version: 2.0.1

# map [![CI][ci-badge]][ci-link]

Apply a function to a each element of a collection and return a new array of results.

## Installation

```sh
$ component install ndhoule/map
$ npm install @ndhoule/map
```

## API

### map(iterator : Function, collection : Object|Array|string) => Array

Produce a new array by passing each value in the input `collection` through an `iterator` function and accumulating the results. The `iterator` is passed three arguments: `(value, index, collection)`.

```javascript
var square = function(x) { return x * x; };

map(square, [1, 2, 3]);
//=> [1, 4, 9]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/map
[ci-badge]: https://travis-ci.org/ndhoule/map.svg?branch=master
npm package: @ndhoule/nary
Description: Wrap a function so that it only accepts a predefined number of arguments.
Author: Nathan Houle
Latest version: 2.0.0

# nary [![CI][ci-badge]][ci-link]

Wrap a function so that it only accepts a predefined number of arguments.

## Installation

```sh
$ component install ndhoule/nary
$ npm install @ndhoule/nary
```

## API

### `nary(n : number, func: Function)`

Wrap a function in a wrapper that passes a maximum of `n` arguments to the wrapped function.

```javascript
['1', '2', '3'].map(nary(1, parseInt)); // => [1, 2, 3]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/nary
[ci-badge]: https://travis-ci.org/ndhoule/nary.svg?branch=master
npm package: @ndhoule/pick
Description: Create a shallow copy of an input object that contains only the specified properties.
Author: Nathan Houle
Latest version: 2.0.0

# pick [![CI][ci-badge]][ci-link]

Create a shallow copy of an input object that contains only the specified properties.

```sh
$ component install ndhoule/pick
$ npm install @ndhoule/pick
```

## API

### `pick(props : string|string[], object: Object) => Object`

Return a shallow copy of an input `object` containing only a specified list of properties.

```javascript
var person = { name: 'Tim', occupation: 'enchanter', fears: 'rabbits' };

pick('name', person);
//=> { name: 'Tim' }

pick(['name', 'fears'], person);
//=> { name: 'Tim', fears: 'rabbits' }
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/pick
[ci-badge]: https://travis-ci.org/ndhoule/pick.svg?branch=master
npm package: @ndhoule/prettier-config
Description: @ndhoule's personal Prettier configuration.
Author: Nathan Houle
Latest version: 1.0.0
Deprecated: This configuration is no longer really necessary; Prettier's defaults no longer significantly deviate from this config.

# `@ndhoule/prettier-config`

[@ndhoule's](https://github.com/ndhoule) personal Prettier configuration.

## Usage

```bash
# via npm:
$ npm install -D @ndhoule/prettier-config

# via Yarn:
$ yarn add -D @ndhoule/prettier-config
```

Next, configure Prettier using one of the configuration methods in the [Prettier documentation](https://prettier.io/docs/en/configuration.html#sharing-configurations).
npm package: @ndhoule/rest
Description: Produce a new array composed of all but the first element of the input collection.
Author: Nathan Houle
Latest version: 2.0.0

# rest [![CI][ci-badge]][ci-link]

Produce a new array composed of all but the first element of the input `collection`.

## Installation

```sh
$ component install ndhoule/rest
$ npm install @ndhoule/rest
```

## API

### rest(collection : Array) => Array

Produce a new array composed of all but the first element of the input `collection`.

```javascript
rest([1, 2, 3]); // => [2, 3]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/rest
[ci-badge]: https://travis-ci.org/ndhoule/rest.svg?branch=master
npm package: @ndhoule/some
Description: Check if a predicate function returns true for any value in a collection.
Author: Nathan Houle
Latest version: 2.0.1

# some [![CI][ci-badge]][ci-link]

Check if a `predicate` function returns true for any value in a `collection`.

## Installation

```sh
$ component install ndhoule/some
$ npm install @ndhoule/some
```

## API

### `some(predicate : Function, collection : Array|Object|String)`

```js
var isEven = function(num) { return num % 2 === 0; };

some(isEven, [1, 2, 3]); // => true
some(isEven, [1, 3, 5]); // => false
some(isEven, [2, 4, 6]); // => true
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/some
[ci-badge]: https://travis-ci.org/ndhoule/some.svg?branch=master
npm package: @ndhoule/values
Description: Create an array of the owned/enumerable values of an input object.
Author: Nathan Houle
Latest version: 2.0.1

# values [![CI][ci-badge]][ci-link]

Create a list containing the values of an input object.

## Installation

```sh
$ component install ndhoule/values
$ npm install @ndhoule/values
```

## API

### `values(object : Object) => Array`

```javascript
values({ a: 1, b: 2, c: 3 });
//=> [1, 2, 3]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/values
[ci-badge]: https://travis-ci.org/ndhoule/values.svg?branch=master