From 13b9041ad7ed797291c4454a8a1c85135fb09789 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 14 Jan 2024 22:45:56 +0000 Subject: [PATCH] Auto-generated commit --- NOTICE | 2 +- append/docs/types/index.d.ts | 2 +- async/any-by-right/docs/types/index.d.ts | 10 +- async/any-by/docs/types/index.d.ts | 10 +- async/bifurcate-by/docs/types/index.d.ts | 10 +- async/count-by/docs/types/index.d.ts | 10 +- async/docs/types/index.d.ts | 48 +++--- async/every-by-right/docs/types/index.d.ts | 10 +- async/every-by/docs/types/index.d.ts | 10 +- async/for-each-right/docs/types/index.d.ts | 10 +- async/for-each/docs/types/index.d.ts | 10 +- async/group-by/docs/types/index.d.ts | 18 +-- async/if-else/docs/types/index.d.ts | 2 +- async/if-then/docs/types/index.d.ts | 2 +- async/inmap-right/docs/types/index.d.ts | 10 +- async/inmap/docs/types/index.d.ts | 10 +- async/map-keys/docs/types/index.d.ts | 10 +- async/map-values/docs/types/index.d.ts | 4 +- async/none-by-right/docs/types/index.d.ts | 10 +- async/none-by/docs/types/index.d.ts | 10 +- async/reduce-right/docs/types/index.d.ts | 10 +- async/reduce/docs/types/index.d.ts | 10 +- async/some-by-right/docs/types/index.d.ts | 10 +- async/some-by/docs/types/index.d.ts | 10 +- async/tabulate-by/docs/types/index.d.ts | 10 +- async/try-catch/docs/types/index.d.ts | 2 +- async/try-then/docs/types/index.d.ts | 2 +- decorate-after/docs/types/index.d.ts | 16 +- .../docs/types/index.d.ts | 2 +- dist/index.js | 2 +- dist/index.js.map | 6 +- docs/types/index.d.ts | 138 +++++++++--------- every/lib/main.js | 11 +- if-else/docs/types/index.d.ts | 2 +- if-then/docs/types/index.d.ts | 2 +- map-reduce-right/docs/types/index.d.ts | 8 +- map-reduce/docs/types/index.d.ts | 8 +- map-right/docs/types/index.d.ts | 40 ++--- map/docs/types/index.d.ts | 40 ++--- map2-right/docs/types/index.d.ts | 40 ++--- map2/docs/types/index.d.ts | 40 ++--- map2d/docs/types/index.d.ts | 4 +- map3d/docs/types/index.d.ts | 4 +- map4d/docs/types/index.d.ts | 4 +- map5d/docs/types/index.d.ts | 4 +- named-typed-tuple/docs/types/index.d.ts | 4 +- none/lib/main.js | 11 +- .../docs/types/index.d.ts | 2 +- .../docs/types/index.d.ts | 2 +- .../docs/types/index.d.ts | 2 +- pop/docs/types/index.d.ts | 2 +- prepend/docs/types/index.d.ts | 2 +- push/docs/types/index.d.ts | 2 +- reduce-right/docs/types/index.d.ts | 6 +- reduce/docs/types/index.d.ts | 6 +- reduce2d/docs/types/index.d.ts | 4 +- shift/docs/types/index.d.ts | 2 +- thunk/docs/types/index.d.ts | 2 +- try-catch/docs/types/index.d.ts | 2 +- try-then/docs/types/index.d.ts | 2 +- unshift/docs/types/index.d.ts | 2 +- .../docs/types/index.d.ts | 2 +- writable-property-names/docs/types/index.d.ts | 2 +- 63 files changed, 338 insertions(+), 352 deletions(-) diff --git a/NOTICE b/NOTICE index f7aca1b9..e6e7482f 100644 --- a/NOTICE +++ b/NOTICE @@ -1 +1 @@ -Copyright (c) 2016-2023 The Stdlib Authors. +Copyright (c) 2016-2024 The Stdlib Authors. diff --git a/append/docs/types/index.d.ts b/append/docs/types/index.d.ts index 008353d3..2b60fa6e 100644 --- a/append/docs/types/index.d.ts +++ b/append/docs/types/index.d.ts @@ -36,7 +36,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/async/any-by-right/docs/types/index.d.ts b/async/any-by-right/docs/types/index.d.ts index 2dc180d0..638a7923 100644 --- a/async/any-by-right/docs/types/index.d.ts +++ b/async/any-by-right/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface AnyByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -186,7 +186,7 @@ interface AnyByRightAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -239,7 +239,7 @@ interface AnyByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -297,7 +297,7 @@ interface AnyByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -357,7 +357,7 @@ interface AnyByRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/any-by/docs/types/index.d.ts b/async/any-by/docs/types/index.d.ts index 843f9fbf..9f8d85c4 100644 --- a/async/any-by/docs/types/index.d.ts +++ b/async/any-by/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface AnyByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -186,7 +186,7 @@ interface AnyByAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -239,7 +239,7 @@ interface AnyByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -297,7 +297,7 @@ interface AnyByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -357,7 +357,7 @@ interface AnyByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/bifurcate-by/docs/types/index.d.ts b/async/bifurcate-by/docs/types/index.d.ts index d9c8480b..0aedd0ec 100644 --- a/async/bifurcate-by/docs/types/index.d.ts +++ b/async/bifurcate-by/docs/types/index.d.ts @@ -170,7 +170,7 @@ interface BifurcateByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -215,7 +215,7 @@ interface BifurcateByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -264,7 +264,7 @@ interface BifurcateByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -317,7 +317,7 @@ interface BifurcateByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -378,7 +378,7 @@ interface BifurcateByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { diff --git a/async/count-by/docs/types/index.d.ts b/async/count-by/docs/types/index.d.ts index 2f4ca327..50805480 100644 --- a/async/count-by/docs/types/index.d.ts +++ b/async/count-by/docs/types/index.d.ts @@ -174,7 +174,7 @@ interface CountByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -219,7 +219,7 @@ interface CountByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -267,7 +267,7 @@ interface CountByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -325,7 +325,7 @@ interface CountByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -381,7 +381,7 @@ interface CountByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { diff --git a/async/docs/types/index.d.ts b/async/docs/types/index.d.ts index 15f6e754..0d2f7bc4 100644 --- a/async/docs/types/index.d.ts +++ b/async/docs/types/index.d.ts @@ -75,7 +75,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -129,7 +129,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -183,7 +183,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -280,7 +280,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -392,7 +392,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -446,7 +446,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -500,7 +500,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -551,7 +551,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -646,7 +646,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -687,7 +687,7 @@ interface Namespace { * @param done - callback to invoke upon completion * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function predicate( clbk ) { * setTimeout( onTimeout, 0 ); @@ -715,7 +715,7 @@ interface Namespace { * @param done - callback to invoke upon completion * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function predicate( clbk ) { * setTimeout( onTimeout, 0 ); @@ -766,7 +766,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -816,7 +816,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -908,7 +908,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { @@ -968,7 +968,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var stat = require( `fs` ).stat; + * var stat = require( 'fs' ).stat; * * function getStats( file, next ) { * stat( file, onStats ); @@ -1022,7 +1022,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -1076,7 +1076,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -1131,7 +1131,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -1185,7 +1185,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -1271,7 +1271,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -1327,7 +1327,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -1386,7 +1386,7 @@ interface Namespace { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -1426,7 +1426,7 @@ interface Namespace { * @param done - callback to invoke upon completion * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function x( clbk ) { * setTimeout( onTimeout, 0 ); @@ -1457,7 +1457,7 @@ interface Namespace { * @param done - callback to invoke upon completion * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function x( clbk ) { * setTimeout( onTimeout, 0 ); diff --git a/async/every-by-right/docs/types/index.d.ts b/async/every-by-right/docs/types/index.d.ts index 13ace44c..98e77fd1 100644 --- a/async/every-by-right/docs/types/index.d.ts +++ b/async/every-by-right/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface EveryByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -187,7 +187,7 @@ interface EveryByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -240,7 +240,7 @@ interface EveryByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -299,7 +299,7 @@ interface EveryByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -364,7 +364,7 @@ interface EveryByRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/every-by/docs/types/index.d.ts b/async/every-by/docs/types/index.d.ts index e267947d..88f932e7 100644 --- a/async/every-by/docs/types/index.d.ts +++ b/async/every-by/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface EveryByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -187,7 +187,7 @@ interface EveryByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -240,7 +240,7 @@ interface EveryByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -299,7 +299,7 @@ interface EveryByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -364,7 +364,7 @@ interface EveryByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/for-each-right/docs/types/index.d.ts b/async/for-each-right/docs/types/index.d.ts index 7ec96689..812f1438 100644 --- a/async/for-each-right/docs/types/index.d.ts +++ b/async/for-each-right/docs/types/index.d.ts @@ -135,7 +135,7 @@ interface ForEachRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -186,7 +186,7 @@ interface ForEachRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -236,7 +236,7 @@ interface ForEachRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -291,7 +291,7 @@ interface ForEachRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -349,7 +349,7 @@ interface ForEachRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { diff --git a/async/for-each/docs/types/index.d.ts b/async/for-each/docs/types/index.d.ts index fc09f535..5422f21a 100644 --- a/async/for-each/docs/types/index.d.ts +++ b/async/for-each/docs/types/index.d.ts @@ -135,7 +135,7 @@ interface ForEachAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -186,7 +186,7 @@ interface ForEachAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { @@ -236,7 +236,7 @@ interface ForEachAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -291,7 +291,7 @@ interface ForEachAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -349,7 +349,7 @@ interface ForEachAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error ) { * if ( error ) { diff --git a/async/group-by/docs/types/index.d.ts b/async/group-by/docs/types/index.d.ts index 8480cf4c..0895a3a3 100644 --- a/async/group-by/docs/types/index.d.ts +++ b/async/group-by/docs/types/index.d.ts @@ -273,7 +273,7 @@ interface GroupByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -323,7 +323,7 @@ interface GroupByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -373,7 +373,7 @@ interface GroupByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -417,7 +417,7 @@ interface GroupByAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -466,7 +466,7 @@ interface GroupByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -525,7 +525,7 @@ interface GroupByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -584,7 +584,7 @@ interface GroupByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -637,7 +637,7 @@ interface GroupByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -694,7 +694,7 @@ interface GroupByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { diff --git a/async/if-else/docs/types/index.d.ts b/async/if-else/docs/types/index.d.ts index abaa6cc6..924c3f88 100644 --- a/async/if-else/docs/types/index.d.ts +++ b/async/if-else/docs/types/index.d.ts @@ -70,7 +70,7 @@ type Predicate = ( clbk: PredicateCallback ) => void; * @param done - callback to invoke upon completion * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function predicate( clbk ) { * setTimeout( onTimeout, 0 ); diff --git a/async/if-then/docs/types/index.d.ts b/async/if-then/docs/types/index.d.ts index 2793dbc0..395a4ffb 100644 --- a/async/if-then/docs/types/index.d.ts +++ b/async/if-then/docs/types/index.d.ts @@ -77,7 +77,7 @@ type ResultFunction = ( clbk: Callback ) => void; * @param done - callback to invoke upon completion * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function predicate( clbk ) { * setTimeout( onTimeout, 0 ); diff --git a/async/inmap-right/docs/types/index.d.ts b/async/inmap-right/docs/types/index.d.ts index e68e9e73..f34d5ea3 100644 --- a/async/inmap-right/docs/types/index.d.ts +++ b/async/inmap-right/docs/types/index.d.ts @@ -160,7 +160,7 @@ interface InMapRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -205,7 +205,7 @@ interface InMapRightAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -254,7 +254,7 @@ interface InMapRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -309,7 +309,7 @@ interface InMapRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -366,7 +366,7 @@ interface InMapRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { diff --git a/async/inmap/docs/types/index.d.ts b/async/inmap/docs/types/index.d.ts index add6fbc8..a8654066 100644 --- a/async/inmap/docs/types/index.d.ts +++ b/async/inmap/docs/types/index.d.ts @@ -160,7 +160,7 @@ interface InMapAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -205,7 +205,7 @@ interface InMapAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { @@ -254,7 +254,7 @@ interface InMapAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -309,7 +309,7 @@ interface InMapAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( file, next ) { * var opts = { @@ -366,7 +366,7 @@ interface InMapAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, results ) { * if ( error ) { diff --git a/async/map-keys/docs/types/index.d.ts b/async/map-keys/docs/types/index.d.ts index a051baf4..06a6d842 100644 --- a/async/map-keys/docs/types/index.d.ts +++ b/async/map-keys/docs/types/index.d.ts @@ -164,7 +164,7 @@ interface MapKeysAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { @@ -219,7 +219,7 @@ interface MapKeysAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { @@ -274,7 +274,7 @@ interface MapKeysAsync { * @returns function which maps keys from one object to a new object having the same values * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { @@ -331,7 +331,7 @@ interface MapKeysAsync { * @returns function which maps keys from one object to a new object having the same values * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { @@ -391,7 +391,7 @@ interface MapKeysAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function read( key, value, next ) { * var opts = { diff --git a/async/map-values/docs/types/index.d.ts b/async/map-values/docs/types/index.d.ts index a7f04872..c2eae9d2 100644 --- a/async/map-values/docs/types/index.d.ts +++ b/async/map-values/docs/types/index.d.ts @@ -164,7 +164,7 @@ interface MapValuesAsync { * @throws must provide valid options * * @example - * var stat = require( `fs` ).stat; + * var stat = require( 'fs' ).stat; * * function getStats( file, next ) { * stat( file, onStats ); @@ -389,7 +389,7 @@ interface MapValuesAsync { * @throws must provide valid options * * @example -* var stat = require( `fs` ).stat; +* var stat = require( 'fs' ).stat; * * function getStats( file, next ) { * stat( file, onStats ); diff --git a/async/none-by-right/docs/types/index.d.ts b/async/none-by-right/docs/types/index.d.ts index 60f462ad..c6b04a4b 100644 --- a/async/none-by-right/docs/types/index.d.ts +++ b/async/none-by-right/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface NoneByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -186,7 +186,7 @@ interface NoneByRightAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -240,7 +240,7 @@ interface NoneByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -300,7 +300,7 @@ interface NoneByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -360,7 +360,7 @@ interface NoneByRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/none-by/docs/types/index.d.ts b/async/none-by/docs/types/index.d.ts index d8783671..292f397b 100644 --- a/async/none-by/docs/types/index.d.ts +++ b/async/none-by/docs/types/index.d.ts @@ -137,7 +137,7 @@ interface NoneByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -186,7 +186,7 @@ interface NoneByAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -240,7 +240,7 @@ interface NoneByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -300,7 +300,7 @@ interface NoneByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -360,7 +360,7 @@ interface NoneByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/reduce-right/docs/types/index.d.ts b/async/reduce-right/docs/types/index.d.ts index 16e05393..7dda3374 100644 --- a/async/reduce-right/docs/types/index.d.ts +++ b/async/reduce-right/docs/types/index.d.ts @@ -143,7 +143,7 @@ interface ReduceRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -197,7 +197,7 @@ interface ReduceRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -249,7 +249,7 @@ interface ReduceRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( acc, file, next ) { * var opts = { @@ -307,7 +307,7 @@ interface ReduceRightAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( acc, file, next ) { * var opts = { @@ -369,7 +369,7 @@ interface ReduceRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { diff --git a/async/reduce/docs/types/index.d.ts b/async/reduce/docs/types/index.d.ts index 416a0a3e..ff8fe458 100644 --- a/async/reduce/docs/types/index.d.ts +++ b/async/reduce/docs/types/index.d.ts @@ -143,7 +143,7 @@ interface ReduceAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -192,7 +192,7 @@ interface ReduceAsync { * @param done - function to invoke upon completion * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { @@ -244,7 +244,7 @@ interface ReduceAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( acc, file, next ) { * var opts = { @@ -303,7 +303,7 @@ interface ReduceAsync { * @returns function which invokes the provided function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function read( acc, file, next ) { * var opts = { @@ -365,7 +365,7 @@ interface ReduceAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, acc ) { * if ( error ) { diff --git a/async/some-by-right/docs/types/index.d.ts b/async/some-by-right/docs/types/index.d.ts index aca0fe22..516de403 100644 --- a/async/some-by-right/docs/types/index.d.ts +++ b/async/some-by-right/docs/types/index.d.ts @@ -140,7 +140,7 @@ interface SomeByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -192,7 +192,7 @@ interface SomeByRightAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -245,7 +245,7 @@ interface SomeByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -304,7 +304,7 @@ interface SomeByRightAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -371,7 +371,7 @@ interface SomeByRightAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/some-by/docs/types/index.d.ts b/async/some-by/docs/types/index.d.ts index 59474bfe..08746d64 100644 --- a/async/some-by/docs/types/index.d.ts +++ b/async/some-by/docs/types/index.d.ts @@ -140,7 +140,7 @@ interface SomeByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -192,7 +192,7 @@ interface SomeByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { @@ -245,7 +245,7 @@ interface SomeByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -303,7 +303,7 @@ interface SomeByAsync { * @returns function which invokes the predicate function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function predicate( file, next ) { * var opts = { @@ -366,7 +366,7 @@ interface SomeByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, bool ) { * if ( error ) { diff --git a/async/tabulate-by/docs/types/index.d.ts b/async/tabulate-by/docs/types/index.d.ts index 76ce80d0..13a95b5b 100644 --- a/async/tabulate-by/docs/types/index.d.ts +++ b/async/tabulate-by/docs/types/index.d.ts @@ -170,7 +170,7 @@ interface TabulateByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -221,7 +221,7 @@ interface TabulateByAsync { * @throws must provide valid options * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { @@ -275,7 +275,7 @@ interface TabulateByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -339,7 +339,7 @@ interface TabulateByAsync { * @returns function which invokes the indicator function once for each element in a collection * * @example - * var readFile = require( `@stdlib/fs/read-file` ); + * var readFile = require( '@stdlib/fs/read-file' ); * * function indicator( file, next ) { * var opts = { @@ -405,7 +405,7 @@ interface TabulateByAsync { * @throws must provide valid options * * @example -* var readFile = require( `@stdlib/fs/read-file` ); +* var readFile = require( '@stdlib/fs/read-file' ); * * function done( error, result ) { * if ( error ) { diff --git a/async/try-catch/docs/types/index.d.ts b/async/try-catch/docs/types/index.d.ts index bb68bee2..289c61c7 100644 --- a/async/try-catch/docs/types/index.d.ts +++ b/async/try-catch/docs/types/index.d.ts @@ -41,7 +41,7 @@ type TryFunction = ( clbk: Callback ) => void; * @param done - callback to invoke upon completion * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function x( clbk ) { * setTimeout( onTimeout, 0 ); diff --git a/async/try-then/docs/types/index.d.ts b/async/try-then/docs/types/index.d.ts index a36496d4..eb8ab869 100644 --- a/async/try-then/docs/types/index.d.ts +++ b/async/try-then/docs/types/index.d.ts @@ -64,7 +64,7 @@ type TryFunction = ( clbk: Callback ) => void; * @param done - callback to invoke upon completion * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function x( clbk ) { * setTimeout( onTimeout, 0 ); diff --git a/decorate-after/docs/types/index.d.ts b/decorate-after/docs/types/index.d.ts index 18910376..25599775 100644 --- a/decorate-after/docs/types/index.d.ts +++ b/decorate-after/docs/types/index.d.ts @@ -38,7 +38,7 @@ interface Decorator { * @returns decorator * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; @@ -71,7 +71,7 @@ interface Decorator { * @returns decorator * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function log( v ) { * console.log( v ); @@ -87,7 +87,7 @@ interface Decorator { * // returns 5 * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function counter() { * this.count += 1; @@ -129,7 +129,7 @@ interface Decorator { * @returns decorator * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; @@ -164,7 +164,7 @@ interface Decorator { * @returns decorator * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function log( v ) { * console.log( v ); @@ -180,7 +180,7 @@ interface Decorator { * // returns 5 * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function counter() { * this.count += 1; @@ -216,7 +216,7 @@ interface Decorator { * @returns decorator * * @example -* var abs = require( `@stdlib/math/base/special/abs` ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; @@ -232,7 +232,7 @@ interface Decorator { * // returns -5 * * @example -* var abs = require( `@stdlib/math/base/special/abs` ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; diff --git a/define-nonenumerable-property/docs/types/index.d.ts b/define-nonenumerable-property/docs/types/index.d.ts index 821b92be..c0f28b60 100644 --- a/define-nonenumerable-property/docs/types/index.d.ts +++ b/define-nonenumerable-property/docs/types/index.d.ts @@ -34,7 +34,7 @@ import { PropertyName } from '@stdlib/types/object'; * @param value - value to set * * @example -* var objectKeys = require( `@stdlib/utils/keys` ); +* var objectKeys = require( '@stdlib/utils/keys' ); * * var obj = {}; * diff --git a/dist/index.js b/dist/index.js index ccf6c1ea..4f950e00 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -"use strict";var l=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var wu=l(function(icr,qu){"use strict";var aC=typeof Object.defineProperty=="function"?Object.defineProperty:null;qu.exports=aC});var _u=l(function(ncr,bu){"use strict";var uC=wu();function sC(){try{return uC({},"x",{}),!0}catch(r){return!1}}bu.exports=sC});var Eu=l(function(acr,xu){"use strict";var oC=Object.defineProperty;xu.exports=oC});var Fu=l(function(ucr,Vu){"use strict";var Tu=require("@stdlib/string/format"),te=Object.prototype,Ou=te.toString,Pu=te.__defineGetter__,Au=te.__defineSetter__,lC=te.__lookupGetter__,vC=te.__lookupSetter__;function fC(r,e,t){var i,n,a,u;if(typeof r!="object"||r===null||Ou.call(r)==="[object Array]")throw new TypeError(Tu("invalid argument. First argument must be an object. Value: `%s`.",r));if(typeof t!="object"||t===null||Ou.call(t)==="[object Array]")throw new TypeError(Tu("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(n="value"in t,n&&(lC.call(r,e)||vC.call(r,e)?(i=r.__proto__,r.__proto__=te,delete r[e],r[e]=t.value,r.__proto__=i):r[e]=t.value),a="get"in t,u="set"in t,n&&(a||u))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return a&&Pu&&Pu.call(r,e,t.get),u&&Au&&Au.call(r,e,t.set),r}Vu.exports=fC});var W=l(function(scr,ku){"use strict";var mC=_u(),cC=Eu(),gC=Fu(),kt;mC()?kt=cC:kt=gC;ku.exports=kt});var Su=l(function(ocr,Iu){"use strict";var hC=W();function pC(r,e,t){hC(r,e,{configurable:!1,enumerable:!0,writable:!1,value:t})}Iu.exports=pC});var ie=l(function(lcr,Lu){"use strict";var dC=Su();Lu.exports=dC});var Ru=l(function(vcr,Nu){"use strict";var yC=require("@stdlib/assert/is-collection"),qC=require("@stdlib/string/format");function wC(r){var e,t;if(!yC(r))throw new TypeError(qC("invalid argument. Must provide a collection. Value: `%s`.",r));for(e=r.length,t=0;t=0;a--){if(i=e.call(t,r[a],a,r),i)return!0;n!==r.length&&(a+=r.length-n,n=r.length)}return!1}Uu.exports=AC});var Qu=l(function(hcr,Gu){"use strict";var VC=zu();Gu.exports=VC});var Xu=l(function(pcr,Ju){"use strict";function FC(r,e){var t;for(t=0;t=0)return DC(r,e);throw new TypeError(es("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}ts.exports=$C});var as=l(function(wcr,ns){"use strict";var WC=is();ns.exports=WC});var ss=l(function(bcr,us){"use strict";var KC=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UC=require("@stdlib/string/format");function zC(r){if(!KC(r))throw new TypeError(UC("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));return e;function e(){return arguments[r]}}us.exports=zC});var ls=l(function(_cr,os){"use strict";var GC=ss();os.exports=GC});var fs=l(function(xcr,vs){"use strict";var QC=W();function JC(r,e,t){QC(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}vs.exports=JC});var k=l(function(Ecr,ms){"use strict";var XC=fs();ms.exports=XC});var gs=l(function(Tcr,cs){"use strict";var YC=require("@stdlib/assert/is-plain-object"),It=require("@stdlib/assert/has-own-property"),HC=require("@stdlib/assert/is-boolean").isPrimitive,ZC=require("@stdlib/assert/is-positive-integer").isPrimitive,St=require("@stdlib/string/format");function r2(r,e){return YC(e)?(It(e,"thisArg")&&(r.thisArg=e.thisArg),It(e,"series")&&(r.series=e.series,!HC(r.series))?new TypeError(St("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):It(e,"limit")&&(r.limit=e.limit,!ZC(r.limit))?new TypeError(St("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(St("invalid argument. Options argument must be an object. Value: `%s`.",e))}cs.exports=r2});var ps=l(function(Ocr,hs){"use strict";var e2=require("debug"),dr=e2("any-by-async:limit");function t2(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,dr("Collection length: %d",o),o===0)return dr("Finished processing a collection."),i(null,!1);for(o1){if(i=a2(t,r),i)throw i;n=e}else n=r;if(!ds(n))throw new TypeError(Lt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=n2),a;function a(u,s){if(!i2(u))throw new TypeError(Lt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!ds(s))throw new TypeError(Lt("invalid argument. Last argument must be a function. Value: `%s`.",s));return u2(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}ys.exports=s2});var bs=l(function(Acr,ws){"use strict";var qs=Nt();function o2(r,e,t,i){if(arguments.length<4)return qs(e)(r,t);qs(e,t)(r,i)}ws.exports=o2});var Es=l(function(Vcr,xs){"use strict";var l2=k(),_s=bs(),v2=Nt();l2(_s,"factory",v2);xs.exports=_s});var Os=l(function(Fcr,Ts){"use strict";var f2=require("@stdlib/assert/is-plain-object"),Rt=require("@stdlib/assert/has-own-property"),m2=require("@stdlib/assert/is-boolean").isPrimitive,c2=require("@stdlib/assert/is-positive-integer").isPrimitive,jt=require("@stdlib/string/format");function g2(r,e){return f2(e)?(Rt(e,"thisArg")&&(r.thisArg=e.thisArg),Rt(e,"series")&&(r.series=e.series,!m2(r.series))?new TypeError(jt("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Rt(e,"limit")&&(r.limit=e.limit,!c2(r.limit))?new TypeError(jt("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(jt("invalid argument. Options argument must be an object. Value: `%s`.",e))}Ts.exports=g2});var As=l(function(kcr,Ps){"use strict";var h2=require("debug"),yr=h2("any-by-right-async:limit");function p2(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,yr("Collection length: %d",s),s===0)return yr("Finished processing a collection."),i(null,!1);for(s0&&f();function f(){o-=1,yr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,yr("Encountered an error: %s",c.message),i(c);if(n+=1,yr("Processed %d of %d collection elements.",n,s),yr("Test result: %s",!!g),g&&!a)return a=!0,yr("Finished processing a collection."),i(null,!0);if(o>0)return f();if(n===s)return yr("Finished processing a collection."),i(null,!1)}}}Ps.exports=p2});var Bt=l(function(Icr,Fs){"use strict";var Vs=require("@stdlib/assert/is-function"),d2=require("@stdlib/assert/is-collection"),Ct=require("@stdlib/string/format"),y2=require("@stdlib/constants/float64/pinf"),q2=Os(),w2=As();function b2(r,e){var t,i,n;if(t={},arguments.length>1){if(i=q2(t,r),i)throw i;n=e}else n=r;if(!Vs(n))throw new TypeError(Ct("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=y2),a;function a(u,s){if(!d2(u))throw new TypeError(Ct("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Vs(s))throw new TypeError(Ct("invalid argument. Last argument must be a function. Value: `%s`.",s));return w2(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Fs.exports=b2});var Ss=l(function(Scr,Is){"use strict";var ks=Bt();function _2(r,e,t,i){if(arguments.length<4)return ks(e)(r,t);ks(e,t)(r,i)}Is.exports=_2});var Rs=l(function(Lcr,Ns){"use strict";var x2=k(),Ls=Ss(),E2=Bt();x2(Ls,"factory",E2);Ns.exports=Ls});var Ds=l(function(Ncr,Bs){"use strict";var js=require("@stdlib/assert/is-nan"),T2=require("@stdlib/assert/is-collection"),O2=require("@stdlib/assert/is-string").isPrimitive,P2=require("@stdlib/assert/is-integer").isPrimitive,Cs=require("@stdlib/string/format");function A2(r,e,t){var i,n;if(!T2(r)&&!O2(r))throw new TypeError(Cs("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=r.length,i===0)return-1;if(arguments.length===3){if(!P2(t))throw new TypeError(Cs("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(t>=0){if(t>=i)return-1;n=t}else n=i+t,n<0&&(n=0)}else n=0;if(js(e)){for(;n1){if(i=B2(t,r),i)throw i;n=e}else n=r;if(!Gs(n))throw new TypeError(Dt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=C2),a;function a(u,s){if(!j2(u))throw new TypeError(Dt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Gs(s))throw new TypeError(Dt("invalid argument. Last argument must be a function. Value: `%s`.",s));return D2(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}Qs.exports=M2});var Ys=l(function(Dcr,Xs){"use strict";var Js=Mt();function $2(r,e,t,i){if(arguments.length<4)return Js(e)(r,t);Js(e,t)(r,i)}Xs.exports=$2});var ro=l(function(Mcr,Zs){"use strict";var W2=k(),Hs=Ys(),K2=Mt();W2(Hs,"factory",K2);Zs.exports=Hs});var to=l(function($cr,eo){"use strict";var U2=require("@stdlib/assert/is-function"),z2=require("@stdlib/string/format");function G2(){var r,e,t;if(r=arguments.length,r<2)throw new Error("insufficient arguments. Must provide multiple functions to compose.");for(e=new Array(r),t=0;t1){if(i=nB(t,r),i)throw i;n=e}else n=r;if(!lo(n))throw new TypeError(Kt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=iB),a;function a(u,s){if(!tB(u))throw new TypeError(Kt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!lo(s))throw new TypeError(Kt("invalid argument. Last argument must be a function. Value: `%s`.",s));return aB(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}vo.exports=uB});var co=l(function(Gcr,mo){"use strict";var fo=Ut();function sB(r,e,t,i){if(arguments.length<4)return fo(e)(r,t);fo(e,t)(r,i)}mo.exports=sB});var po=l(function(Qcr,ho){"use strict";var oB=k(),go=co(),lB=Ut();oB(go,"factory",lB);ho.exports=go});var qo=l(function(Jcr,yo){"use strict";var zt=require("@stdlib/assert/is-function"),Gt=require("@stdlib/string/format");function vB(r,e,t,i){var n,a;if(!zt(r))throw new TypeError(Gt("invalid argument. First argument must be a function. Value: `%s`.",r));if(!zt(e))throw new TypeError(Gt("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!zt(t))throw new TypeError(Gt("invalid argument. Third argument must be a function. Value: `%s`.",t));n=[],a=0,r.call(i,a,u);function u(o){var v;if(o)return t(o);if(a+=1,arguments.length>1)for(n=new Array(arguments.length-1),v=1;v1)for(n=new Array(arguments.length-1),v=1;v1){if(i=_B(t,r),i)throw i;n=e}else n=r;if(!Fo(n))throw new TypeError(Ht("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bB),a;function a(u,s){if(!wB(u))throw new TypeError(Ht("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Fo(s))throw new TypeError(Ht("invalid argument. Last argument must be a function. Value: `%s`.",s));return xB(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}ko.exports=EB});var Lo=l(function(tgr,So){"use strict";var Io=Zt();function TB(r,e,t,i){if(arguments.length<4)return Io(e)(r,t);Io(e,t)(r,i)}So.exports=TB});var jo=l(function(igr,Ro){"use strict";var OB=k(),No=Lo(),PB=Zt();OB(No,"factory",PB);Ro.exports=No});var Bo=l(function(ngr,Co){"use strict";var AB=require("@stdlib/assert/is-plain-object"),ri=require("@stdlib/assert/has-own-property"),VB=require("@stdlib/assert/is-boolean").isPrimitive,FB=require("@stdlib/assert/is-positive-integer").isPrimitive,ei=require("@stdlib/string/format");function kB(r,e){return AB(e)?(ri(e,"thisArg")&&(r.thisArg=e.thisArg),ri(e,"series")&&(r.series=e.series,!VB(r.series))?new TypeError(ei("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ri(e,"limit")&&(r.limit=e.limit,!FB(r.limit))?new TypeError(ei("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ei("invalid argument. Options argument must be an object. Value: `%s`.",e))}Co.exports=kB});var Mo=l(function(agr,Do){"use strict";var IB=require("debug"),wr=IB("every-by-right-async:limit");function SB(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,wr("Collection length: %d",s),s===0)return wr("Finished processing a collection."),i(null,!0);for(s0&&f();function f(){o-=1,wr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,wr("Encountered an error: %s",c.message),i(c);if(n+=1,wr("Processed %d of %d collection elements.",n,s),wr("Test result: %s",!!g),!g&&!a)return a=!0,wr("Finished processing a collection."),i(null,!1);if(o>0)return f();if(n===s)return wr("Finished processing a collection."),i(null,!0)}}}Do.exports=SB});var ii=l(function(ugr,Wo){"use strict";var $o=require("@stdlib/assert/is-function"),LB=require("@stdlib/assert/is-collection"),NB=require("@stdlib/constants/float64/pinf"),ti=require("@stdlib/string/format"),RB=Bo(),jB=Mo();function CB(r,e){var t,i,n;if(t={},arguments.length>1){if(i=RB(t,r),i)throw i;n=e}else n=r;if(!$o(n))throw new TypeError(ti("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=NB),a;function a(u,s){if(!LB(u))throw new TypeError(ti("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!$o(s))throw new TypeError(ti("invalid argument. Last argument must be a function. Value: `%s`.",s));return jB(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Wo.exports=CB});var zo=l(function(sgr,Uo){"use strict";var Ko=ii();function BB(r,e,t,i){if(arguments.length<4)return Ko(e)(r,t);Ko(e,t)(r,i)}Uo.exports=BB});var Jo=l(function(ogr,Qo){"use strict";var DB=k(),Go=zo(),MB=ii();DB(Go,"factory",MB);Qo.exports=Go});var Yo=l(function(lgr,Xo){"use strict";var $B=require("@stdlib/assert/is-plain-object"),ni=require("@stdlib/assert/has-own-property"),WB=require("@stdlib/assert/is-boolean").isPrimitive,KB=require("@stdlib/assert/is-positive-integer").isPrimitive,ai=require("@stdlib/string/format");function UB(r,e){return $B(e)?(ni(e,"thisArg")&&(r.thisArg=e.thisArg),ni(e,"series")&&(r.series=e.series,!WB(r.series))?new TypeError(ai("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ni(e,"limit")&&(r.limit=e.limit,!KB(r.limit))?new TypeError(ai("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ai("invalid argument. Options argument must be an object. Value: `%s`.",e))}Xo.exports=UB});var Zo=l(function(vgr,Ho){"use strict";var zB=require("debug"),Nr=zB("for-each-async:limit");function GB(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,Nr("Collection length: %d",o),o===0)return Nr("Finished processing a collection."),i();for(o1){if(i=XB(t,r),i)throw i;n=e}else n=r;if(!rl(n))throw new TypeError(ui("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=JB),a;function a(u,s){if(!QB(u))throw new TypeError(ui("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!rl(s))throw new TypeError(ui("invalid argument. Last argument must be a function. Value: `%s`.",s));return YB(u,t,n,o);function o(v){if(v)return s(v);s()}}}el.exports=HB});var nl=l(function(mgr,il){"use strict";var tl=si();function ZB(r,e,t,i){if(arguments.length<4)return tl(e)(r,t);tl(e,t)(r,i)}il.exports=ZB});var sl=l(function(cgr,ul){"use strict";var rD=k(),al=nl(),eD=si();rD(al,"factory",eD);ul.exports=al});var ll=l(function(ggr,ol){"use strict";var tD=require("@stdlib/assert/is-plain-object"),oi=require("@stdlib/assert/has-own-property"),iD=require("@stdlib/assert/is-boolean").isPrimitive,nD=require("@stdlib/assert/is-positive-integer").isPrimitive,li=require("@stdlib/string/format");function aD(r,e){return tD(e)?(oi(e,"thisArg")&&(r.thisArg=e.thisArg),oi(e,"series")&&(r.series=e.series,!iD(r.series))?new TypeError(li("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):oi(e,"limit")&&(r.limit=e.limit,!nD(r.limit))?new TypeError(li("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(li("invalid argument. Options argument must be an object. Value: `%s`.",e))}ol.exports=aD});var fl=l(function(hgr,vl){"use strict";var uD=require("debug"),Rr=uD("for-each-right-async:limit");function sD(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,Rr("Collection length: %d",s),s===0)return Rr("Finished processing a collection."),i();for(s0&&f();function f(){o-=1,Rr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c){if(!a){if(c)return a=!0,Rr("Encountered an error: %s",c.message),i(c);if(n+=1,Rr("Processed %d of %d collection elements.",n,s),o>0)return f();if(n===s)return Rr("Finished processing a collection."),i()}}}vl.exports=sD});var fi=l(function(pgr,cl){"use strict";var ml=require("@stdlib/assert/is-function"),oD=require("@stdlib/assert/is-collection"),vi=require("@stdlib/string/format"),lD=require("@stdlib/constants/float64/pinf"),vD=ll(),fD=fl();function mD(r,e){var t,i,n;if(t={},arguments.length>1){if(i=vD(t,r),i)throw i;n=e}else n=r;if(!ml(n))throw new TypeError(vi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=lD),a;function a(u,s){if(!oD(u))throw new TypeError(vi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!ml(s))throw new TypeError(vi("invalid argument. Last argument must be a function. Value: `%s`.",s));return fD(u,t,n,o);function o(v){if(v)return s(v);s()}}}cl.exports=mD});var pl=l(function(dgr,hl){"use strict";var gl=fi();function cD(r,e,t,i){if(arguments.length<4)return gl(e)(r,t);gl(e,t)(r,i)}hl.exports=cD});var ql=l(function(ygr,yl){"use strict";var gD=k(),dl=pl(),hD=fi();gD(dl,"factory",hD);yl.exports=dl});var bl=l(function(qgr,wl){"use strict";var pD=require("@stdlib/assert/is-function"),dD=require("@stdlib/string/format");function yD(){var r,e,t;if(r=arguments.length,r<2)throw new Error("insufficient arguments. Must provide multiple functions to execute sequentially.");for(e=new Array(r),t=0;t1){if(i=VD(t,r),i)throw i;n=e}else n=r;if(!Vl(n))throw new TypeError(ci("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=AD),a;function a(u,s){if(!PD(u))throw new TypeError(ci("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Vl(s))throw new TypeError(ci("invalid argument. Last argument must be a function. Value: `%s`.",s));return FD(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}Fl.exports=kD});var Sl=l(function(Egr,Il){"use strict";var kl=gi();function ID(r,e,t,i){if(arguments.length<4)return kl(e)(r,t);kl(e,t)(r,i)}Il.exports=ID});var Rl=l(function(Tgr,Nl){"use strict";var SD=k(),Ll=Sl(),LD=gi();SD(Ll,"factory",LD);Nl.exports=Ll});var Dl=l(function(Ogr,Bl){"use strict";var jl=require("@stdlib/assert/is-function"),Cl=require("@stdlib/string/format");function ND(r,e,t,i){if(!jl(r))throw new TypeError(Cl("invalid argument. First argument must be a function. Value: `%s`.",r));if(!jl(i))throw new TypeError(Cl("invalid argument. Last argument must be a function. Value: `%s`.",i));r(n);function n(a,u){if(a)return i(a);if(u)return i(null,e);i(null,t)}}Bl.exports=ND});var $l=l(function(Pgr,Ml){"use strict";var RD=Dl();Ml.exports=RD});var Kl=l(function(Agr,Wl){"use strict";var Me=require("@stdlib/assert/is-function"),$e=require("@stdlib/string/format");function jD(r,e,t,i){if(!Me(r))throw new TypeError($e("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Me(e))throw new TypeError($e("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!Me(t))throw new TypeError($e("invalid argument. Third argument must be a function. Value: `%s`.",t));if(!Me(i))throw new TypeError($e("invalid argument. Last argument must be a function. Value: `%s`.",i));r(n);function n(u,s){if(u)return i(u);if(s)return e(a);t(a)}function a(u){var s,o,v;if(u)return i(u);for(s=arguments.length,o=new Array(s),o[0]=null,v=1;v1){if(i=GD(t,r),i)throw i;n=e}else n=r;if(!Yl(n))throw new TypeError(di("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=zD),a;function a(u,s){if(!UD(u))throw new TypeError(di("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Yl(s))throw new TypeError(di("invalid argument. Last argument must be a function. Value: `%s`.",s));return QD(u,t,n,o);function o(v){if(v)return s(v,u);s(null,u)}}}Hl.exports=JD});var ev=l(function(Sgr,rv){"use strict";var Zl=yi();function XD(r,e,t,i){if(arguments.length<4)return Zl(e)(r,t);Zl(e,t)(r,i)}rv.exports=XD});var nv=l(function(Lgr,iv){"use strict";var YD=k(),tv=ev(),HD=yi();YD(tv,"factory",HD);iv.exports=tv});var uv=l(function(Ngr,av){"use strict";var ZD=require("@stdlib/assert/is-plain-object"),qi=require("@stdlib/assert/has-own-property"),rM=require("@stdlib/assert/is-boolean").isPrimitive,eM=require("@stdlib/assert/is-positive-integer").isPrimitive,wi=require("@stdlib/string/format");function tM(r,e){return ZD(e)?(qi(e,"thisArg")&&(r.thisArg=e.thisArg),qi(e,"series")&&(r.series=e.series,!rM(r.series))?new TypeError(wi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):qi(e,"limit")&&(r.limit=e.limit,!eM(r.limit))?new TypeError(wi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(wi("invalid argument. Options argument must be an object. Value: `%s`.",e))}av.exports=tM});var ov=l(function(Rgr,sv){"use strict";var iM=require("debug"),Cr=iM("inmap-right-async:limit");function nM(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,Cr("Collection length: %d",s),s===0)return Cr("Finished processing a collection."),i();for(s0&&f();function f(){var c;o-=1,c=o,Cr("Collection element %d: %s.",c,JSON.stringify(r[c])),t.length===2?t.call(e.thisArg,r[c],g):t.length===3?t.call(e.thisArg,r[c],c,g):t.call(e.thisArg,r[c],c,r,g);function g(h,y){if(!a){if(h)return a=!0,m(h);r[c]=y,m()}}}function m(c){if(c)return Cr("Encountered an error: %s",c.message),i(c);if(n+=1,Cr("Processed %d of %d collection elements.",n,s),o>0)return f();if(n===s)return Cr("Finished processing a collection."),i()}}sv.exports=nM});var _i=l(function(jgr,vv){"use strict";var lv=require("@stdlib/assert/is-function"),aM=require("@stdlib/assert/is-collection"),bi=require("@stdlib/string/format"),uM=require("@stdlib/constants/float64/pinf"),sM=uv(),oM=ov();function lM(r,e){var t,i,n;if(t={},arguments.length>1){if(i=sM(t,r),i)throw i;n=e}else n=r;if(!lv(n))throw new TypeError(bi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=uM),a;function a(u,s){if(!aM(u))throw new TypeError(bi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!lv(s))throw new TypeError(bi("invalid argument. Last argument must be a function. Value: `%s`.",s));return oM(u,t,n,o);function o(v){if(v)return s(v,u);s(null,u)}}}vv.exports=lM});var cv=l(function(Cgr,mv){"use strict";var fv=_i();function vM(r,e,t,i){if(arguments.length<4)return fv(e)(r,t);fv(e,t)(r,i)}mv.exports=vM});var pv=l(function(Bgr,hv){"use strict";var fM=k(),gv=cv(),mM=_i();fM(gv,"factory",mM);hv.exports=gv});var yv=l(function(Dgr,dv){"use strict";var cM=require("@stdlib/assert/is-plain-object"),xi=require("@stdlib/assert/has-own-property"),gM=require("@stdlib/assert/is-boolean").isPrimitive,hM=require("@stdlib/assert/is-positive-integer").isPrimitive,Ei=require("@stdlib/string/format");function pM(r,e){return cM(e)?(xi(e,"thisArg")&&(r.thisArg=e.thisArg),xi(e,"series")&&(r.series=e.series,!gM(r.series))?new TypeError(Ei("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):xi(e,"limit")&&(r.limit=e.limit,!hM(r.limit))?new TypeError(Ei("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ei("invalid argument. Options argument must be an object. Value: `%s`.",e))}dv.exports=pM});var wv=l(function(Mgr,qv){"use strict";var dM=require("debug"),Gr=dM("map-function-async:limit");function yM(r,e,t,i){var n,a,u,s,o,v,f;if(Gr("Number of invocations: %d",r),u=new Array(r),r===0)return Gr("Finished invoking a function."),i(null,u);for(r1){if(i=bM(t,r),i)throw i;n=e}else n=r;if(!bv(n))throw new TypeError(Ti("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=wM),a;function a(u,s){if(!qM(u))throw new TypeError(Ti("invalid argument. Number of function invocations must be a nonnegative integer. Value: `%s`.",u));if(!bv(s))throw new TypeError(Ti("invalid argument. Last argument must be a function. Value: `%s`.",s));return _M(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}_v.exports=xM});var Tv=l(function(Wgr,Ev){"use strict";var xv=Oi();function EM(r,e,t,i){if(arguments.length<4)return xv(r)(e,t);xv(t,r)(e,i)}Ev.exports=EM});var Av=l(function(Kgr,Pv){"use strict";var TM=k(),Ov=Tv(),OM=Oi();TM(Ov,"factory",OM);Pv.exports=Ov});var Fv=l(function(Ugr,Vv){"use strict";var PM=require("@stdlib/assert/is-plain-object"),Pi=require("@stdlib/assert/has-own-property"),AM=require("@stdlib/assert/is-boolean").isPrimitive,VM=require("@stdlib/assert/is-positive-integer").isPrimitive,Ai=require("@stdlib/string/format");function FM(r,e){return PM(e)?(Pi(e,"thisArg")&&(r.thisArg=e.thisArg),Pi(e,"series")&&(r.series=e.series,!AM(r.series))?new TypeError(Ai("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Pi(e,"limit")&&(r.limit=e.limit,!VM(r.limit))?new TypeError(Ai("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ai("invalid argument. Options argument must be an object. Value: `%s`.",e))}Vv.exports=FM});var We=l(function(zgr,kv){"use strict";function kM(r){return Object.keys(Object(r))}kv.exports=kM});var Sv=l(function(Ggr,Iv){"use strict";var IM=We();function SM(){return(IM(arguments)||"").length!==2}function LM(){return SM(1,2)}Iv.exports=LM});var Nv=l(function(Qgr,Lv){"use strict";var NM=typeof Object.keys!="undefined";Lv.exports=NM});var Cv=l(function(Jgr,jv){"use strict";var RM=require("@stdlib/assert/is-arguments"),Rv=We(),jM=Array.prototype.slice;function CM(r){return RM(r)?Rv(jM.call(r)):Rv(r)}jv.exports=CM});var Dv=l(function(Xgr,Bv){"use strict";function BM(){}Bv.exports=BM});var Ke=l(function(Ygr,Mv){"use strict";var DM=Dv();Mv.exports=DM});var Wv=l(function(Hgr,$v){"use strict";var MM=require("@stdlib/assert/is-enumerable-property"),$M=Ke(),WM=MM($M,"prototype");$v.exports=WM});var Uv=l(function(Zgr,Kv){"use strict";var KM=require("@stdlib/assert/is-enumerable-property"),UM={toString:null},zM=!KM(UM,"toString");Kv.exports=zM});var Gv=l(function(rhr,zv){"use strict";var GM=/./;zv.exports=GM});var Jv=l(function(ehr,Qv){"use strict";function QM(){return new Function("return this;")()}Qv.exports=QM});var Yv=l(function(thr,Xv){"use strict";var JM=typeof self=="object"?self:null;Xv.exports=JM});var Zv=l(function(ihr,Hv){"use strict";var XM=typeof window=="object"?window:null;Hv.exports=XM});var ef=l(function(nhr,rf){"use strict";var YM=typeof global=="object"?global:null;rf.exports=YM});var nf=l(function(ahr,tf){"use strict";var HM=typeof globalThis=="object"?globalThis:null;tf.exports=HM});var vf=l(function(uhr,lf){"use strict";var ZM=require("@stdlib/assert/is-boolean").isPrimitive,r$=require("@stdlib/string/format"),e$=Jv(),af=Yv(),uf=Zv(),sf=ef(),of=nf();function t$(r){if(arguments.length){if(!ZM(r))throw new TypeError(r$("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return e$()}if(of)return of;if(af)return af;if(uf)return uf;if(sf)return sf;throw new Error("unexpected error. Unable to resolve global object.")}lf.exports=t$});var Vi=l(function(shr,ff){"use strict";var i$=vf();ff.exports=i$});var gf=l(function(ohr,cf){"use strict";var n$=Vi(),mf=n$(),a$=mf.document&&mf.document.childNodes;cf.exports=a$});var pf=l(function(lhr,hf){"use strict";var u$=Int8Array;hf.exports=u$});var yf=l(function(vhr,df){"use strict";var s$=Gv(),o$=gf(),l$=pf();function v$(){return typeof s$=="function"||typeof l$=="object"||typeof o$=="function"}df.exports=v$});var Fi=l(function(fhr,qf){"use strict";var f$=Object.prototype.toString;qf.exports=f$});var bf=l(function(mhr,wf){"use strict";var m$=Fi();function c$(r){return m$.call(r)}wf.exports=c$});var Ef=l(function(chr,xf){"use strict";var _f=require("@stdlib/symbol/ctor"),g$=typeof _f=="function"?_f.toStringTag:"";xf.exports=g$});var Of=l(function(ghr,Tf){"use strict";var h$=require("@stdlib/assert/has-own-property"),we=Ef(),ki=Fi();function p$(r){var e,t,i;if(r==null)return ki.call(r);t=r[we],e=h$(r,we);try{r[we]=void 0}catch(n){return ki.call(r)}return i=ki.call(r),e?r[we]=t:delete r[we],i}Tf.exports=p$});var Ue=l(function(hhr,Pf){"use strict";var d$=require("@stdlib/assert/has-tostringtag-support"),y$=bf(),q$=Of(),Ii;d$()?Ii=q$:Ii=y$;Pf.exports=Ii});var Vf=l(function(phr,Af){"use strict";var w$=Ue(),b$=require("@stdlib/regexp/function-name").REGEXP,_$=require("@stdlib/assert/is-buffer");function x$(r){var e,t,i;if(t=w$(r).slice(8,-1),(t==="Object"||t==="Error")&&r.constructor){if(i=r.constructor,typeof i.name=="string")return i.name;if(e=b$.exec(i.toString()),e)return e[1]}return _$(r)?"Buffer":t}Af.exports=x$});var ze=l(function(dhr,Ff){"use strict";var E$=Vf();Ff.exports=E$});var If=l(function(yhr,kf){"use strict";var T$=ze();function O$(r){var e;return r===null?"null":(e=typeof r,e==="object"?T$(r).toLowerCase():e)}kf.exports=O$});var Lf=l(function(qhr,Sf){"use strict";var P$=ze();function A$(r){return P$(r).toLowerCase()}Sf.exports=A$});var be=l(function(whr,Nf){"use strict";var V$=yf(),F$=If(),k$=Lf(),I$=V$()?k$:F$;Nf.exports=I$});var Si=l(function(bhr,Rf){"use strict";function S$(r){return r.constructor&&r.constructor.prototype===r}Rf.exports=S$});var jf=l(function(_hr,L$){L$.exports=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"]});var Bf=l(function(xhr,Cf){"use strict";var N$=typeof window=="undefined"?void 0:window;Cf.exports=N$});var Wf=l(function(Ehr,$f){"use strict";var R$=require("@stdlib/assert/has-own-property"),j$=H(),Df=be(),C$=Si(),B$=jf(),ne=Bf(),Mf;function D$(){var r;if(Df(ne)==="undefined")return!1;for(r in ne)try{j$(B$,r)===-1&&R$(ne,r)&&ne[r]!==null&&Df(ne[r])==="object"&&C$(ne[r])}catch(e){return!0}return!1}Mf=D$();$f.exports=Mf});var Uf=l(function(Thr,Kf){"use strict";var M$=typeof window!="undefined";Kf.exports=M$});var Qf=l(function(Ohr,Gf){"use strict";var $$=Wf(),zf=Si(),W$=Uf();function K$(r){if(W$===!1&&!$$)return zf(r);try{return zf(r)}catch(e){return!1}}Gf.exports=K$});var Jf=l(function(Phr,U$){U$.exports=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]});var Hf=l(function(Ahr,Yf){"use strict";var z$=require("@stdlib/assert/is-object-like"),Li=require("@stdlib/assert/has-own-property"),G$=require("@stdlib/assert/is-arguments"),Q$=Wv(),J$=Uv(),X$=Qf(),Xf=Jf();function Y$(r){var e,t,i,n,a,u,s;if(n=[],G$(r)){for(s=0;s0&&!Li(r,"0"))for(s=0;s %s: %s",P,JSON.stringify(y)),m[P]=y,h()}}}function h(y){if(y)return Vr("Encountered an error: %s",y.message),i(y);if(a+=1,Vr("Processed %d of %d properties.",a,v),f1){if(i=oW(t,r),i)throw i;n=e}else n=r;if(!nm(n))throw new TypeError(Ni("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=sW),a;function a(u,s){if(typeof u!="object"||u===null)throw new TypeError(Ni("invalid argument. First argument must be an object. Value: `%s`.",u));if(!nm(s))throw new TypeError(Ni("invalid argument. Last argument must be a function. Value: `%s`.",s));return lW(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}am.exports=vW});var om=l(function(Shr,sm){"use strict";var um=Ri();function fW(r,e,t,i){if(arguments.length<4)return um(e)(r,t);um(e,t)(r,i)}sm.exports=fW});var fm=l(function(Lhr,vm){"use strict";var mW=k(),lm=om(),cW=Ri();mW(lm,"factory",cW);vm.exports=lm});var cm=l(function(Nhr,mm){"use strict";var gW=require("@stdlib/assert/is-plain-object"),ji=require("@stdlib/assert/has-own-property"),hW=require("@stdlib/assert/is-boolean").isPrimitive,pW=require("@stdlib/assert/is-positive-integer").isPrimitive,Ci=require("@stdlib/string/format");function dW(r,e){return gW(e)?(ji(e,"thisArg")&&(r.thisArg=e.thisArg),ji(e,"series")&&(r.series=e.series,!hW(r.series))?new TypeError(Ci("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ji(e,"limit")&&(r.limit=e.limit,!pW(r.limit))?new TypeError(Ci("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ci("invalid argument. Options argument must be an object. Value: `%s`.",e))}mm.exports=dW});var hm=l(function(Rhr,gm){"use strict";var yW=require("debug"),qW=z(),Fr=yW("map-values-async:limit");function wW(r,e,t,i){var n,a,u,s,o,v,f,m,c;if(u=qW(r),v=u.length,Fr("Number of keys: %d",v),m={},v===0)return Fr("Finished processing an object."),i(null,m);for(v %s: %s",y,JSON.stringify(E)),m[y]=E,h()}}}function h(y){if(y)return Fr("Encountered an error: %s",y.message),i(y);if(a+=1,Fr("Processed %d of %d properties.",a,v),f1){if(i=_W(t,r),i)throw i;n=e}else n=r;if(!pm(n))throw new TypeError(Bi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bW),a;function a(u,s){if(typeof u!="object"||u===null)throw new TypeError(Bi("invalid argument. First argument must be an object. Value: `%s`.",u));if(!pm(s))throw new TypeError(Bi("invalid argument. Last argument must be a function. Value: `%s`.",s));return xW(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}dm.exports=EW});var wm=l(function(Chr,qm){"use strict";var ym=Di();function TW(r,e,t,i){if(arguments.length<4)return ym(e)(r,t);ym(e,t)(r,i)}qm.exports=TW});var xm=l(function(Bhr,_m){"use strict";var OW=k(),bm=wm(),PW=Di();OW(bm,"factory",PW);_m.exports=bm});var Tm=l(function(Dhr,Em){"use strict";var AW=require("@stdlib/assert/is-plain-object"),Mi=require("@stdlib/assert/has-own-property"),VW=require("@stdlib/assert/is-boolean").isPrimitive,FW=require("@stdlib/assert/is-positive-integer").isPrimitive,$i=require("@stdlib/string/format");function kW(r,e){return AW(e)?(Mi(e,"thisArg")&&(r.thisArg=e.thisArg),Mi(e,"series")&&(r.series=e.series,!VW(r.series))?new TypeError($i("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Mi(e,"limit")&&(r.limit=e.limit,!FW(r.limit))?new TypeError($i("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError($i("invalid argument. Options argument must be an object. Value: `%s`.",e))}Em.exports=kW});var Pm=l(function(Mhr,Om){"use strict";var IW=require("debug"),br=IW("none-by-async:limit");function SW(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,br("Collection length: %d",o),o===0)return br("Finished processing a collection."),i(null,!0);for(o1){if(i=RW(t,r),i)throw i;n=e}else n=r;if(!Am(n))throw new TypeError(Wi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=NW),a;function a(u,s){if(!LW(u))throw new TypeError(Wi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Am(s))throw new TypeError(Wi("invalid argument. Last argument must be a function. Value: `%s`.",s));return jW(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Vm.exports=CW});var Im=l(function(Whr,km){"use strict";var Fm=Ki();function BW(r,e,t,i){if(arguments.length<4)return Fm(e)(r,t);Fm(e,t)(r,i)}km.exports=BW});var Nm=l(function(Khr,Lm){"use strict";var DW=k(),Sm=Im(),MW=Ki();DW(Sm,"factory",MW);Lm.exports=Sm});var jm=l(function(Uhr,Rm){"use strict";var $W=require("@stdlib/assert/is-plain-object"),Ui=require("@stdlib/assert/has-own-property"),WW=require("@stdlib/assert/is-boolean").isPrimitive,KW=require("@stdlib/assert/is-positive-integer").isPrimitive,zi=require("@stdlib/string/format");function UW(r,e){return $W(e)?(Ui(e,"thisArg")&&(r.thisArg=e.thisArg),Ui(e,"series")&&(r.series=e.series,!WW(r.series))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Ui(e,"limit")&&(r.limit=e.limit,!KW(r.limit))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}Rm.exports=UW});var Bm=l(function(zhr,Cm){"use strict";var zW=require("debug"),_r=zW("none-by-right-async:limit");function GW(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,_r("Collection length: %d",s),s===0)return _r("Finished processing a collection."),i(null,!0);for(s0&&f();function f(){o-=1,_r("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,_r("Encountered an error: %s",c.message),i(c);if(n+=1,_r("Processed %d of %d collection elements.",n,s),_r("Test result: %s",!!g),g&&!a)return a=!0,_r("Finished processing a collection."),i(null,!1);if(o>0)return f();if(n===s)return _r("Finished processing a collection."),i(null,!0)}}}Cm.exports=GW});var Qi=l(function(Ghr,Mm){"use strict";var Dm=require("@stdlib/assert/is-function"),QW=require("@stdlib/assert/is-collection"),Gi=require("@stdlib/string/format"),JW=require("@stdlib/constants/float64/pinf"),XW=jm(),YW=Bm();function HW(r,e){var t,i,n;if(t={},arguments.length>1){if(i=XW(t,r),i)throw i;n=e}else n=r;if(!Dm(n))throw new TypeError(Gi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=JW),a;function a(u,s){if(!QW(u))throw new TypeError(Gi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Dm(s))throw new TypeError(Gi("invalid argument. Last argument must be a function. Value: `%s`.",s));return YW(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Mm.exports=HW});var Km=l(function(Qhr,Wm){"use strict";var $m=Qi();function ZW(r,e,t,i){if(arguments.length<4)return $m(e)(r,t);$m(e,t)(r,i)}Wm.exports=ZW});var Gm=l(function(Jhr,zm){"use strict";var r3=k(),Um=Km(),e3=Qi();r3(Um,"factory",e3);zm.exports=Um});var Jm=l(function(Xhr,Qm){"use strict";var t3=require("@stdlib/assert/is-plain-object"),Ji=require("@stdlib/assert/has-own-property"),i3=require("@stdlib/assert/is-boolean").isPrimitive,n3=require("@stdlib/assert/is-positive-integer").isPrimitive,Xi=require("@stdlib/string/format");function a3(r,e){return t3(e)?(Ji(e,"thisArg")&&(r.thisArg=e.thisArg),Ji(e,"series")&&(r.series=e.series,!i3(r.series))?new TypeError(Xi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Ji(e,"limit")&&(r.limit=e.limit,!n3(r.limit))?new TypeError(Xi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Xi("invalid argument. Options argument must be an object. Value: `%s`.",e))}Qm.exports=a3});var Ym=l(function(Yhr,Xm){"use strict";var u3=require("debug"),kr=u3("reduce-async:limit");function s3(r,e,t,i,n){var a,u,s,o,v,f,m;if(v=r.length,kr("Collection length: %d",v),v===0)return kr("Finished processing a collection."),n(null,e);for(v1){if(i=v3(t,r),i)throw i;n=e}else n=r;if(!Hm(n))throw new TypeError(Yi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series===void 0&&t.limit===void 0&&(t.series=!0),t.series?t.limit=1:t.limit||(t.limit=l3),a;function a(u,s,o){if(!o3(u))throw new TypeError(Yi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Hm(o))throw new TypeError(Yi("invalid argument. Last argument must be a function. Value: `%s`.",o));return f3(u,s,t,n,v);function v(f,m){if(f)return o(f);o(null,m)}}}Zm.exports=m3});var tc=l(function(Zhr,ec){"use strict";var rc=Hi();function c3(r,e,t,i,n){if(arguments.length<5)return rc(t)(r,e,i);rc(t,i)(r,e,n)}ec.exports=c3});var ac=l(function(rpr,nc){"use strict";var g3=k(),ic=tc(),h3=Hi();g3(ic,"factory",h3);nc.exports=ic});var sc=l(function(epr,uc){"use strict";var p3=require("@stdlib/assert/is-plain-object"),Zi=require("@stdlib/assert/has-own-property"),d3=require("@stdlib/assert/is-boolean").isPrimitive,y3=require("@stdlib/assert/is-positive-integer").isPrimitive,rn=require("@stdlib/string/format");function q3(r,e){return p3(e)?(Zi(e,"thisArg")&&(r.thisArg=e.thisArg),Zi(e,"series")&&(r.series=e.series,!d3(r.series))?new TypeError(rn("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Zi(e,"limit")&&(r.limit=e.limit,!y3(r.limit))?new TypeError(rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uc.exports=q3});var lc=l(function(tpr,oc){"use strict";var w3=require("debug"),Ir=w3("reduce-right-async:limit");function b3(r,e,t,i,n){var a,u,s,o,v,f;if(o=r.length,Ir("Collection length: %d",o),o===0)return Ir("Finished processing a collection."),n(null,e);for(o0&&m();function m(){v-=1,Ir("Collection element %d: %s.",v,JSON.stringify(r[v])),i.length===3?i.call(t.thisArg,e,r[v],g):i.length===4?i.call(t.thisArg,e,r[v],v,g):i.call(t.thisArg,e,r[v],v,r,g);function g(h,y){if(!u){if(h)return u=!0,c(h);Ir("Accumulator: %s",JSON.stringify(y)),e=y,c()}}}function c(g){if(g)return Ir("Encountered an error: %s",g.message),n(g);if(a+=1,Ir("Processed %d of %d collection elements.",a,o),v>0)return m();if(a===o)return Ir("Finished processing a collection."),n(null,e)}}oc.exports=b3});var tn=l(function(ipr,fc){"use strict";var vc=require("@stdlib/assert/is-function"),_3=require("@stdlib/assert/is-collection"),en=require("@stdlib/string/format"),x3=require("@stdlib/constants/float64/pinf"),E3=sc(),T3=lc();function O3(r,e){var t,i,n;if(t={},arguments.length>1){if(i=E3(t,r),i)throw i;n=e}else n=r;if(!vc(n))throw new TypeError(en("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series===void 0&&t.limit===void 0&&(t.series=!0),t.series?t.limit=1:t.limit||(t.limit=x3),a;function a(u,s,o){if(!_3(u))throw new TypeError(en("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!vc(o))throw new TypeError(en("invalid argument. Last argument must be a function. Value: `%s`.",o));return T3(u,s,t,n,v);function v(f,m){if(f)return o(f);o(null,m)}}}fc.exports=O3});var gc=l(function(npr,cc){"use strict";var mc=tn();function P3(r,e,t,i,n){if(arguments.length<5)return mc(t)(r,e,i);mc(t,i)(r,e,n)}cc.exports=P3});var dc=l(function(apr,pc){"use strict";var A3=k(),hc=gc(),V3=tn();A3(hc,"factory",V3);pc.exports=hc});var nn=l(function(upr,qc){"use strict";var F3=require("@stdlib/assert/is-function-array"),k3=require("@stdlib/assert/is-function"),yc=require("@stdlib/string/format");function I3(r,e,t){if(!F3(r))throw new TypeError(yc("invalid argument. First argument must be an array of functions. Value: `%s`.",r));if(!k3(e))throw new TypeError(yc("invalid argument. Second argument must be a function. Value: `%s`.",e));return i;function i(){var n=-1;a();function a(){var u,s,o;if(arguments[0])return e(arguments[0]);if(n+=1,n>=r.length)return e();for(s=arguments.length,u=new Array(s),o=0;o1){if(i=z3(t,r),i)throw i;n=e}else n=r;if(!Vc(n))throw new TypeError(Qe("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=U3),a;function a(u,s,o){if(!W3(u))throw new TypeError(Qe("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!K3(s))throw new TypeError(Qe("invalid argument. Second argument must be a positive integer. Value: `%s`.",s));if(!Vc(o))throw new TypeError(Qe("invalid argument. Last argument must be a function. Value: `%s`.",o));return G3(u,s,t,n,v);function v(f,m){if(f)return o(f,!1);o(null,m)}}}Fc.exports=Q3});var Sc=l(function(mpr,Ic){"use strict";var kc=sn();function J3(r,e,t,i,n){if(arguments.length<5)return kc(t)(r,e,i);kc(t,i)(r,e,n)}Ic.exports=J3});var Rc=l(function(cpr,Nc){"use strict";var X3=k(),Lc=Sc(),Y3=sn();X3(Lc,"factory",Y3);Nc.exports=Lc});var Cc=l(function(gpr,jc){"use strict";var H3=require("@stdlib/assert/is-plain-object"),on=require("@stdlib/assert/has-own-property"),Z3=require("@stdlib/assert/is-boolean").isPrimitive,rK=require("@stdlib/assert/is-positive-integer").isPrimitive,ln=require("@stdlib/string/format");function eK(r,e){return H3(e)?(on(e,"thisArg")&&(r.thisArg=e.thisArg),on(e,"series")&&(r.series=e.series,!Z3(r.series))?new TypeError(ln("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):on(e,"limit")&&(r.limit=e.limit,!rK(r.limit))?new TypeError(ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}jc.exports=eK});var Dc=l(function(hpr,Bc){"use strict";var tK=require("debug"),Er=tK("some-by-right-async:limit");function iK(r,e,t,i,n){var a,u,s,o,v,f,m;if(o=r.length,Er("Collection length: %d",o),o===0)return Er("Finished processing a collection."),n(null,!1);for(o0&&c();function c(){v-=1,Er("Collection element %d: %s.",v,JSON.stringify(r[v])),i.length===2?i.call(t.thisArg,r[v],g):i.length===3?i.call(t.thisArg,r[v],v,g):i.call(t.thisArg,r[v],v,r,g)}function g(h,y){if(!u){if(h)return u=!0,Er("Encountered an error: %s",h.message),n(h);if(a+=1,Er("Processed %d of %d collection elements.",a,o),Er("Test result: %s",!!y),y&&!u&&(f+=1,f===e))return u=!0,Er("Finished processing a collection."),n(null,!0);if(v>0)return c();if(a===o)return Er("Finished processing a collection."),n(null,!1)}}}Bc.exports=iK});var vn=l(function(ppr,$c){"use strict";var Mc=require("@stdlib/assert/is-function"),nK=require("@stdlib/assert/is-positive-integer").isPrimitive,aK=require("@stdlib/assert/is-collection"),Je=require("@stdlib/string/format"),uK=require("@stdlib/constants/float64/pinf"),sK=Cc(),oK=Dc();function lK(r,e){var t,i,n;if(t={},arguments.length>1){if(i=sK(t,r),i)throw i;n=e}else n=r;if(!Mc(n))throw new TypeError(Je("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=uK),a;function a(u,s,o){if(!aK(u))throw new TypeError(Je("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!nK(s))throw new TypeError(Je("invalid argument. Second argument must be a positive integer. Value: `%s`.",s));if(!Mc(o))throw new TypeError(Je("invalid argument. Last argument must be a function. Value: `%s`.",o));return oK(u,s,t,n,v);function v(f,m){if(f)return o(f,!1);o(null,m)}}}$c.exports=lK});var Uc=l(function(dpr,Kc){"use strict";var Wc=vn();function vK(r,e,t,i,n){if(arguments.length<5)return Wc(t)(r,e,i);Wc(t,i)(r,e,n)}Kc.exports=vK});var Qc=l(function(ypr,Gc){"use strict";var fK=k(),zc=Uc(),mK=vn();fK(zc,"factory",mK);Gc.exports=zc});var Xc=l(function(qpr,Jc){"use strict";var cK=require("@stdlib/assert/is-plain-object"),fn=require("@stdlib/assert/has-own-property"),gK=require("@stdlib/assert/is-boolean").isPrimitive,hK=require("@stdlib/assert/is-positive-integer").isPrimitive,mn=require("@stdlib/string/format");function pK(r,e){return cK(e)?(fn(e,"thisArg")&&(r.thisArg=e.thisArg),fn(e,"series")&&(r.series=e.series,!gK(r.series))?new TypeError(mn("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):fn(e,"limit")&&(r.limit=e.limit,!hK(r.limit))?new TypeError(mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Jc.exports=pK});var Hc=l(function(wpr,Yc){"use strict";var dK=require("debug"),yK=H(),Sr=dK("tabulate-by-async:limit");function qK(r,e,t,i){var n,a,u,s,o,v,f,m,c;if(o=r.length,Sr("Collection length: %d",o),f=[],o===0)return Sr("Finished processing a collection."),i(null,f);for(m=[],o1){if(i=_K(t,r),i)throw i;n=e}else n=r;if(!Zc(n))throw new TypeError(cn("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bK),a;function a(u,s){if(!wK(u))throw new TypeError(cn("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Zc(s))throw new TypeError(cn("invalid argument. Last argument must be a function. Value: `%s`.",s));return xK(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}rg.exports=EK});var ig=l(function(_pr,tg){"use strict";var eg=gn();function TK(r,e,t,i){if(arguments.length<4)return eg(e)(r,t);eg(e,t)(r,i)}tg.exports=TK});var ug=l(function(xpr,ag){"use strict";var OK=k(),ng=ig(),PK=gn();OK(ng,"factory",PK);ag.exports=ng});var vg=l(function(Epr,lg){"use strict";var sg=require("@stdlib/assert/is-function"),og=require("@stdlib/string/format");function AK(r,e,t){if(!sg(r))throw new TypeError(og("invalid argument. First argument must be a function. Value: `%s`.",r));if(!sg(t))throw new TypeError(og("invalid argument. Last argument must be a function. Value: `%s`.",t));r(i);function i(n,a){if(n)return t(n,e);t(null,a)}}lg.exports=AK});var mg=l(function(Tpr,fg){"use strict";var VK=vg();fg.exports=VK});var gg=l(function(Opr,cg){"use strict";var hn=require("@stdlib/assert/is-function"),pn=require("@stdlib/string/format");function FK(r,e,t){if(!hn(r))throw new TypeError(pn("invalid argument. First argument must be a function. Value: `%s`.",r));if(!hn(e))throw new TypeError(pn("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!hn(t))throw new TypeError(pn("invalid argument. Last argument must be a function. Value: `%s`.",t));r(i);function i(a){var u,s,o;if(a)return e.length===1?e(n):e(a,n);for(u=arguments.length,s=new Array(u),s[0]=null,o=1;o1)for(n=new Array(arguments.length-1),v=1;v1)for(n=new Array(arguments.length-1),v=1;va?{done:!0}:i._count!==i._length?(n=!0,{done:!0}):(s=(s+1)%i._length,{value:i._buffer.accessors[0](i._buffer.data,s),done:!1})}function v(m){return n=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return i.iterator(a)}});bn(cr.prototype,"length",function(){return this._length});Br(cr.prototype,"push",function(e){var t,i,n,a;if(n=this._buffer.data,i=this._buffer.accessors[0],t=this._buffer.accessors[1],this._i=(this._i+1)%this._length,this._count>e&1)}cp.exports=bz});var pp=l(function(qdr,hp){"use strict";function _z(r,e){return r>>e&1}hp.exports=_z});var xp=l(function(wdr,_p){"use strict";var lr=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xe=require("@stdlib/assert/is-array-like-object"),dp=require("@stdlib/assert/is-collection"),Dr=require("@stdlib/assert/is-function"),yp=require("@stdlib/assert/is-object"),xz=require("@stdlib/assert/has-iterator-symbol-support"),Ye=require("@stdlib/symbol/iterator"),vr=k(),En=Tr(),qp=require("@stdlib/array/int32"),Ez=require("@stdlib/array/int8"),R=require("@stdlib/string/format"),Tz=require("@stdlib/math/base/special/ceil"),Oz=require("@stdlib/math/base/special/floor"),Pz=require("@stdlib/blas/ext/base/grev"),Az=tp(),Vz=np(),Fz=up(),kz=op(),Iz=vp(),Sz=mp(),Mr=gp(),wp=pp(),bp=xz(),xn=qp.BYTES_PER_ELEMENT*8;function X(r){if(!(this instanceof X))return new X(r);if(!lr(r))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));return this._N=r,this._M=0,this._buffer=new qp(Tz(r*r/xn)),this}vr(X,"fromAdjacencyList",function(e){var t,i,n,a,u,s,o,v,f,m;if(!Dr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(this!==X)throw new TypeError("invalid invocation. `this` is not a compact adjacency matrix.");if(i=arguments.length,i>1){if(a=arguments[1],!Dr(a))throw new TypeError(R("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(Xe(e)){if(v=e.length,u=new this(v),a){for(f=0;f2){if(a=arguments[2],!Dr(a))throw new TypeError(R("invalid argument. Third argument must be a function. Value: `%s`.",a));n>3&&(i=arguments[3])}if(!lr(e))throw new TypeError(R("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(Xe(t)){if(a){for(s=new this(e),f=0;f=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])===!1&&(this._buffer[i[0]]=Iz(this._buffer[i[0]],i[1]),this._M+=1),this});En(X.prototype,"edges",function(){var e,t,i,n;for(e=[],t=[0,0],i=0;i=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])});vr(X.prototype,"inDegree",function(e){var t,i,n;if(!lr(e))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(e>=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=0,i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=[],i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=0,i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=[],i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])&&(this._buffer[i[0]]=Sz(this._buffer[i[0]],i[1]),this._M-=1),this});vr(X.prototype,"toAdjacencyList",function(){var e,t,i,n,a;for(e=[],t=[0,0],n=0;n=0;a--)n=e[a](n);return n}}Op.exports=jz});var Vp=l(function(xdr,Ap){"use strict";var Cz=Pp();Ap.exports=Cz});var kp=l(function(Edr,Fp){"use strict";function Bz(r){return e;function e(){return r}}Fp.exports=Bz});var Sp=l(function(Tdr,Ip){"use strict";var Dz=kp();Ip.exports=Dz});var Rp=l(function(Odr,Np){"use strict";var Lp=require("@stdlib/assert/is-string").isPrimitive,Mz=require("@stdlib/regexp/extended-length-path"),$z=require("@stdlib/string/base/lowercase"),Qr=require("@stdlib/string/replace"),He=require("@stdlib/string/format"),Ze=/^([A-Za-z]):[\\\/]+/,rt=/^\/([A-Za-z])\//;function Wz(r,e){var t,i,n;if(!Lp(r))throw new TypeError(He("invalid argument. First argument must be a string. Value: `%s`.",r));if(!Lp(e))throw new TypeError(He("invalid argument. Second argument must be a string. Value: `%s`.",e));if(e!=="win32"&&e!=="mixed"&&e!=="posix")throw new Error(He("invalid argument. Second argument must be a recognized output path convention. Value: `%s`.",e));if(n=r,e==="win32")return i=rt.exec(n),i&&(t=i[1]+":\\",n=Qr(n,rt,t)),Qr(n,"/","\\");if(Mz.REGEXP.test(r))throw new Error(He("invalid argument. Cannot convert Windows extended-length paths to POSIX paths. Value: `%s`.",r));return e==="mixed"?(i=rt.exec(n),i?(t=i[1]+":/",n=Qr(n,rt,t)):(i=Ze.exec(n),i&&(t=i[1]+":/",n=Qr(n,Ze,t))),Qr(n,"\\","/")):(i=Ze.exec(n),i&&(t="/"+$z(i[1])+"/",n=Qr(n,Ze,t)),Qr(n,"\\","/"))}Np.exports=Wz});var Cp=l(function(Pdr,jp){"use strict";var Kz=Rp();jp.exports=Kz});var Dp=l(function(Adr,Bp){"use strict";var Uz=require("@stdlib/assert/is-string").isPrimitive,zz=require("@stdlib/regexp/regexp"),Gz=require("@stdlib/string/format");function Qz(r){if(!Uz(r))throw new TypeError(Gz("invalid argument. Must provide a regular expression string. Value: `%s`.",r));return r=zz().exec(r),r?new RegExp(r[1],r[2]):null}Bp.exports=Qz});var Tn=l(function(Vdr,Mp){"use strict";var Jz=Dp();Mp.exports=Jz});var Wp=l(function(Fdr,$p){"use strict";var Xz=typeof Object.getOwnPropertyNames!="undefined";$p.exports=Xz});var zp=l(function(kdr,Up){"use strict";var Kp=require("@stdlib/object/ctor"),Yz=Kp.getOwnPropertyNames;function Hz(r){return Yz(Kp(r))}Up.exports=Hz});var Qp=l(function(Idr,Gp){"use strict";var Zz=require("@stdlib/object/ctor"),rG=z();function eG(r){return rG(Zz(r))}Gp.exports=eG});var G=l(function(Sdr,Jp){"use strict";var tG=Wp(),iG=zp(),nG=Qp(),On;tG?On=iG:On=nG;Jp.exports=On});var Yp=l(function(Ldr,Xp){"use strict";var aG=typeof Object.getOwnPropertyDescriptor!="undefined";Xp.exports=aG});var Zp=l(function(Ndr,Hp){"use strict";var uG=Object.getOwnPropertyDescriptor;function sG(r,e){var t;return r==null?null:(t=uG(r,e),t===void 0?null:t)}Hp.exports=sG});var ed=l(function(Rdr,rd){"use strict";var oG=require("@stdlib/assert/has-own-property");function lG(r,e){return oG(r,e)?{configurable:!0,enumerable:!0,writable:!0,value:r[e]}:null}rd.exports=lG});var ae=l(function(jdr,td){"use strict";var vG=Yp(),fG=Zp(),mG=ed(),Pn;vG?Pn=fG:Pn=mG;td.exports=Pn});var nd=l(function(Cdr,id){"use strict";var cG=Object.getPrototypeOf;id.exports=cG});var ud=l(function(Bdr,ad){"use strict";function gG(r){return r.__proto__}ad.exports=gG});var od=l(function(Ddr,sd){"use strict";var hG=Ue(),pG=ud();function dG(r){var e=pG(r);return e||e===null?e:hG(r.constructor)==="[object Function]"?r.constructor.prototype:r instanceof Object?Object.prototype:null}sd.exports=dG});var vd=l(function(Mdr,ld){"use strict";var yG=require("@stdlib/assert/is-function"),qG=nd(),wG=od(),An;yG(Object.getPrototypeOf)?An=qG:An=wG;ld.exports=An});var md=l(function($dr,fd){"use strict";var bG=require("@stdlib/object/ctor"),_G=vd();function xG(r){return r==null?null:(r=bG(r),_G(r))}fd.exports=xG});var C=l(function(Wdr,cd){"use strict";var EG=md();cd.exports=EG});var pd=l(function(Kdr,hd){"use strict";var TG=require("@stdlib/array/int8"),OG=require("@stdlib/array/uint8"),PG=require("@stdlib/array/uint8c"),AG=require("@stdlib/array/int16"),VG=require("@stdlib/array/uint16"),FG=require("@stdlib/array/int32"),kG=require("@stdlib/array/uint32"),IG=require("@stdlib/array/float32"),SG=require("@stdlib/array/float64"),gd;function LG(r){return new TG(r)}function NG(r){return new OG(r)}function RG(r){return new PG(r)}function jG(r){return new AG(r)}function CG(r){return new VG(r)}function BG(r){return new FG(r)}function DG(r){return new kG(r)}function MG(r){return new IG(r)}function $G(r){return new SG(r)}function WG(){var r={int8array:LG,uint8array:NG,uint8clampedarray:RG,int16array:jG,uint16array:CG,int32array:BG,uint32array:DG,float32array:MG,float64array:$G};return r}gd=WG();hd.exports=gd});var bd=l(function(Udr,wd){"use strict";var et=require("@stdlib/assert/has-own-property"),Vn=require("@stdlib/assert/is-array"),dd=require("@stdlib/assert/is-buffer"),KG=require("@stdlib/assert/is-error"),yd=be(),UG=Tn(),zG=H(),qd=z(),GG=G(),_e=ae(),QG=C(),xe=W(),JG=require("@stdlib/buffer/from-buffer"),XG=pd();function YG(r){var e,t,i,n,a,u,s,o;for(e=[],n=[],s=Object.create(QG(r)),e.push(r),n.push(s),t=GG(r),o=0;o0)for(a=s,h=0;h1){if(!r6(e))throw new TypeError(e6("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(e===0)return r}else e=t6;return t=ZG(r)?new Array(r.length):{},i6(r,t,[r],[t],e)}_d.exports=n6});var Xr=l(function(Gdr,Ed){"use strict";var a6=xd();Ed.exports=a6});var Od=l(function(Qdr,Td){"use strict";var u6=require("@stdlib/assert/is-plain-object"),s6=require("@stdlib/assert/has-own-property"),o6=require("@stdlib/string/format");function l6(r,e){return u6(e)?(s6(e,"thisArg")&&(r.thisArg=e.thisArg),null):new TypeError(o6("invalid argument. Options argument must be an object. Value: `%s`.",e))}Td.exports=l6});var Vd=l(function(Jdr,Ad){"use strict";var v6=require("@stdlib/assert/is-collection"),f6=require("@stdlib/assert/is-function"),m6=require("@stdlib/assert/has-own-property"),Pd=require("@stdlib/string/format"),c6=Od();function g6(r,e,t){var i,n,a,u,s,o,v,f;if(!v6(r))throw new TypeError(Pd("invalid argument. First argument must be a collection. Value: `%s`.",r));if(n={},arguments.length===2)o=e;else{if(a=c6(n,e),a)throw a;o=t}if(!f6(o))throw new TypeError(Pd("invalid argument. Last argument must be a function. Value: `%s`.",o));for(i=n.thisArg,s=r.length,u={},f=0;f2){if(n=e,i=t,!tt(n))throw new TypeError(it("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else if(tt(e))n=e;else{if(n=r.length,!tt(n))throw new TypeError(it("invalid argument. First argument must be a function having at least one parameter. Value: `%s`.",n));i=e}return a([]);function a(u){return s;function s(o){var v=u.slice();return v.push(o),v.length2){if(n=e,i=t,!nt(n))throw new TypeError(at("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else if(nt(e))n=e;else{if(n=r.length,!nt(n))throw new TypeError(at("invalid argument. First argument must be a function having at least one parameter. Value: `%s`.",n));i=e}return a([]);function a(u){return s;function s(o){var v=u.slice();return v.unshift(o),v.lengthe&&(n.length=e);return n=n.join(","),s+="return function decorator("+n+"){",s+="var __$$args$$__=[];",s+="for (var __$$i$$__=0;__$$i$$__2&&(u=K6(a,t),u))throw u;return i?n=e.split(a.sep):n=e,z6(r,n)}}Zd.exports=G6});var ty=l(function(oyr,ey){"use strict";var Q6=require("@stdlib/assert/is-string").isPrimitive,J6=require("@stdlib/assert/is-array"),X6=require("@stdlib/assert/is-object-like"),Y6=require("@stdlib/string/format"),H6=In(),Z6=Sn(),r4=Ln();function e4(r,e){var t,i,n,a;if(t=Q6(r),!t&&!J6(r))throw new TypeError(Y6("invalid argument. Key path must be a string or a key array. Value: `%s`.",r));if(n=Z6(),arguments.length>1&&(a=H6(n,e),a))throw a;return t?i=r.split(n.sep):i=r,u;function u(s){if(X6(s))return r4(s,i)}}ey.exports=e4});var Nn=l(function(lyr,ny){"use strict";var t4=k(),iy=ry(),i4=ty();t4(iy,"factory",i4);ny.exports=iy});var uy=l(function(vyr,ay){"use strict";function n4(){return{copy:!0,sep:"."}}ay.exports=n4});var ly=l(function(fyr,oy){"use strict";var a4=require("@stdlib/assert/is-boolean").isPrimitive,u4=require("@stdlib/assert/is-string").isPrimitive,s4=require("@stdlib/assert/is-plain-object"),sy=require("@stdlib/assert/has-own-property"),Rn=require("@stdlib/string/format");function o4(r,e){return s4(e)?sy(e,"copy")&&(r.copy=e.copy,!a4(r.copy))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):sy(e,"sep")&&(r.sep=e.sep,!u4(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):null:new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}oy.exports=o4});var fy=l(function(myr,vy){"use strict";var l4=Nn().factory,v4=require("@stdlib/assert/is-array"),f4=require("@stdlib/string/format"),m4=uy(),c4=ly();function g4(r,e,t){var i,n,a,u,s;if(!v4(r))throw new TypeError(f4("invalid argument. First argument must be an array. Value: `%s`.",r));if(n=m4(),arguments.length>2&&(u=c4(n,t),u))throw u;for(n.copy?a=new Array(r.length):a=r,i=l4(e,{sep:n.sep}),s=0;s3&&(s=V4(u,i),s))throw s;return n?a=e.split(u.sep):a=e,k4(r,a,u.create,t)}yy.exports=I4});var by=l(function(yyr,wy){"use strict";var S4=require("@stdlib/assert/is-string").isPrimitive,L4=require("@stdlib/assert/is-array"),N4=require("@stdlib/assert/is-object-like"),R4=require("@stdlib/string/format"),j4=Cn(),C4=Bn(),B4=Dn();function D4(r,e){var t,i,n,a;if(t=S4(r),!t&&!L4(r))throw new TypeError(R4("invalid argument. Key path must be a string or a key array. Value: `%s`.",r));if(n=C4(),arguments.length>1&&(a=j4(n,e),a))throw a;return t?i=r.split(n.sep):i=r,u;function u(s,o){return N4(s)?B4(s,i,n.create,o):!1}}wy.exports=D4});var Ey=l(function(qyr,xy){"use strict";var M4=k(),_y=qy(),$4=by();M4(_y,"factory",$4);xy.exports=_y});var Oy=l(function(wyr,Ty){"use strict";var W4=W();function K4(r,e,t){W4(r,e,{configurable:!0,enumerable:!0,get:t})}Ty.exports=K4});var Ay=l(function(byr,Py){"use strict";var U4=Oy();Py.exports=U4});var Fy=l(function(_yr,Vy){"use strict";var z4=W();function G4(r,e,t){z4(r,e,{configurable:!0,enumerable:!0,writable:!1,value:t})}Vy.exports=G4});var Iy=l(function(xyr,ky){"use strict";var Q4=Fy();ky.exports=Q4});var Ly=l(function(Eyr,Sy){"use strict";var J4=W();function X4(r,e,t,i){J4(r,e,{configurable:!0,enumerable:!0,get:t,set:i})}Sy.exports=X4});var Ry=l(function(Tyr,Ny){"use strict";var Y4=Ly();Ny.exports=Y4});var Cy=l(function(Oyr,jy){"use strict";var H4=W();function Z4(r,e,t){H4(r,e,{configurable:!0,enumerable:!0,set:t})}jy.exports=Z4});var Dy=l(function(Pyr,By){"use strict";var rQ=Cy();By.exports=rQ});var Ky=l(function(Ayr,Wy){"use strict";var My=require("@stdlib/assert/is-object"),eQ=require("@stdlib/assert/is-function"),$y=W(),Mn=require("@stdlib/string/format");function tQ(r,e,t){if(!My(r))throw new TypeError(Mn("invalid argument. First argument must be an object. Value: `%s`.",r));if(!My(t))throw new TypeError(Mn("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(!eQ(t.value))throw new TypeError(Mn("invalid argument. The `value` property of the property descriptor must be a function. Value: `%s`.",t.value));t={configurable:t.configurable===void 0?!1:t.configurable,enumerable:t.enumerable===void 0?!1:t.enumerable,writable:t.writable===void 0?!1:t.writable,value:t.value},$y(r,e,{configurable:!0,enumerable:t.enumerable,get:i,set:t.writable?n:void 0});function i(){var a=t.value.call(r);return n(a),a}function n(a){t.value=a,$y(r,e,t)}}Wy.exports=tQ});var ut=l(function(Vyr,Uy){"use strict";var iQ=Ky();Uy.exports=iQ});var Qy=l(function(Fyr,Gy){"use strict";var nQ=require("@stdlib/assert/is-object"),aQ=require("@stdlib/assert/is-function"),uQ=ut(),zy=require("@stdlib/string/format");function sQ(r,e,t){if(!nQ(r))throw new TypeError(zy("invalid argument. First argument must be an object. Value: `%s`.",r));if(!aQ(t))throw new TypeError(zy("invalid argument. Third argument must be a function. Value: `%s`.",t));uQ(r,e,{configurable:!0,enumerable:!0,writable:!1,value:t})}Gy.exports=sQ});var Xy=l(function(kyr,Jy){"use strict";var oQ=Qy();Jy.exports=oQ});var Zy=l(function(Iyr,Hy){"use strict";var lQ=require("@stdlib/assert/is-object"),vQ=require("@stdlib/assert/is-function"),fQ=ut(),Yy=require("@stdlib/string/format");function mQ(r,e,t){if(!lQ(r))throw new TypeError(Yy("invalid argument. First argument must be an object. Value: `%s`.",r));if(!vQ(t))throw new TypeError(Yy("invalid argument. Third argument must be a function. Value: `%s`.",t));fQ(r,e,{configurable:!1,enumerable:!0,writable:!1,value:t})}Hy.exports=mQ});var eq=l(function(Syr,rq){"use strict";var cQ=Zy();rq.exports=cQ});var iq=l(function(Lyr,tq){"use strict";var gQ=W();function hQ(r,e,t){gQ(r,e,{configurable:!0,enumerable:!1,writable:!0,value:t})}tq.exports=hQ});var $n=l(function(Nyr,nq){"use strict";var pQ=iq();nq.exports=pQ});var uq=l(function(Ryr,aq){"use strict";var dQ=W();function yQ(r,e,t,i){dQ(r,e,{configurable:!1,enumerable:!1,get:t,set:i})}aq.exports=yQ});var Wn=l(function(jyr,sq){"use strict";var qQ=uq();sq.exports=qQ});var lq=l(function(Cyr,oq){"use strict";var wQ=W();function bQ(r,e,t){wQ(r,e,{configurable:!1,enumerable:!1,set:t})}oq.exports=bQ});var fq=l(function(Byr,vq){"use strict";var _Q=lq();vq.exports=_Q});var cq=l(function(Dyr,mq){"use strict";var xQ=Object.defineProperties;mq.exports=xQ});var dq=l(function(Myr,pq){"use strict";var gq=require("@stdlib/assert/is-object"),EQ=z(),TQ=W(),hq=require("@stdlib/string/format");function OQ(r,e){var t,i,n;if(!gq(r))throw new TypeError(hq("invalid argument. First argument must be an object. Value: `%s`.",r));if(!gq(e))throw new TypeError(hq("invalid argument. Second argument must be an object containing property descriptors. Value: `%s`.",e));for(t=EQ(e),n=0;n=0&&!t(r[a+1],a+1,r));return r}Qq.exports=XQ});var Yq=l(function(tqr,Xq){"use strict";var YQ=Jq();Xq.exports=YQ});var ew=l(function(iqr,rw){"use strict";var Hq=require("@stdlib/assert/is-function"),Zq=require("@stdlib/string/format");function HQ(r,e,t){var i;if(!Hq(r))throw new TypeError(Zq("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Hq(e))throw new TypeError(Zq("invalid argument. Second argument must be a function. Value: `%s`.",e));i=0;do r.call(t,i),i+=1;while(e(i))}rw.exports=HQ});var iw=l(function(nqr,tw){"use strict";var ZQ=ew();tw.exports=ZQ});var uw=l(function(aqr,aw){"use strict";var rJ=require("@stdlib/assert/is-collection"),nw=require("@stdlib/assert/is-function"),Gn=require("@stdlib/string/format");function eJ(r,e,t,i){var n,a;if(!rJ(r))throw new TypeError(Gn("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!nw(e))throw new TypeError(Gn("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!nw(t))throw new TypeError(Gn("invalid argument. Third argument must be a function. Value: `%s`.",t));if(n=r.length,n===0&&(e.call(i,void 0,void 0,r),n=r.length,n===0))return r;a=0;do e.call(i,r[a],a,r),a+=1,n=r.length;while(a=0&&t(r[a+1],a+1,r));return r}vw.exports=nJ});var cw=l(function(oqr,mw){"use strict";var aJ=fw();mw.exports=aJ});var hw=l(function(lqr,gw){"use strict";var st=W();function uJ(r){return st(this,"next",{configurable:!1,enumerable:!0,get:function(){return this._next}}),st(this,"prev",{configurable:!1,enumerable:!0,get:function(){return this._prev}}),this.value=r,st(this,"_next",{configurable:!1,enumerable:!1,writable:!0,value:null}),st(this,"_prev",{configurable:!1,enumerable:!1,writable:!0,value:null}),this}gw.exports=uJ});var qw=l(function(vqr,yw){"use strict";var ar=k(),sJ=Tr(),pw=require("@stdlib/symbol/iterator"),dw=require("@stdlib/string/format"),Jn=hw();function ir(){return this instanceof ir?(this._length=0,this._first=null,this._last=null,this):new ir}ar(ir.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});ar(ir.prototype,"first",function(){if(this._length)return this._first});ar(ir.prototype,"insert",function(e,t,i){var n,a;if(arguments.length>2){if(n=i,n!=="before"&&n!=="after")throw new Error(dw("invalid argument. Third argument must be a recognized location. Value: `%s`.",n))}else n="after";if(n==="after"&&e===this._last)return this.push(t);if(n==="before"&&e===this._first)return this.unshift(t);for(a=this._first;a!==this._last&&a!==e;)a=a._next;if(a===this._last&&a!==e)throw new Error("invalid argument. The list does not contain the provided list node.");return a=new Jn(t),n==="after"?(e._next._prev=a,a._next=e._next,e._next=a,a._prev=e):(e._prev._next=a,a._prev=e._prev,e._prev=a,a._next=e),this._length+=1,this});ar(ir.prototype,"iterator",function(e){var t,i,n,a,u,s,o;if(arguments.length){if(u=e,u!=="forward"&&u!=="reverse")throw new Error(dw("invalid argument. Must provide a recognized iteration direction. Value: `%s`.",u))}else u="forward";return n=this,u==="forward"?(o=-1,s=1):(o=this._length,s=-1),t=this.toArray(),i={},ar(i,"next",v),ar(i,"return",f),pw&&ar(i,pw,m),i;function v(){return o+=s,a||o<0||o>=t.length?{done:!0}:{value:t[o],done:!1}}function f(c){return a=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n.iterator()}});ar(ir.prototype,"last",function(){if(this._length)return this._last});sJ(ir.prototype,"length",function(){return this._length});ar(ir.prototype,"pop",function(){var e;return this._length&&(e=this._last.value,this._last._prev?(this._last=this._last._prev,this._last._next=null):(this._first=null,this._last=null),this._length-=1),e});ar(ir.prototype,"push",function(e){var t;return t=new Jn(e),this._length===0?(this._first=t,this._last=t):(t._prev=this._last,this._last._next=t,this._last=t),this._length+=1,this});ar(ir.prototype,"remove",function(e){var t,i;if(e===this._first)return this.shift();if(e===this._last)return this.pop();for(t=e.value,i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return e._prev._next=e._next,e._next._prev=e._prev,this._length-=1,t});ar(ir.prototype,"shift",function(){var e;return this._length&&(e=this._first.value,this._first._next?(this._first=this._first._next,this._first._prev=null):(this._first=null,this._last=null),this._length-=1),e});ar(ir.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i=0&&r[i]!=="/";i--);return i===void 0||i<=0?r.replace(_w,"\\$&"):(t=r.substring(1,i),t=t.replace(_w,"\\$&"),r=r[0]+t+r.substring(i),r)}xw.exports=fJ});var Xn=l(function(cqr,Tw){"use strict";var mJ=Ew();Tw.exports=mJ});var Pw=l(function(gqr,Ow){"use strict";var Yn=Ke();function cJ(r){throw r}function gJ(){return{comment:"",delimiter:",",doublequote:!0,escape:"",ltrim:!1,maxRows:1e308,newline:"\r\n",onClose:Yn,onColumn:Yn,onComment:null,onError:cJ,onRow:Yn,onSkip:null,onWarn:null,quote:'"',quoting:!0,rowBuffer:[],rtrim:!1,skip:"",skipBlankRows:!1,skipRow:null,strict:!0,trimComment:!0,whitespace:[" "]}}Ow.exports=gJ});var ot=l(function(hqr,hJ){hJ.exports=["closed","comment","escape","error","field","init","invalid_quote_end","quote_end","quoted_escape","quoted_field","skip","skipped_comment","skipped_escape","skipped_field","skipped_invalid_quote_end","skipped_quote_end","skipped_quoted_escape","skipped_quoted_field"]});var Y=l(function(pqr,Vw){"use strict";var Aw=ot();function pJ(){var r,e;for(r={},e=0;e=g){if(m){$r("Error."),r._setErrorState("INVALID_ESCAPE")._changeState(FJ);return}$r("Escape sequence is not followed by a special character sequence."),r._raiseWarning("INVALID_ESCAPE")._push(y)._changeState(ue);return}r._push(y)}}Dw.exports=kJ});var Kw=l(function(_qr,Ww){"use strict";var IJ=require("debug"),lt=Y(),se=IJ("state:field"),SJ=lt.escape,LJ=lt.field,NJ=lt.init,$w=lt.quoted_field;function RJ(r){var e,t,i,n,a,u,s,o,v,f;return i=r._escapeLastIndex,o=r._escape,n=r._quoteLastIndex,f=r._quote,e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,s=r._quoting,v=r._strict,m;function m(c){var g=r._cursor-r._cidx+1;if(se("Char: %s",c),c===o[i]&&r._scan(o,i)){se("Escape."),r._push(c)._changeState(SJ);return}if(g-n===0&&c===f[n]&&r._scan(f,n)){if(s){se("Quote."),r._rewind(n)._changeState($w);return}r._push(c);return}if(v===!1&&c===f[n]&&r._scan(f,n)){if(s&&r._isWhitespace(r._cidx,r._cursor-n)){se("Quote."),r._raiseWarning("INVALID_OPENING_QUOTE")._rewind(g)._changeState($w);return}r._push(c);return}if(c===a[e]&&r._scan(a,e)){se("Delimiter."),r._rewind(e)._changeState(LJ);return}if(c===u[t]&&r._scan(u,t)){se("Newline."),r._rewind(t)._changeState(NJ);return}r._push(c)}}Ww.exports=RJ});var Gw=l(function(xqr,zw){"use strict";var jJ=require("debug"),oe=Y(),Wr=jJ("state:init"),CJ=oe.comment,BJ=oe.field,DJ=oe.escape,MJ=oe.init,Uw=oe.quoted_field,$J=oe.skip;function WJ(r){var e,t,i,n,a,u,s,o,v,f,m,c,g,h;return i=r._commentLastIndex,v=r._comment,u=r._skipLastIndex,h=r._skip,n=r._escapeLastIndex,m=r._escape,a=r._quoteLastIndex,g=r._quote,e=r._delimiterLastIndex,s=r._delimiter,t=r._newlineLastIndex,o=r._newline,f=r._quoting,c=r._strict,y;function y(q){var _=r._cursor+1;if(Wr("Char: %s",q),v&&_-i===0&&q===v[i]&&r._scan(v,i)){Wr("Comment."),r._rewind(i)._changeState(CJ);return}if(h&&_-u===0&&q===h[u]&&r._scan(h,u)){Wr("Skip."),r._rewind(u)._changeState($J);return}if(q===m[n]&&r._scan(m,n)){Wr("Escape."),r._push(q)._changeState(DJ);return}if(_-a===0&&q===g[a]&&r._scan(g,a)){if(f){Wr("Quote."),r._rewind(a)._changeState(Uw);return}r._push(q);return}if(c===!1&&q===g[a]&&r._scan(g,a)){if(f&&r._isWhitespace(0,r._cursor-a)){Wr("Quote."),r._raiseWarning("INVALID_OPENING_QUOTE")._rewind(_)._changeState(Uw);return}r._push(q);return}if(q===s[e]&&r._scan(s,e)){Wr("Delimiter."),r._rewind(e)._changeState(BJ);return}if(q===o[t]&&r._scan(o,t)){Wr("Newline."),r._rewind(t)._changeState(MJ);return}r._push(q)}}zw.exports=WJ});var Xw=l(function(Eqr,Jw){"use strict";var KJ=require("debug"),Hn=Y(),vt=KJ("state:invalid_quote_end"),UJ=Hn.error,zJ=Hn.field,GJ=Hn.init;function Qw(r,e){if(r._isWhitespace(r._qidx+1,r._cursor)){r._raiseWarning("INVALID_CLOSING_QUOTE")._rewind(r._cursor-r._qidx)._changeState(e);return}vt("Error."),r._setErrorState("INVALID_CLOSING_QUOTE")._changeState(UJ)}function QJ(r){var e,t,i,n;return e=r._delimiterLastIndex,i=r._delimiter,t=r._newlineLastIndex,n=r._newline,a;function a(u){if(vt("Char: %s",u),u===i[e]&&r._scan(i,e)){vt("Delimiter."),r._rewind(e),Qw(r,zJ);return}if(u===n[t]&&r._scan(n,t)){vt("Newline."),r._rewind(t),Qw(r,GJ);return}r._push(u)}}Jw.exports=QJ});var Zw=l(function(Tqr,Hw){"use strict";var JJ=require("debug"),Yw=Ee(),Te=Y(),le=JJ("state:quote_end"),XJ=Te.error,YJ=Te.field,HJ=Te.init,ZJ=Te.invalid_quote_end,rX=Te.quoted_field;function eX(r){var e,t,i,n,a,u,s,o,v;return e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,i=r._quoteLastIndex,o=r._quote,n=r._doublequote,s=r._strict,v=Yw(Yw(e,t),i),f;function f(m){if(le("Char: %s",m),n&&m===o[i]&&r._scan(o,i)){le("Double quote."),r._push(m)._changeState(rX);return}if(m===a[e]&&r._scan(a,e)){le("Delimiter."),r._rewind(e)._changeState(YJ);return}if(m===u[t]&&r._scan(u,t)){le("Newline."),r._rewind(t)._changeState(HJ);return}if(r._cursor-r._qidx>=v){if(s){le("Error."),r._setErrorState("INVALID_CLOSING_QUOTE")._changeState(XJ);return}le("Invalid closing quote."),r._push(m)._changeState(ZJ);return}r._push(m)}}Hw.exports=eX});var ib=l(function(Oqr,tb){"use strict";var tX=require("debug"),eb=Y(),ft=tX("state:quoted_escape"),iX=eb.error,rb=eb.quoted_field;function nX(r){var e,t,i,n,a;return t=r._quoteLastIndex,a=r._quote,e=r._escapeLastIndex,i=r._escapeLength,n=r._strict,u;function u(s){var o=r._cursor,v=r._eidx,f=o-v;if(ft("Char: %s",s),f===t&&s===a[t]&&r._scan(a,t)){ft("Quote."),r._copyWithin(v-e,v+1,t)._rewind(i)._push(s)._changeState(rb);return}if(f>=t){if(n){ft("Error."),r._setErrorState("INVALID_QUOTED_ESCAPE")._changeState(iX);return}ft("Escape sequence is not followed by a quote sequence."),r._raiseWarning("INVALID_QUOTED_ESCAPE")._push(s)._changeState(rb);return}r._push(s)}}tb.exports=nX});var ub=l(function(Pqr,ab){"use strict";var aX=require("debug"),nb=Y(),Zn=aX("state:quoted_field"),uX=nb.quote_end,sX=nb.quoted_escape;function oX(r){var e,t,i,n,a;return e=r._escapeLastIndex,n=r._escape,t=r._quoteLastIndex,a=r._quote,i=r._doublequote,u;function u(s){if(Zn("Char: %s",s),i===!1&&s===n[e]&&r._scan(n,e)){Zn("Escape."),r._push(s)._changeState(sX);return}if(s===a[t]&&r._scan(a,t)){Zn("Quote."),r._rewind(t)._changeState(uX);return}r._push(s)}}ab.exports=oX});var lb=l(function(Aqr,ob){"use strict";var lX=require("debug"),ve=Y(),Kr=lX("state:skip"),vX=ve.init,fX=ve.skip,mX=ve.skipped_comment,cX=ve.skipped_field,gX=ve.skipped_escape,sb=ve.skipped_quoted_field;function hX(r){var e,t,i,n,a,u,s,o,v,f,m,c,g,h;return i=r._commentLastIndex,v=r._comment,u=r._skipLastIndex,h=r._skip,n=r._escapeLastIndex,m=r._escape,a=r._quoteLastIndex,g=r._quote,e=r._delimiterLastIndex,s=r._delimiter,t=r._newlineLastIndex,o=r._newline,f=r._quoting,c=r._strict,y;function y(q){var _=r._cursor+1;if(Kr("Char: %s",q),v&&_-i===0&&q===v[i]&&r._scan(v,i)){Kr("Comment."),r._push(q)._changeState(mX);return}if(h&&_-u===0&&q===h[u]&&r._scan(h,u)){Kr("Skip."),r._push(q)._changeState(fX);return}if(q===m[n]&&r._scan(m,n)){Kr("Escape."),r._push(q)._changeState(gX);return}if(_-a===0&&q===g[a]&&r._scan(g,a)){if(f){Kr("Quote."),r._push(q)._changeState(sb);return}r._push(q);return}if(c===!1&&q===g[a]&&r._scan(g,a)){if(f&&r._isWhitespace(0,r._cursor-a)){Kr("Quote."),r._push(q)._changeState(sb);return}r._push(q);return}if(q===s[e]&&r._scan(s,e)){Kr("Delimiter."),r._push(q)._changeState(cX);return}if(q===o[t]&&r._scan(o,t)){Kr("Newline."),r._rewind(t)._changeState(vX);return}r._push(q)}}ob.exports=hX});var mb=l(function(Vqr,fb){"use strict";var pX=require("debug"),dX=Y(),vb=pX("state:skipped_comment"),yX=dX.init;function qX(r){var e,t;return e=r._newlineLastIndex,t=r._newline,i;function i(n){if(vb("Char: %s",n),n===t[e]&&r._scan(t,e)){vb("Newline."),r._rewind(e)._changeState(yX);return}r._push(n)}}fb.exports=qX});var hb=l(function(Fqr,gb){"use strict";var wX=require("debug"),cb=Ee(),bX=Y(),Yr=wX("state:skipped_escape"),fe=bX.skipped_field;function _X(r){var e,t,i,n,a,u,s,o,v,f,m;return e=r._delimiterLastIndex,u=r._delimiter,t=r._newlineLastIndex,s=r._newline,i=r._commentLastIndex,o=r._comment,a=r._skipLastIndex,f=r._skip,n=r._escapeLastIndex,v=r._escape,m=cb(cb(e,t),n),c;function c(g){var h=r._cursor,y=r._eidx,q=h-y;if(Yr("Char: %s",g),q===e&&g===u[e]&&r._scan(u,e)){Yr("Delimiter."),r._push(g)._changeState(fe);return}if(q===t&&g===s[t]&&r._scan(s,t)){Yr("Newline."),r._push(g)._changeState(fe);return}if(q===n&&g===v[n]&&r._scan(v,n)){Yr("Escape."),r._push(g)._changeState(fe);return}if(o&&h-i===0&&g===o[i]&&r._scan(o,i)){Yr("Comment."),r._push(g)._changeState(fe);return}if(f&&h-a===0&&g===f[a]&&r._scan(f,a)){Yr("Skip."),r._push(g)._changeState(fe);return}if(q>=m){Yr("Normal character sequence."),r._push(g)._changeState(fe);return}r._push(g)}}gb.exports=_X});var yb=l(function(kqr,db){"use strict";var xX=require("debug"),mt=Y(),me=xX("state:skipped_field"),EX=mt.init,TX=mt.skipped_escape,OX=mt.skipped_field,pb=mt.skipped_quoted_field;function PX(r){var e,t,i,n,a,u,s,o,v,f;return i=r._escapeLastIndex,o=r._escape,n=r._quoteLastIndex,f=r._quote,e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,s=r._quoting,v=r._strict,m;function m(c){var g=r._cursor-r._cidx+1;if(me("Char: %s",c),c===o[i]&&r._scan(o,i)){me("Escape."),r._push(c)._changeState(TX);return}if(g-n===0&&c===f[n]&&r._scan(f,n)){if(r._push(c),s){me("Quote."),r._changeState(pb);return}return}if(v===!1&&c===f[n]&&r._scan(f,n)){if(r._push(c),s&&r._isWhitespace(r._cidx,r._cursor-n)){me("Quote."),r._changeState(pb);return}return}if(c===a[e]&&r._scan(a,e)){me("Delimiter."),r._push(c)._changeState(OX);return}if(c===u[t]&&r._scan(u,t)){me("Newline."),r._rewind(t)._changeState(EX);return}r._push(c)}}db.exports=PX});var bb=l(function(Iqr,wb){"use strict";var AX=require("debug"),qb=Y(),ra=AX("state:skipped_invalid_quote_end"),VX=qb.skipped_field,FX=qb.init;function kX(r){var e,t,i,n;return e=r._delimiterLastIndex,i=r._delimiter,t=r._newlineLastIndex,n=r._newline,a;function a(u){if(ra("Char: %s",u),u===i[e]&&r._scan(i,e)){ra("Delimiter."),r._push(u)._changeState(VX);return}if(u===n[t]&&r._scan(n,t)){ra("Newline."),r._rewind(t)._changeState(FX);return}r._push(u)}}wb.exports=kX});var Eb=l(function(Sqr,xb){"use strict";var IX=require("debug"),_b=Ee(),ct=Y(),Oe=IX("state:skipped_quote_end"),SX=ct.init,LX=ct.skipped_field,NX=ct.skipped_invalid_quote_end,RX=ct.skipped_quoted_field;function jX(r){var e,t,i,n,a,u,s,o;return e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,i=r._quoteLastIndex,s=r._quote,n=r._doublequote,o=_b(_b(e,t),i),v;function v(f){if(Oe("Char: %s",f),n&&f===s[i]&&r._scan(s,i)){Oe("Double quote."),r._push(f)._changeState(RX);return}if(f===a[e]&&r._scan(a,e)){Oe("Delimiter."),r._push(f)._changeState(LX);return}if(f===u[t]&&r._scan(u,t)){Oe("Newline."),r._rewind(t)._changeState(SX);return}if(r._cursor-r._qidx>=o){Oe("Invalid closing quote."),r._push(f)._changeState(NX);return}r._push(f)}}xb.exports=jX});var Pb=l(function(Lqr,Ob){"use strict";var CX=require("debug"),BX=Y(),ea=CX("state:skipped_quoted_escape"),Tb=BX.skipped_quoted_field;function DX(r){var e,t;return e=r._quoteLastIndex,t=r._quote,i;function i(n){var a=r._cursor,u=r._eidx,s=a-u;if(ea("Char: %s",n),s===e&&n===t[e]&&r._scan(t,e)){ea("Quote."),r._push(n)._changeState(Tb);return}if(s>=e){ea("Escape sequence is not followed by a quote sequence."),r._push(n)._changeState(Tb);return}r._push(n)}}Ob.exports=DX});var Fb=l(function(Nqr,Vb){"use strict";var MX=require("debug"),Ab=Y(),ta=MX("state:skipped_quoted_field"),$X=Ab.skipped_quote_end,WX=Ab.skipped_quoted_escape;function KX(r){var e,t,i,n,a;return e=r._escapeLastIndex,n=r._escape,t=r._quoteLastIndex,a=r._quote,i=r._doublequote,u;function u(s){if(ta("Char: %s",s),i===!1&&s===n[e]&&r._scan(n,e)){ta("Escape."),r._push(s)._changeState(WX);return}if(s===a[t]&&r._scan(a,t)){ta("Quote."),r._push(s)._changeState($X);return}r._push(s)}}Vb.exports=KX});var Sb=l(function(Rqr,Ib){"use strict";var kb=ot(),UX=kw(),zX=Lw(),GX=Rw(),QX=Mw(),JX=Kw(),XX=Gw(),YX=Xw(),HX=Zw(),ZX=ib(),r8=ub(),e8=lb(),t8=mb(),i8=hb(),n8=yb(),a8=bb(),u8=Eb(),s8=Pb(),o8=Fb(),l8={closed:UX,comment:zX,escape:QX,error:GX,field:JX,init:XX,invalid_quote_end:YX,quote_end:HX,quoted_escape:ZX,quoted_field:r8,skip:e8,skipped_comment:t8,skipped_escape:i8,skipped_field:n8,skipped_invalid_quote_end:a8,skipped_quote_end:u8,skipped_quoted_escape:s8,skipped_quoted_field:o8};function v8(r){var e,t;for(e=[],t=0;t=t.length?(t.push(e),Z("Internal buffer size increased. Length: %d.",t.length)):t[this._cursor]=e,Z("Cursor: %d. Push: %s",this._cursor,e),this});Q(D.prototype,"_rewind",function(e){return this._cursor-=e,Z("Rewind: %d. Cursor: %d.",e,this._cursor),this});Q(D.prototype,"_copyWithin",function(e,t,i){var n,a;for(n=this._buffer,a=0;a=i.length?(i.push(e),Z("Row buffer size increased. Length: %d.",i.length)):i[t]=e,this});Q(D.prototype,"_getField",function(e,t){var i=this._slice(e,t);return this._ltrim?this._rtrim?ce(i,this._reWhitespace,"$1"):ce(i,this._reWhitespaceLeft,""):this._rtrim?ce(i,this._reWhitespaceRight,""):i});Q(D.prototype,"_getRow",function(){return this._rowBufferFLG?this._rowBuffer:this._rowBuffer.slice(0,this._col)});Q(D.prototype,"_scan",function(e,t){var i,n,a;for(i=this._buffer,n=this._cursor-t+1,a=0;a=this._maxRows&&this._changeState(Hr),this)});Q(D.prototype,"_onCommentedRow",function(){var e;return this._onComment?(e=this._slice(0,this._cursor),this._trimComment&&(e=ce(e,this._reWhitespaceLeft,"")),this._onComment(e,this._line),Z("Comment. Line: %d. Value: %s",this._line,e)):Z("Comment. Line: %d.",this._line),this._line+=1,this._reset(),this});Q(D.prototype,"_onSkippedRow",function(){var e;return this._onSkip?(e=this._slice(0,this._cursor),this._onSkip(e,this._line),Z("Skipped row. Line: %d. Value: %s",this._line,e)):Z("Skipped row. Line: %d.",this._line),this._line+=1,this._reset(),this});Q(D.prototype,"_onClosingQuote",function(){return this._qidx=this._cursor,this});Q(D.prototype,"_onEscape",function(){return this._eidx=this._cursor,this});Q(D.prototype,"_createException",function(e){var t;switch(e){case"INVALID_CLOSING_QUOTE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains a closing quote which is not immediately followed by a delimiter or newline.",this._col,this._line));break;case"INVALID_OPENING_QUOTE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an opening quote which does not immediately follow a delimiter or newline.",this._col,this._line));break;case"INVALID_ESCAPE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence which is not immediately followed by a special character sequence.",this._col,this._line));break;case"INVALID_QUOTED_ESCAPE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence within a quoted field which is not immediately followed by a quote sequence.",this._col,this._line));break;case"CLOSED":t=new Error("invalid operation. Parser is unable to parse new chunks, as the parser has been closed. To parse new chunks, create a new parser instance.");break;default:t=new Error("invalid operation. Parser is in an unrecoverable error state. To parse new chunks, create a new parser instance.");break}return t});Q(D.prototype,"_raiseWarning",function(e){var t;return this._onWarn&&(t=this._createException(e),Z("Warning: %s",t.message),this._onWarn(t)),this});Q(D.prototype,"_raiseException",function(){var e=this._createException(this._errname);return Z("Error: %s",e.message),this._onError(e),this});Q(D.prototype,"_changeState",function(e){switch(Z("State transition: %s -> %s.",Nb[this._state],Nb[e]),e){case Hr:this._close();break;case p8:this._commented=!0;break;case Pe:this._raiseException();break;case Rb:this._onEscape();break;case jb:this._state!==Rb&&this._onField();break;case Ae:this._commented?this._onCommentedRow():this._skipped?this._onSkippedRow():this._onRecord();break;case d8:break;case Cb:this._onClosingQuote();break;case y8:this._onEscape();break;case q8:break;case ia:this._skipped=!0;break;case w8:case b8:case _8:case x8:case E8:case T8:case O8:break}return this._state=e,this});Q(D.prototype,"_setErrorState",function(e){return e?Z("Error: %s.",e):Z("Reset error state."),this._errname=e,this});Q(D.prototype,"_close",function(){var e,t;return this.done?(this._setErrorState(Hr)._changeState(Pe),this):(this._cursor>=0?(e=this._state,e===Ae||e===jb||e===Cb?this._changeState(Ae)._onClose():(this._col&&this._onRow(this._getRow(),this._row,this._col),t=this._slice(this._cidx,this._cursor),Z("Flush: %s",t),this._onClose(t))):this._onClose(),Z("Closed."),this)});Q(D.prototype,"next",function(e){var t,i;if(Z("Chunk: %s",e),this.done)return this._setErrorState(Hr)._changeState(Pe),this;for(t=this._states,i=0;i=0;a--){if(i=e.call(t,r[a],a,r),!i)return!1;n!==r.length&&(a+=r.length-n,n=r.length)}return!0}M_.exports=PY});var K_=l(function(lwr,W_){"use strict";var AY=$_();W_.exports=AY});var z_=l(function(vwr,U_){"use strict";var VY=require("@stdlib/assert/is-string").isPrimitive,FY=require("@stdlib/regexp/extname").REGEXP,kY=require("@stdlib/string/format");function IY(r){if(!VY(r))throw new TypeError(kY("invalid argument. Filename must be a string. Value: `%s`.",r));return FY.exec(r)[1]}U_.exports=IY});var Q_=l(function(fwr,G_){"use strict";var SY=z_();G_.exports=SY});var X_=l(function(mwr,J_){"use strict";function LY(r){return this.next=null,this.prev=null,this.value=r,this}J_.exports=LY});var Z_=l(function(cwr,H_){"use strict";var hr=k(),NY=Tr(),Y_=require("@stdlib/symbol/iterator"),RY=X_();function fr(){return this instanceof fr?(this._length=0,this._first=null,this._last=null,this):new fr}hr(fr.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});hr(fr.prototype,"first",function(){if(this._length)return this._first.value});hr(fr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=-1,e=this.toArray(),t={},hr(t,"next",u),hr(t,"return",s),Y_&&hr(t,Y_,o),t;function u(){return a+=1,n||a>=e.length?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});hr(fr.prototype,"last",function(){if(this._length)return this._last.value});NY(fr.prototype,"length",function(){return this._length});hr(fr.prototype,"pop",function(){var e;return this._length&&(e=this._first.value,this._first.next?(this._first=this._first.next,this._first.prev=null):(this._first=null,this._last=null),this._length-=1),e});hr(fr.prototype,"push",function(e){var t;return t=new RY(e),this._length===0?(this._first=t,this._last=t):(t.prev=this._last,this._last.next=t,this._last=t),this._length+=1,this});hr(fr.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i0){for(f=0;f=0&&(c=r[f],!(v(c,f,r)&&(n===2?s.push([f,c]):n===1?s.push(c):s.push(f),i+=1,i===m)));f--);return s}fx.exports=UY});var gx=l(function(ywr,cx){"use strict";var zY=mx();cx.exports=zY});var aa=l(function(qwr,hx){"use strict";var GY=require("@stdlib/constants/float64/max"),QY={copy:!1,depth:GY};hx.exports=QY});var yx=l(function(wwr,dx){"use strict";var JY=require("@stdlib/assert/is-plain-object"),px=require("@stdlib/assert/has-own-property"),XY=require("@stdlib/assert/is-boolean").isPrimitive,YY=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ua=require("@stdlib/string/format");function HY(r,e){return JY(e)?px(e,"depth")&&(r.depth=e.depth,!YY(r.depth))?new TypeError(ua("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","depth",r.depth)):px(e,"copy")&&(r.copy=e.copy,!XY(r.copy))?new TypeError(ua("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):null:new TypeError(ua("invalid argument. Options argument must be an object. Value: `%s`.",e))}dx.exports=HY});var bx=l(function(bwr,wx){"use strict";var ZY=require("@stdlib/assert/is-array-like-object");function qx(r,e,t){var i,n;for(n=0;n1&&(i=iH(t,e),i))throw i;return t.depth===0?n=r:n=nH([],r,t.depth),t.copy?rH(n):n}xx.exports=aH});var Ox=l(function(xwr,Tx){"use strict";var uH=require("@stdlib/function/ctor");function sH(r){var e,t,i,n;for(i="return function flattenArray(x){",e=r.length,t=e-1,i+="var o=[];var ",n=0;n1){if(!pH(e))throw new TypeError(sa("invalid argument. Options argument must be an object. Value: `%s`.",e));if(dH(e,"copy")&&(t=e.copy,!yH(t)))throw new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t))}return i=wH(r),t?_H(i):bH(i)}kx.exports=xH});var Nx=l(function(Pwr,Lx){"use strict";var EH=k(),Sx=Ex(),TH=Ix();EH(Sx,"factory",TH);Lx.exports=Sx});var oa=l(function(Awr,Rx){"use strict";var OH=require("@stdlib/constants/float64/max");function PH(){return{delimiter:".",depth:OH,copy:!1}}Rx.exports=PH});var la=l(function(Vwr,Cx){"use strict";var AH=require("@stdlib/assert/is-plain-object"),ht=require("@stdlib/assert/has-own-property"),VH=require("@stdlib/assert/is-string").isPrimitive,jx=require("@stdlib/assert/is-boolean").isPrimitive,FH=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fe=require("@stdlib/string/format");function kH(r,e){return AH(e)?ht(e,"depth")&&(r.depth=e.depth,!FH(r.depth))?new TypeError(Fe("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","depth",r.depth)):ht(e,"copy")&&(r.copy=e.copy,!jx(r.copy))?new TypeError(Fe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):ht(e,"flattenArrays")&&(r.flattenArrays=e.flattenArrays,!jx(r.flattenArrays))?new TypeError(Fe("invalid option. `%s` option must be a boolean. Option: `%s`.","flattenArrays",r.flattenArrays)):ht(e,"delimiter")&&(r.delimiter=e.delimiter,!VH(r.delimiter))?new TypeError(Fe("invalid option. `%s` option must be a string. Option: `%s`.","delimiter",r.delimiter)):null:new TypeError(Fe("invalid argument. Options argument must be an object. Value: `%s`.",e))}Cx.exports=kH});var $x=l(function(Fwr,Mx){"use strict";var Bx=z(),IH=require("@stdlib/assert/is-plain-object"),SH=require("@stdlib/assert/is-array");function Dx(r,e,t,i,n){var a,u,s,o;for(t&&(t+=n.delimiter),a=Bx(e),o=0;o1&&(i=DH(t,e),i))throw i;return MH(r,t)}Kx.exports=$H});var Gx=l(function(Swr,zx){"use strict";var WH=require("@stdlib/assert/is-object-like"),KH=require("@stdlib/string/format"),UH=oa(),zH=la(),GH=va();function QH(r){var e,t;if(e=UH(),t=zH(e,r),t)throw t;return i;function i(n){if(!WH(n))throw new TypeError(KH("invalid argument. Must provide an object (except null). Value: `%s`.",n));return GH(n,e)}}zx.exports=QH});var Xx=l(function(Lwr,Jx){"use strict";var JH=k(),Qx=Ux(),XH=Gx();JH(Qx,"factory",XH);Jx.exports=Qx});var Zx=l(function(Nwr,Hx){"use strict";var YH=require("@stdlib/assert/is-collection"),HH=require("@stdlib/assert/is-function"),Yx=require("@stdlib/string/format");function ZH(r,e,t){var i,n;if(!YH(r))throw new TypeError(Yx("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!HH(e))throw new TypeError(Yx("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=r.length,n=0;n=0;n--)e.call(t,r[n],n,r),i!==r.length&&(n+=r.length-i,i=r.length);return r}iE.exports=i5});var uE=l(function(Cwr,aE){"use strict";var n5=nE();aE.exports=n5});var lE=l(function(Bwr,oE){"use strict";var a5=require("@stdlib/assert/is-function"),sE=require("@stdlib/string/format");function u5(r,e,t){var i,n;if(typeof r!="object"||r===null)throw new TypeError(sE("invalid argument. First argument must be an object. Value: `%s`.",r));if(!a5(e))throw new TypeError(sE("invalid argument. Second argument must be a function. Value: `%s`.",e));for(n in r)if(i=e.call(t,r[n],n,r),i===!1)return r;return r}oE.exports=u5});var fE=l(function(Dwr,vE){"use strict";var s5=lE();vE.exports=s5});var gE=l(function(Mwr,cE){"use strict";var o5=z(),l5=require("@stdlib/assert/is-function"),mE=require("@stdlib/string/format");function v5(r,e,t){var i,n,a,u,s;if(typeof r!="object"||r===null)throw new TypeError(mE("invalid argument. First argument must be an object. Value: `%s`.",r));if(!l5(e))throw new TypeError(mE("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=o5(r),a=i.length,s=0;s1){if(!G9(e))throw new TypeError(X9("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=z9;if(r==null)return[];for(n=f0(r),t=[],i={},s=1;n&&s<=u;){for(a=Q9(n),v=0;v1){if(!r7(e))throw new TypeError(n7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=Z9;if(r==null)return[];for(n=d0(r),t={},i=[],s=1;n&&s<=u;){for(a=t7(n),v=0;v1){if(!o7(e))throw new TypeError(m7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=s7;if(r==null)return[];for(n=_0(r),t=[],i={},s=1;n&&s<=u;){for(a=l7(n),v=0;v1){if(!p7(e))throw new TypeError(q7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=h7;if(r==null)return[];for(n=A0(r),t=[],i={},s=1;n&&s<=u;){for(a=d7(n),v=0;v1){if(!x7(e))throw new TypeError(P7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=_7;if(r==null)return[];for(n=L0(r),t=[],i={},s=1;n&&s<=u;){for(a=T7(n),v=0;v1){if(!k7(e))throw new TypeError(N7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=F7;if(r==null)return[];for(n=B0(r),t={},i=[],s=1;n&&s<=u;){for(a=S7(n),v=0;v1){if(!B7(e))throw new TypeError($7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=C7;if(r==null)return[];for(i=K0(r),t=[],u=1;i&&u<=a;){for(n=M7(i),s=0;s2){if(!z7(t))throw new TypeError(Q7("invalid argument. Third argument must be a positive integer. Value: `%s`.",t));a=t}else a=U7;if(r==null)return null;for(n=X0(r),u=1;n&&u<=a;){if(i=G7(n,e),i)return i;n=X0(n),u+=1}return null}Y0.exports=J7});var rO=l(function(Wbr,Z0){"use strict";var X7=H0();Z0.exports=X7});var tO=l(function(Kbr,eO){"use strict";var Y7=typeof Object.getOwnPropertyDescriptors!="undefined";eO.exports=Y7});var aO=l(function(Ubr,nO){"use strict";var iO=require("@stdlib/object/ctor"),H7=iO.getOwnPropertyDescriptors;function Z7(r){return H7(iO(r))}nO.exports=Z7});var lO=l(function(zbr,oO){"use strict";var rZ=G(),eZ=M(),uO=ae(),sO=W();function tZ(r){var e,t,i,n,a;for(n={},t=rZ(r),a=0;a1){if(!sZ(e))throw new TypeError(fZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=uZ;if(r==null)return{};for(n=fO(r),t={},s=1;n&&s<=u;){for(a=oZ(n),i=vZ(a),o=0;o1){if(!hZ(e))throw new TypeError(dZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=gZ;if(r==null)return[];for(i=yO(r),t=[],u=1;i&&u<=a;){for(n=pZ(i),s=0;s1){if(!_Z(e))throw new TypeError(EZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=bZ;if(r==null)return[];for(i=xO(r),t=[],u=1;i&&u<=a;){for(n=xZ(i),s=0;s1){if(!VZ(e))throw new TypeError(IZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=AZ;if(r==null)return[];for(n=VO(r),t=[],i={},s=1;n&&s<=u;){for(a=FZ(n),v=0;v1){if(!RZ(e))throw new TypeError(DZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=NZ;if(r==null)return[];for(n=NO(r),t=[],i={},s=1;n&&s<=u;){for(a=CZ(n),v=0;v1){if(!KZ(e))throw new TypeError(QZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=WZ;if(r==null)return[];for(n=DO(r),t={},i=[],s=1;n&&s<=u;){for(a=zZ(n),v=0;v=0;a--)n=e.call(t,r[a],a,r),i!==r.length&&(a+=r.length-i,i=r.length),a>=0&&a=0;u--)a=e.call(t,r[u],u),i[a]=r[u];return i}sP.exports=frr});var vP=l(function(c_r,lP){"use strict";var mrr=oP();lP.exports=mrr});var mP=l(function(g_r,fP){"use strict";var ga=W();function crr(r){return ga(this,"next",{configurable:!1,enumerable:!0,get:function(){return this._next}}),this.value=r,ga(this,"_next",{configurable:!1,enumerable:!1,writable:!0,value:null}),ga(this,"_prev",{configurable:!1,enumerable:!1,writable:!0,value:null}),this}fP.exports=crr});var hP=l(function(h_r,gP){"use strict";var ur=k(),grr=Tr(),cP=require("@stdlib/symbol/iterator"),ha=mP();function nr(){return this instanceof nr?(this._length=0,this._first=null,this._last=null,this):new nr}ur(nr.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});ur(nr.prototype,"first",function(){if(this._length)return this._first});ur(nr.prototype,"insert",function(e,t){var i;if(e===this._last)return this.push(t);for(i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return i=new ha(t),e._next._prev=i,i._next=e._next,e._next=i,i._prev=e,this._length+=1,this});ur(nr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=-1,e=this.toArray(),t={},ur(t,"next",u),ur(t,"return",s),cP&&ur(t,cP,o),t;function u(){return a+=1,n||a>=e.length?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});ur(nr.prototype,"last",function(){if(this._length)return this._last});grr(nr.prototype,"length",function(){return this._length});ur(nr.prototype,"pop",function(){var e;return this._length&&(e=this._last.value,this._last._prev?(this._last=this._last._prev,this._last._next=null):(this._first=null,this._last=null),this._length-=1),e});ur(nr.prototype,"push",function(e){var t;return t=new ha(e),this._length===0?(this._first=t,this._last=t):(t._prev=this._last,this._last._next=t,this._last=t),this._length+=1,this});ur(nr.prototype,"remove",function(e){var t,i;if(e===this._first)return this.shift();if(e===this._last)return this.pop();for(t=e.value,i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return e._prev._next=e._next,e._next._prev=e._prev,this._length-=1,t});ur(nr.prototype,"shift",function(){var e;return this._length&&(e=this._first.value,this._first._next?(this._first=this._first._next,this._first._prev=null):(this._first=null,this._last=null),this._length-=1),e});ur(nr.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i=0;y--)h=uer(m,c,g,u,y,ser),s=i.call(n,s,t(v(a,h),y,f),y,f);return s}v1.exports=oer});var c1=l(function(N_r,m1){"use strict";function ler(r,e,t,i,n){var a,u,s,o;for(a=r.data,u=r.accessors[0],s=e,o=a.length-1;o>=0;o--)s=i.call(n,s,t(u(a,o),o,a),o,a);return s}m1.exports=ler});var p1=l(function(R_r,h1){"use strict";var ver=require("@stdlib/assert/is-array-like-object"),fer=require("@stdlib/assert/is-ndarray-like"),g1=require("@stdlib/assert/is-function"),mer=require("@stdlib/ndarray/base/ndarraylike2object"),cer=require("@stdlib/array/base/arraylike2object"),wa=require("@stdlib/string/format"),ger=f1(),her=c1();function per(r,e,t,i,n){if(!g1(t))throw new TypeError(wa("invalid argument. Third argument must be a function. Value: `%s`.",t));if(!g1(i))throw new TypeError(wa("invalid argument. Fourth argument must be a function. Value: `%s`.",i));if(fer(r))return ger(mer(r),e,t,i,n);if(ver(r))return her(cer(r),e,t,i,n);throw new TypeError(wa("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}h1.exports=per});var y1=l(function(j_r,d1){"use strict";var der=p1();d1.exports=der});var ba=l(function(C_r,b1){"use strict";var q1=require("@stdlib/ndarray/base/vind2bind"),w1="throw";function yer(r,e,t,i){var n,a,u,s,o,v,f,m,c,g,h,y,q,_,E,P,A;if(o=r.length,c=r.shape,g=e.shape,n=r.data,a=e.data,h=r.strides,y=e.strides,q=r.offset,_=e.offset,u=r.order,s=e.order,v=r.accessors[0],f=e.accessors[1],m=r.ref,c.length===0){f(a,_,t.call(i,v(n,q),0,m));return}for(A=o-1;A>=0;A--)E=q1(c,h,q,u,A,w1),P=q1(g,y,_,s,A,w1),f(a,P,t.call(i,v(n,E),A,m))}b1.exports=yer});var _a=l(function(B_r,_1){"use strict";function qer(r,e,t,i){var n,a,u,s,o;for(n=r.data,a=e.data,u=r.accessors[0],s=e.accessors[1],o=n.length-1;o>=0;o--)s(a,o,t.call(i,u(n,o),o,n))}_1.exports=qer});var P1=l(function(D_r,O1){"use strict";var wer=require("@stdlib/assert/is-array-like-object"),ber=require("@stdlib/assert/is-ndarray-like"),_er=require("@stdlib/assert/is-function"),xer=require("@stdlib/array/base/zeros"),x1=require("@stdlib/ndarray/base/ndarraylike2object"),E1=require("@stdlib/array/base/arraylike2object"),Eer=require("@stdlib/ndarray/zeros"),T1=require("@stdlib/string/format"),Ter=ba(),Oer=_a();function Per(r,e,t){var i;if(!_er(e))throw new TypeError(T1("invalid argument. Second argument must be a function. Value: `%s`.",e));if(ber(r))return r=x1(r),i=Eer(r.shape,{dtype:"generic",order:r.order}),Ter(r,x1(i),e,t),i;if(wer(r))return i=xer(r.length),Oer(E1(r),E1(i),e,t),i;throw new TypeError(T1("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}O1.exports=Per});var I1=l(function(M_r,k1){"use strict";var A1=require("@stdlib/assert/is-array-like-object"),xa=require("@stdlib/assert/is-ndarray-like"),Aer=require("@stdlib/assert/is-function"),V1=require("@stdlib/ndarray/base/ndarraylike2object"),F1=require("@stdlib/array/base/arraylike2object"),Ver=require("@stdlib/ndarray/base/maybe-broadcast-array"),Fer=require("@stdlib/ndarray/base/assert/is-read-only"),yt=require("@stdlib/string/format"),ker=ba(),Ier=_a();function Ser(r,e,t,i){var n,a;if(!Aer(t))throw new TypeError(yt("invalid argument. Third argument must be a function. Value: `%s`.",t));if(xa(r)){if(!xa(e))throw new TypeError(yt("invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.",e));if(Fer(e))throw new Error("invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.");return e=V1(e),a=e.shape,n=V1(Ver(r,a)),n.ref=r,r=n,ker(r,e,t,i),e.ref}if(A1(r)){if(!A1(e)||xa(e))throw new TypeError(yt("invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.",e));if(r.length!==e.length)throw new RangeError("invalid arguments. Input and output arrays must have the same length.");return Ier(F1(r),F1(e),t,i),e}throw new TypeError(yt("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}k1.exports=Ser});var N1=l(function($_r,L1){"use strict";var Ler=k(),S1=P1(),Ner=I1();Ler(S1,"assign",Ner);L1.exports=S1});var C1=l(function(W_r,j1){"use strict";var Rer=require("@stdlib/assert/is-function"),jer=require("@stdlib/assert/has-own-property"),R1=require("@stdlib/string/format");function Cer(r,e){var t,i;if(typeof r!="object"||r===null)throw new TypeError(R1("invalid argument. First argument must be an object. Value: `%s`.",r));if(!Rer(e))throw new TypeError(R1("invalid argument. Second argument must be a function. Value: `%s`.",e));t={};for(i in r)jer(r,i)&&(t[i]=e(r[i],i,r));return t}j1.exports=Cer});var D1=l(function(K_r,B1){"use strict";var Ber=C1();B1.exports=Ber});var Oa=l(function(U_r,M1){"use strict";var Ea=require("@stdlib/ndarray/base/vind2bind"),Ta="throw";function Der(r,e,t,i,n){var a,u,s,o,v,f,m,c,g,h,y,q,_,E,P,A,j,K,U,V,F,I,$,or,tr;if(P=r.length,q=r.shape,_=e.shape,E=t.shape,a=r.data,u=e.data,s=t.data,A=r.strides,j=e.strides,K=t.strides,U=r.offset,V=e.offset,F=t.offset,o=r.order,v=e.order,f=t.order,m=r.accessors[0],c=e.accessors[0],g=t.accessors[1],h=r.ref,y=e.ref,q.length===0&&_.length===0){g(s,F,i.call(n,m(a,U),c(u,V),0,[h,y]));return}for(tr=0;tr=0;tr--)I=La(q,A,U,o,tr,Na),$=La(_,j,V,v,tr,Na),or=La(E,K,F,f,tr,Na),g(s,or,i.call(n,m(a,I),c(u,$),tr,[h,y]))}rA.exports=ttr});var ja=l(function(Y_r,eA){"use strict";function itr(r,e,t,i,n){var a,u,s,o,v,f,m;for(a=r.data,u=e.data,s=t.data,o=r.accessors[0],v=e.accessors[0],f=t.accessors[1],m=a.length-1;m>=0;m--)f(s,m,i.call(n,o(a,m),v(u,m),m,[a,u]))}eA.exports=itr});var uA=l(function(H_r,aA){"use strict";var tA=require("@stdlib/assert/is-array-like-object"),iA=require("@stdlib/assert/is-ndarray-like"),ntr=require("@stdlib/assert/is-function"),atr=require("@stdlib/array/base/zeros"),Ca=require("@stdlib/ndarray/base/ndarraylike2object"),Ba=require("@stdlib/array/base/arraylike2object"),utr=require("@stdlib/ndarray/zeros"),str=require("@stdlib/ndarray/base/broadcast-shapes"),nA=require("@stdlib/ndarray/base/maybe-broadcast-array"),wt=require("@stdlib/string/format"),otr=Ra(),ltr=ja();function vtr(r,e,t,i){var n,a,u,s,o;if(!ntr(t))throw new TypeError(wt("invalid argument. Second argument must be a function. Value: `%s`.",t));if(n=iA(r),a=iA(e),n){if(!a)throw new TypeError(wt("invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.",e));if(o=str([r.shape,e.shape]),o===null)throw new Error("invalid arguments. Input ndarrays must be broadcast compatible.");return s=Ca(nA(r,o)),s.ref=r,r=s,s=Ca(nA(e,o)),s.ref=e,e=s,u=utr(o,{dtype:"generic",order:r.order}),otr(r,e,Ca(u),t,i),u}if(tA(r)){if(a||!tA(e))throw new TypeError(wt("invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.",e));if(e.length!==r.length)throw new RangeError("invalid arguments. Input arrays must have the same length.");return u=atr(r.length),ltr(Ba(r),Ba(e),Ba(u),t,i),u}throw new TypeError(wt("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}aA.exports=vtr});var lA=l(function(Z_r,oA){"use strict";var Da=require("@stdlib/assert/is-array-like-object"),Ma=require("@stdlib/assert/is-ndarray-like"),ftr=require("@stdlib/assert/is-function"),$a=require("@stdlib/ndarray/base/ndarraylike2object"),Wa=require("@stdlib/array/base/arraylike2object"),sA=require("@stdlib/ndarray/base/maybe-broadcast-array"),mtr=require("@stdlib/ndarray/base/assert/is-read-only"),he=require("@stdlib/string/format"),ctr=Ra(),gtr=ja();function htr(r,e,t,i,n){var a,u,s,o,v;if(!ftr(i))throw new TypeError(he("invalid argument. Fourth argument must be a function. Value: `%s`.",i));if(a=Ma(r),u=Ma(e),s=Ma(t),a){if(!u)throw new TypeError(he("invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.",e));if(!s)throw new TypeError(he("invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.",t));if(mtr(t))throw new Error("invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.");return t=$a(t),v=t.shape,o=$a(sA(r,v)),o.ref=r,r=o,o=$a(sA(e,v)),o.ref=e,e=o,ctr(r,e,t,i,n),t.ref}if(Da(r)){if(u||!Da(e))throw new TypeError(he("invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.",e));if(s||!Da(t))throw new TypeError(he("invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.",t));if(r.length!==e.length||e.length!==t.length)throw new RangeError("invalid arguments. Input and output arrays must have the same length.");return gtr(Wa(r),Wa(e),Wa(t),i,n),t}throw new TypeError(he("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}oA.exports=htr});var mA=l(function(rxr,fA){"use strict";var ptr=k(),vA=uA(),dtr=lA();ptr(vA,"assign",dtr);fA.exports=vA});var hA=l(function(exr,gA){"use strict";var cA=require("@stdlib/assert/is-array-like-object"),ytr=require("@stdlib/assert/is-function"),Ka=require("@stdlib/string/format");function qtr(r,e,t){var i,n,a,u,s,o,v;if(!cA(r))throw new TypeError(Ka("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(!ytr(e))throw new TypeError(Ka("invalid argument. Second argument must be a function. Value: `%s`.",e));for(a=r.length,i=[],o=0;o1&&(a=Bir(n,e),a))throw a;function s(){var o,v,f,m,c;if(f=arguments.length,f<=0?m=Ur(t,n.dtype):f===1?Ha(arguments[0])?m=Ur(t,arguments[0]):TV(arguments[0])?m=Ur(arguments[0],0,t,n.dtype):m=Ur(arguments[0],n.dtype):f===2?TV(arguments[0])?Ha(arguments[1])?m=Ur(arguments[0],0,t,arguments[1]):m=Ur(arguments[0],arguments[1],t,n.dtype):m=Ur(arguments[0],arguments[1]):m=Ur(arguments[0],arguments[1],t,arguments[2]),m.length!==t)throw new RangeError(B("invalid arguments. Arguments are incompatible with the number of tuple fields. Number of fields: `%u`. Number of data elements: `%u`.",t,m.length));for(v=Lir(m),o=[],c=0;c=t?{done:!0}:{value:[x,i[o[x]],m[x]],done:!1}}function S(qe){return T=!0,arguments.length?{value:qe,done:!0}:{done:!0}}function ee(){return b.entries()}}function E(b,w){var T,x;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!sr(b))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",b));for(x=0;x1){if(w=arguments[0],!Zr(w))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",w));if(w>=t)return;w<0&&(w=t+w,w<0&&(w=0))}else w=0;for(;w=t))return i[o[b]]}function I(b){var w;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!Ha(b))throw new TypeError(B("invalid argument. First argument must be a string. Value: `%s`.",b));for(w=0;w=t?{done:!0}:{value:[x,i[o[x]]],done:!1}}function S(qe){return T=!0,arguments.length?{value:qe,done:!0}:{done:!0}}function ee(){return b.keys()}}function or(b){var w;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(arguments.length>1){if(w=arguments[1],!Zr(w))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",w));if(w>=t)w=t-1;else if(w<0&&(w=t+w,w<0))return}else w=t-1;for(;w>=0;w--)if(m[w]===b)return i[o[w]]}function tr(b,w){var T,x;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!sr(b))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",b));for(T=s(v),x=0;x1?(w=arguments[1],T=0):(w=m[0],T=1);T1?(w=arguments[1],T=t-1):(w=m[t-1],T=t-2);T>=0;T--)w=b(w,m[T],T,i[o[T]],m);return w}function Qj(){var b,w,T;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");for(w=0;wt&&(S=t)}if(O>=S)return null;for(x=[],T=[];Ot&&(O=t)}if(x>=O)return null;for(T=[],S=x;S1){if(g=arguments[1],!sr(g))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",g));m>2&&(f=arguments[2])}if(Fir(v)){if(v.length!==t)throw new RangeError(B("invalid argument. Source is incompatible with the number of tuple fields. Number of fields: `%u`. Source length: `%u`.",t,v.length));if(c=s(t,n.dtype),g)for(q=0;q1){if(g=arguments[1],!sr(g))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",g));m>2&&(f=arguments[2])}if(c=s(t,n.dtype),g)for(y=0;y=0;a--){if(i=e.call(t,r[a],a,r),i)return!1;n!==r.length&&(a+=r.length-n,n=r.length)}return!0}XV.exports=onr});var ZV=l(function(Mxr,HV){"use strict";var lnr=YV();HV.exports=lnr});var tF=l(function($xr,eF){"use strict";var vnr=G(),fnr=M(),rF=require("@stdlib/assert/is-nonenumerable-property");function mnr(r){var e,t,i,n;for(e=vnr(r),i=0,n=0;n1){if(!Qnr(e))throw new TypeError(eu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(kF(e,"duplicates")&&(t=e.duplicates,!Xnr(t)))throw new TypeError(eu("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",t))}if(i=znr(r),n=i.length,s={},t)for(v=0;v=a?u[s]=e[s-a]:u[s]=arguments[s];return r.apply(null,u)}}uk.exports=Far});var lk=l(function(hEr,ok){"use strict";var kar=sk();ok.exports=kar});var mk=l(function(pEr,fk){"use strict";var vk=require("@stdlib/os/num-cpus");function Iar(){return{workers:vk-1,concurrency:vk-1,cmd:"node",ordered:!1,uid:null,gid:null,encoding:"buffer",maxBuffer:200*1024*1024}}fk.exports=Iar});var hk=l(function(dEr,gk){"use strict";var Sar=require("@stdlib/assert/is-plain-object"),re=require("@stdlib/assert/has-own-property"),ck=require("@stdlib/assert/is-positive-integer").isPrimitive,tu=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Lar=require("@stdlib/assert/is-boolean").isPrimitive,Nar=require("@stdlib/assert/is-string").isPrimitive,zr=require("@stdlib/string/format");function Rar(r,e){return Sar(e)?re(e,"concurrency")&&(r.concurrency=e.concurrency,!ck(r.concurrency))?new TypeError(zr("invalid option. `%s` option must be a positive integer. Option: `%s`.","concurrency",r.concurrency)):re(e,"workers")&&(r.workers=e.workers,!ck(r.workers))?new TypeError(zr("invalid option. `%s` option must be a positive integer. Option: `%s`.","workers",r.workers)):re(e,"cmd")&&(r.cmd=e.cmd,!Nar(r.cmd))?new TypeError(zr("invalid option. `%s` option must be a string. Option: `%s`.","cmd",r.cmd)):re(e,"ordered")&&(r.ordered=e.ordered,!Lar(r.ordered))?new TypeError(zr("invalid option. `%s` option must be a boolean. Option: `%s`.","ordered",r.ordered)):re(e,"uid")&&(r.uid=e.uid,!tu(r.uid))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","uid",r.uid)):re(e,"gid")&&(r.gid=e.gid,!tu(r.gid))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","gid",r.gid)):re(e,"maxBuffer")&&(r.maxBuffer=e.maxBuffer,!tu(r.maxBuffer))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","maxBuffer",r.maxBuffer)):null:new TypeError(zr("invalid argument. Options argument must be an object. Value: `%s`.",e))}gk.exports=Rar});var yk=l(function(yEr,dk){"use strict";var jar=z(),pk=require("@stdlib/process/env");function Car(){var r,e,t,i;for(r=jar(pk),t={},i=0;i=r.length){if(F=iu(a).length,F>0){er("%d scripts are pending.",F);return}return er("All scripts have finished."),P()}er("Instructing child process to run script: %s. pid: %d.",r[m],V.pid),V.send(r[m]),a[r[m]]=!0,er("%d of %d scripts have been processed.",m,r.length)}function y(V){return F;function F(I){er("Child process message: %s. pid: %d.",I,V.pid),delete a[I],h(V)}}function q(V){return F;function F(I,$){er("Child process closed. Code: %d. Signal: %s. pid: %d.",I,$,V.pid),K(I,$),_()}}function _(){i+=1,er("%d of %d child processes have closed.",i,e.workers),i===e.workers&&U()}function E(V){return F;function F(I,$){er("Child process exited. Code: %d. Signal: %s. pid: %d.",I,$,V.pid),K(I,$)}}function P(V){var F,I,$;for(V&&!c&&(c=V),er("Instructing child processes to close..."),F=iu(n),$=0;$2){if(r=arguments[1],i=arguments[2],n=eur(t,r),n)throw n}else i=arguments[1];if(!Har(i))throw new TypeError(Ok("invalid argument. Callback argument must be a function. Value: `%s`.",i));for(t.concurrency>e.length&&(t.concurrency=e.length),t.workers>t.concurrency&&(t.workers=t.concurrency),a=Zar(),u=0;u1&&!uur(e))throw new TypeError(kk("invalid argument. Reviver argument must be a function. Value: `%s`.",e));try{return JSON.parse(r,e)}catch(t){return t}}Ik.exports=sur});var Nk=l(function(TEr,Lk){"use strict";var our=Sk();Lk.exports=our});var Bk=l(function(OEr,Ck){"use strict";var lur=require("@stdlib/assert/is-string").isPrimitive,vur=require("@stdlib/assert/is-string-array").primitives,Rk=require("@stdlib/assert/has-own-property"),jk=require("@stdlib/string/format");function fur(r,e){var t,i,n;if(typeof r!="object"||r===null)throw new TypeError(jk("invalid argument. First argument must be an object. Value: `%s`.",r));if(t={},lur(e))return Rk(r,e)&&(t[e]=r[e]),t;if(vur(e)){for(n=0;n2&&(a=kur(i,t),a))throw a;for(i.copy?n=new Array(r.length):n=r,s=0;s=0)return Dur(r);throw new TypeError(Bur("invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.",r))}vI.exports=$ur});var cI=l(function(BEr,mI){"use strict";var Wur=fI();mI.exports=Wur});var hI=l(function(DEr,gI){"use strict";function Kur(r,e){var t;for(t=e.length-1;t>=0;t--)r.unshift(e[t]);return r}gI.exports=Kur});var dI=l(function(MEr,pI){"use strict";function Uur(r,e){var t,i,n;for(t=r.length,i=e.length,n=t-1;n>=0;n--)r[n+i]=r[n];for(n=0;n=0)return rsr(r,e);throw new TypeError(wI("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}bI.exports=tsr});var EI=l(function(KEr,xI){"use strict";var isr=_I();xI.exports=isr});var OI=l(function(UEr,TI){"use strict";var nsr=G(),asr=M();function usr(r){var e,t,i;for(e=nsr(r),t=asr(r),i=0;i=0)return Msr(r,e);throw new TypeError(Bsr("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}ZI.exports=Wsr});var tS=l(function(aTr,eS){"use strict";var Ksr=rS();eS.exports=Ksr});var nS=l(function(uTr,iS){"use strict";var Usr=require("@stdlib/string/format"),zsr=require("@stdlib/constants/float16/max"),Gsr=require("@stdlib/constants/float32/max"),Qsr=require("@stdlib/constants/float64/max");function Jsr(r){switch(r){case"float64":return Qsr;case"float32":return Gsr;case"float16":return zsr;default:throw new TypeError(Usr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}iS.exports=Jsr});var uS=l(function(sTr,aS){"use strict";var Xsr=nS();aS.exports=Xsr});var oS=l(function(oTr,sS){"use strict";var Ysr=require("@stdlib/string/format"),Hsr=require("@stdlib/constants/float16/smallest-normal"),Zsr=require("@stdlib/constants/float32/smallest-normal"),ror=require("@stdlib/constants/float64/smallest-normal");function eor(r){switch(r){case"float64":return ror;case"float32":return Zsr;case"float16":return Hsr;default:throw new TypeError(Ysr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}sS.exports=eor});var vS=l(function(lTr,lS){"use strict";var tor=oS();lS.exports=tor});var mS=l(function(vTr,fS){"use strict";var ior=require("@stdlib/ndarray/base/vind2bind"),nor="throw";function aor(r,e,t,i){var n,a,u,s,o,v,f,m,c,g,h;if(s=r.length,f=r.shape,n=r.data,m=r.strides,c=r.offset,a=r.order,o=r.accessors[0],v=r.ref,f.length===0)return t.call(i,e,o(n,c),0,v);for(u=e,h=0;h=0;h--)g=dor(f,m,c,a,h,yor),u=t.call(i,u,o(n,g),h,v);return u}wS.exports=qor});var xS=l(function(hTr,_S){"use strict";function wor(r,e,t,i){var n,a,u,s;for(n=r.data,a=r.accessors[0],u=e,s=n.length-1;s>=0;s--)u=t.call(i,u,a(n,s),s,n);return u}_S.exports=wor});var OS=l(function(pTr,TS){"use strict";var bor=require("@stdlib/assert/is-array-like-object"),_or=require("@stdlib/assert/is-ndarray-like"),xor=require("@stdlib/assert/is-function"),Eor=require("@stdlib/ndarray/base/ndarraylike2object"),Tor=require("@stdlib/array/base/arraylike2object"),ES=require("@stdlib/string/format"),Oor=bS(),Por=xS();function Aor(r,e,t,i){if(!xor(t))throw new TypeError(ES("invalid argument. Third argument must be a function. Value: `%s`.",t));if(_or(r))return Oor(Eor(r),e,t,i);if(bor(r))return Por(Tor(r),e,t,i);throw new TypeError(ES("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}TS.exports=Aor});var AS=l(function(dTr,PS){"use strict";var Vor=OS();PS.exports=Vor});var kS=l(function(yTr,FS){"use strict";var VS=require("@stdlib/assert/is-array-like-object"),For=require("@stdlib/assert/is-collection"),kor=require("@stdlib/assert/is-function"),Vt=require("@stdlib/string/format");function Ior(r,e,t,i){var n,a,u,s,o,v,f;if(!VS(r))throw new TypeError(Vt("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(!VS(e))throw new TypeError(Vt("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(e.length!==r.length)throw new RangeError("invalid argument. Second argument must have a length equal to the size of the outermost input array dimension.");if(!kor(t))throw new TypeError(Vt("invalid argument. Third argument must be a function. Value: `%s`.",t));for(u=r.length,n=[],v=0;v=0)return olr(r);throw new TypeError(slr("invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.",r))}uL.exports=vlr});var lL=l(function(STr,oL){"use strict";var flr=sL();oL.exports=flr});var fL=l(function(LTr,vL){"use strict";var mlr=require("@stdlib/string/format"),clr=require("@stdlib/constants/int8/num-bytes"),glr=require("@stdlib/constants/uint8/num-bytes"),hlr=require("@stdlib/constants/int16/num-bytes"),plr=require("@stdlib/constants/uint16/num-bytes"),dlr=require("@stdlib/constants/int32/num-bytes"),ylr=require("@stdlib/constants/uint32/num-bytes"),qlr=require("@stdlib/constants/float16/num-bytes"),wlr=require("@stdlib/constants/float32/num-bytes"),blr=require("@stdlib/constants/float64/num-bytes"),_lr=require("@stdlib/constants/complex64/num-bytes"),xlr=require("@stdlib/constants/complex128/num-bytes");function Elr(r){switch(r){case"float64":return blr;case"int32":return dlr;case"uint32":return ylr;case"float32":return wlr;case"int8":return clr;case"uint8":case"uint8c":return glr;case"int16":return hlr;case"uint16":return plr;case"float16":return qlr;case"complex128":return xlr;case"complex64":return _lr;default:throw new TypeError(mlr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}vL.exports=Elr});var cL=l(function(NTr,mL){"use strict";var Tlr=fL();mL.exports=Tlr});var pL=l(function(RTr,hL){"use strict";var Olr=require("@stdlib/assert/is-collection"),Plr=require("@stdlib/assert/is-positive-integer").isPrimitive,gL=require("@stdlib/string/format");function Alr(r,e){var t,i,n;if(!Olr(r))throw new TypeError(gL("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!Plr(e))throw new TypeError(gL("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));for(i=r.length,t=0,n=0;n=0;s--){if(a=t.call(i,r[s],s,r),a&&(n+=1,n===e))return!0;u!==r.length&&(s+=r.length-u,u=r.length)}return!1}xL.exports=Clr});var OL=l(function(MTr,TL){"use strict";var Blr=EL();TL.exports=Blr});var VL=l(function($Tr,AL){"use strict";var pr=k(),Dlr=Tr(),PL=require("@stdlib/symbol/iterator");function mr(){return this instanceof mr?(this._buffer=[],this):new mr}pr(mr.prototype,"clear",function(){return this._buffer.length=0,this});pr(mr.prototype,"first",function(){if(this._buffer.length)return this._buffer[this._buffer.length-1]});pr(mr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=this._buffer.length,e=this._buffer.slice(),t={},pr(t,"next",u),pr(t,"return",s),PL&&pr(t,PL,o),t;function u(){return a-=1,n||a<0?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});pr(mr.prototype,"last",function(){if(this._buffer.length)return this._buffer[0]});Dlr(mr.prototype,"length",function(){return this._buffer.length});pr(mr.prototype,"pop",function(){if(this._buffer.length)return this._buffer.pop()});pr(mr.prototype,"push",function(e){return this._buffer.push(e),this});pr(mr.prototype,"toArray",function(){var e,t;for(e=[],t=this._buffer.length-1;t>=0;t--)e.push(this._buffer[t]);return e});pr(mr.prototype,"toJSON",function(){var e={};return e.type="stack",e.data=this.toArray(),e});AL.exports=mr});var kL=l(function(WTr,FL){"use strict";var Mlr=VL();FL.exports=Mlr});var SL=l(function(KTr,IL){"use strict";var $lr=require("@stdlib/assert/is-collection"),Wlr=H(),Klr=require("@stdlib/string/format");function Ulr(r){var e,t,i,n,a,u,s;if(!$lr(r))throw new TypeError(Klr("invalid argument. First argument must be a collection. Value: `%s`.",r));for(e=0,t=[],n=[],i=r.length,u=0;u1?t=e:t=null,i;function i(){var n,a,u;for(a=arguments.length,n=new Array(a),u=0;u2){if(n=e,i=t,!ZN(n))throw new TypeError(Ne("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else ZN(e)?n=e:(n=null,i=e);return a;function a(){var u,s;if(u=r,n){if(n>arguments.length)throw new Error(Ne("insufficient arguments. Expected %u argument(s) and only received %u argument(s).",n,arguments.length));for(s=0;s2){if(n=e,i=t,!nR(n))throw new TypeError(Re("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else nR(e)?n=e:(n=null,i=e);return a;function a(){var u,s;if(u=r,n){if(n>arguments.length)throw new Error(Re("insufficient arguments. Expected %u argument(s) and only received %u argument(s).",n,arguments.length));for(s=n-1;s>=0;s--)if(mu(u))u=u.call(i,arguments[s]);else throw new Error(Re("invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.",n,s));return u}for(s=arguments.length-1;s>=0;s--)if(mu(u))u=u.call(i,arguments[s]);else throw new Error(Re("invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.",arguments.length,s));return u}}aR.exports=Afr});var oR=l(function(O0r,sR){"use strict";var Vfr=uR();sR.exports=Vfr});var vR=l(function(P0r,lR){"use strict";function Ffr(r,e){var t;for(t=e.length-1;t>=0;t--)r.unshift(e[t]);return r}lR.exports=Ffr});var mR=l(function(A0r,fR){"use strict";function kfr(r,e){var t,i,n;for(t=r.length,i=e.length,n=t-1;n>=0;n--)r[n+i]=r[n];for(n=0;n=0)return Dfr(r,e);throw new TypeError(Cfr("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}hR.exports=$fr});var yR=l(function(k0r,dR){"use strict";var Wfr=pR();dR.exports=Wfr});var _R=l(function(I0r,bR){"use strict";var qR=require("@stdlib/assert/is-function"),wR=require("@stdlib/string/format");function Kfr(r,e,t){var i;if(!qR(r))throw new TypeError(wR("invalid argument. First argument must be a function. Value: `%s`.",r));if(!qR(e))throw new TypeError(wR("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=0;!r(i);)e.call(t,i),i+=1}bR.exports=Kfr});var ER=l(function(S0r,xR){"use strict";var Ufr=_R();xR.exports=Ufr});var PR=l(function(L0r,OR){"use strict";var zfr=require("@stdlib/assert/is-collection"),TR=require("@stdlib/assert/is-function"),cu=require("@stdlib/string/format");function Gfr(r,e,t,i){var n,a;if(!zfr(r))throw new TypeError(cu("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!TR(e))throw new TypeError(cu("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!TR(t))throw new TypeError(cu("invalid argument. Third argument must be a function. Value: `%s`.",t));for(n=r.length,a=0;a=0&&!e(r[a],a,r);)t.call(i,r[a],a,r),n!==r.length&&(a+=r.length-n,n=r.length),a-=1;return r}kR.exports=Xfr});var LR=l(function(j0r,SR){"use strict";var Yfr=IR();SR.exports=Yfr});var RR=l(function(C0r,NR){"use strict";var Hfr=require("@stdlib/assert/is-integer"),hu=require("@stdlib/assert/is-array");function Zfr(r,e){var t,i,n,a,u,s,o;if(!hu(r))throw new TypeError("invalid argument. Must provide a zipped array.");for(i=r.length,u=0;u1){if(!hu(e))throw new TypeError("invalid argument. Indices must be specified as an array.");for(u=0;ut)throw new Error("invalid argument. Must provide valid indices (i.e., must be a nonnegative integer less than or equal to the tuple length).")}t=e.length}else for(e=new Array(t),u=0;u=0&&e(r[a],a,r);)t.call(i,r[a],a,r),n!==r.length&&(a+=r.length-n,n=r.length),a-=1;return r}lj.exports=wmr});var mj=l(function(Y0r,fj){"use strict";var bmr=vj();fj.exports=bmr});var hj=l(function(H0r,gj){"use strict";var _mr=G(),xmr=M(),cj=require("@stdlib/assert/is-writable-property");function Emr(r){var e,t,i,n;for(e=_mr(r),i=0,n=0;nu&&(u=v);for(o=new Array(u),m=0;m=0;a--){if(i=e.call(t,r[a],a,r),i)return!0;n!==r.length&&(a+=r.length-n,n=r.length)}return!1}Uu.exports=AC});var Qu=l(function(dcr,Gu){"use strict";var VC=zu();Gu.exports=VC});var Xu=l(function(ycr,Ju){"use strict";function FC(r,e){var t;for(t=0;t=0)return DC(r,e);throw new TypeError(es("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}ts.exports=$C});var as=l(function(_cr,ns){"use strict";var WC=is();ns.exports=WC});var ss=l(function(xcr,us){"use strict";var KC=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UC=require("@stdlib/string/format");function zC(r){if(!KC(r))throw new TypeError(UC("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));return e;function e(){return arguments[r]}}us.exports=zC});var ls=l(function(Ecr,os){"use strict";var GC=ss();os.exports=GC});var fs=l(function(Tcr,vs){"use strict";var QC=W();function JC(r,e,t){QC(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}vs.exports=JC});var k=l(function(Ocr,ms){"use strict";var XC=fs();ms.exports=XC});var gs=l(function(Pcr,cs){"use strict";var YC=require("@stdlib/assert/is-plain-object"),It=require("@stdlib/assert/has-own-property"),HC=require("@stdlib/assert/is-boolean").isPrimitive,ZC=require("@stdlib/assert/is-positive-integer").isPrimitive,St=require("@stdlib/string/format");function r2(r,e){return YC(e)?(It(e,"thisArg")&&(r.thisArg=e.thisArg),It(e,"series")&&(r.series=e.series,!HC(r.series))?new TypeError(St("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):It(e,"limit")&&(r.limit=e.limit,!ZC(r.limit))?new TypeError(St("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(St("invalid argument. Options argument must be an object. Value: `%s`.",e))}cs.exports=r2});var ps=l(function(Acr,hs){"use strict";var e2=require("debug"),dr=e2("any-by-async:limit");function t2(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,dr("Collection length: %d",o),o===0)return dr("Finished processing a collection."),i(null,!1);for(o1){if(i=a2(t,r),i)throw i;n=e}else n=r;if(!ds(n))throw new TypeError(Lt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=n2),a;function a(u,s){if(!i2(u))throw new TypeError(Lt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!ds(s))throw new TypeError(Lt("invalid argument. Last argument must be a function. Value: `%s`.",s));return u2(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}ys.exports=s2});var bs=l(function(Fcr,ws){"use strict";var qs=Nt();function o2(r,e,t,i){if(arguments.length<4)return qs(e)(r,t);qs(e,t)(r,i)}ws.exports=o2});var Es=l(function(kcr,xs){"use strict";var l2=k(),_s=bs(),v2=Nt();l2(_s,"factory",v2);xs.exports=_s});var Os=l(function(Icr,Ts){"use strict";var f2=require("@stdlib/assert/is-plain-object"),Rt=require("@stdlib/assert/has-own-property"),m2=require("@stdlib/assert/is-boolean").isPrimitive,c2=require("@stdlib/assert/is-positive-integer").isPrimitive,jt=require("@stdlib/string/format");function g2(r,e){return f2(e)?(Rt(e,"thisArg")&&(r.thisArg=e.thisArg),Rt(e,"series")&&(r.series=e.series,!m2(r.series))?new TypeError(jt("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Rt(e,"limit")&&(r.limit=e.limit,!c2(r.limit))?new TypeError(jt("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(jt("invalid argument. Options argument must be an object. Value: `%s`.",e))}Ts.exports=g2});var As=l(function(Scr,Ps){"use strict";var h2=require("debug"),yr=h2("any-by-right-async:limit");function p2(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,yr("Collection length: %d",s),s===0)return yr("Finished processing a collection."),i(null,!1);for(s0&&f();function f(){o-=1,yr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,yr("Encountered an error: %s",c.message),i(c);if(n+=1,yr("Processed %d of %d collection elements.",n,s),yr("Test result: %s",!!g),g&&!a)return a=!0,yr("Finished processing a collection."),i(null,!0);if(o>0)return f();if(n===s)return yr("Finished processing a collection."),i(null,!1)}}}Ps.exports=p2});var Bt=l(function(Lcr,Fs){"use strict";var Vs=require("@stdlib/assert/is-function"),d2=require("@stdlib/assert/is-collection"),Ct=require("@stdlib/string/format"),y2=require("@stdlib/constants/float64/pinf"),q2=Os(),w2=As();function b2(r,e){var t,i,n;if(t={},arguments.length>1){if(i=q2(t,r),i)throw i;n=e}else n=r;if(!Vs(n))throw new TypeError(Ct("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=y2),a;function a(u,s){if(!d2(u))throw new TypeError(Ct("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Vs(s))throw new TypeError(Ct("invalid argument. Last argument must be a function. Value: `%s`.",s));return w2(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Fs.exports=b2});var Ss=l(function(Ncr,Is){"use strict";var ks=Bt();function _2(r,e,t,i){if(arguments.length<4)return ks(e)(r,t);ks(e,t)(r,i)}Is.exports=_2});var Rs=l(function(Rcr,Ns){"use strict";var x2=k(),Ls=Ss(),E2=Bt();x2(Ls,"factory",E2);Ns.exports=Ls});var Ds=l(function(jcr,Bs){"use strict";var js=require("@stdlib/assert/is-nan"),T2=require("@stdlib/assert/is-collection"),O2=require("@stdlib/assert/is-string").isPrimitive,P2=require("@stdlib/assert/is-integer").isPrimitive,Cs=require("@stdlib/string/format");function A2(r,e,t){var i,n;if(!T2(r)&&!O2(r))throw new TypeError(Cs("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(i=r.length,i===0)return-1;if(arguments.length===3){if(!P2(t))throw new TypeError(Cs("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(t>=0){if(t>=i)return-1;n=t}else n=i+t,n<0&&(n=0)}else n=0;if(js(e)){for(;n1){if(i=B2(t,r),i)throw i;n=e}else n=r;if(!Gs(n))throw new TypeError(Dt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=C2),a;function a(u,s){if(!j2(u))throw new TypeError(Dt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Gs(s))throw new TypeError(Dt("invalid argument. Last argument must be a function. Value: `%s`.",s));return D2(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}Qs.exports=M2});var Ys=l(function($cr,Xs){"use strict";var Js=Mt();function $2(r,e,t,i){if(arguments.length<4)return Js(e)(r,t);Js(e,t)(r,i)}Xs.exports=$2});var ro=l(function(Wcr,Zs){"use strict";var W2=k(),Hs=Ys(),K2=Mt();W2(Hs,"factory",K2);Zs.exports=Hs});var to=l(function(Kcr,eo){"use strict";var U2=require("@stdlib/assert/is-function"),z2=require("@stdlib/string/format");function G2(){var r,e,t;if(r=arguments.length,r<2)throw new Error("insufficient arguments. Must provide multiple functions to compose.");for(e=new Array(r),t=0;t1){if(i=nB(t,r),i)throw i;n=e}else n=r;if(!lo(n))throw new TypeError(Kt("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=iB),a;function a(u,s){if(!tB(u))throw new TypeError(Kt("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!lo(s))throw new TypeError(Kt("invalid argument. Last argument must be a function. Value: `%s`.",s));return aB(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}vo.exports=uB});var co=l(function(Jcr,mo){"use strict";var fo=Ut();function sB(r,e,t,i){if(arguments.length<4)return fo(e)(r,t);fo(e,t)(r,i)}mo.exports=sB});var po=l(function(Xcr,ho){"use strict";var oB=k(),go=co(),lB=Ut();oB(go,"factory",lB);ho.exports=go});var qo=l(function(Ycr,yo){"use strict";var zt=require("@stdlib/assert/is-function"),Gt=require("@stdlib/string/format");function vB(r,e,t,i){var n,a;if(!zt(r))throw new TypeError(Gt("invalid argument. First argument must be a function. Value: `%s`.",r));if(!zt(e))throw new TypeError(Gt("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!zt(t))throw new TypeError(Gt("invalid argument. Third argument must be a function. Value: `%s`.",t));n=[],a=0,r.call(i,a,u);function u(o){var v;if(o)return t(o);if(a+=1,arguments.length>1)for(n=new Array(arguments.length-1),v=1;v1)for(n=new Array(arguments.length-1),v=1;v1){if(i=_B(t,r),i)throw i;n=e}else n=r;if(!Fo(n))throw new TypeError(Ht("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bB),a;function a(u,s){if(!wB(u))throw new TypeError(Ht("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Fo(s))throw new TypeError(Ht("invalid argument. Last argument must be a function. Value: `%s`.",s));return xB(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}ko.exports=EB});var Lo=l(function(ngr,So){"use strict";var Io=Zt();function TB(r,e,t,i){if(arguments.length<4)return Io(e)(r,t);Io(e,t)(r,i)}So.exports=TB});var jo=l(function(agr,Ro){"use strict";var OB=k(),No=Lo(),PB=Zt();OB(No,"factory",PB);Ro.exports=No});var Bo=l(function(ugr,Co){"use strict";var AB=require("@stdlib/assert/is-plain-object"),ri=require("@stdlib/assert/has-own-property"),VB=require("@stdlib/assert/is-boolean").isPrimitive,FB=require("@stdlib/assert/is-positive-integer").isPrimitive,ei=require("@stdlib/string/format");function kB(r,e){return AB(e)?(ri(e,"thisArg")&&(r.thisArg=e.thisArg),ri(e,"series")&&(r.series=e.series,!VB(r.series))?new TypeError(ei("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ri(e,"limit")&&(r.limit=e.limit,!FB(r.limit))?new TypeError(ei("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ei("invalid argument. Options argument must be an object. Value: `%s`.",e))}Co.exports=kB});var Mo=l(function(sgr,Do){"use strict";var IB=require("debug"),wr=IB("every-by-right-async:limit");function SB(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,wr("Collection length: %d",s),s===0)return wr("Finished processing a collection."),i(null,!0);for(s0&&f();function f(){o-=1,wr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,wr("Encountered an error: %s",c.message),i(c);if(n+=1,wr("Processed %d of %d collection elements.",n,s),wr("Test result: %s",!!g),!g&&!a)return a=!0,wr("Finished processing a collection."),i(null,!1);if(o>0)return f();if(n===s)return wr("Finished processing a collection."),i(null,!0)}}}Do.exports=SB});var ii=l(function(ogr,Wo){"use strict";var $o=require("@stdlib/assert/is-function"),LB=require("@stdlib/assert/is-collection"),NB=require("@stdlib/constants/float64/pinf"),ti=require("@stdlib/string/format"),RB=Bo(),jB=Mo();function CB(r,e){var t,i,n;if(t={},arguments.length>1){if(i=RB(t,r),i)throw i;n=e}else n=r;if(!$o(n))throw new TypeError(ti("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=NB),a;function a(u,s){if(!LB(u))throw new TypeError(ti("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!$o(s))throw new TypeError(ti("invalid argument. Last argument must be a function. Value: `%s`.",s));return jB(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Wo.exports=CB});var zo=l(function(lgr,Uo){"use strict";var Ko=ii();function BB(r,e,t,i){if(arguments.length<4)return Ko(e)(r,t);Ko(e,t)(r,i)}Uo.exports=BB});var Jo=l(function(vgr,Qo){"use strict";var DB=k(),Go=zo(),MB=ii();DB(Go,"factory",MB);Qo.exports=Go});var Yo=l(function(fgr,Xo){"use strict";var $B=require("@stdlib/assert/is-plain-object"),ni=require("@stdlib/assert/has-own-property"),WB=require("@stdlib/assert/is-boolean").isPrimitive,KB=require("@stdlib/assert/is-positive-integer").isPrimitive,ai=require("@stdlib/string/format");function UB(r,e){return $B(e)?(ni(e,"thisArg")&&(r.thisArg=e.thisArg),ni(e,"series")&&(r.series=e.series,!WB(r.series))?new TypeError(ai("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ni(e,"limit")&&(r.limit=e.limit,!KB(r.limit))?new TypeError(ai("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ai("invalid argument. Options argument must be an object. Value: `%s`.",e))}Xo.exports=UB});var Zo=l(function(mgr,Ho){"use strict";var zB=require("debug"),Nr=zB("for-each-async:limit");function GB(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,Nr("Collection length: %d",o),o===0)return Nr("Finished processing a collection."),i();for(o1){if(i=XB(t,r),i)throw i;n=e}else n=r;if(!rl(n))throw new TypeError(ui("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=JB),a;function a(u,s){if(!QB(u))throw new TypeError(ui("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!rl(s))throw new TypeError(ui("invalid argument. Last argument must be a function. Value: `%s`.",s));return YB(u,t,n,o);function o(v){if(v)return s(v);s()}}}el.exports=HB});var nl=l(function(ggr,il){"use strict";var tl=si();function ZB(r,e,t,i){if(arguments.length<4)return tl(e)(r,t);tl(e,t)(r,i)}il.exports=ZB});var sl=l(function(hgr,ul){"use strict";var rD=k(),al=nl(),eD=si();rD(al,"factory",eD);ul.exports=al});var ll=l(function(pgr,ol){"use strict";var tD=require("@stdlib/assert/is-plain-object"),oi=require("@stdlib/assert/has-own-property"),iD=require("@stdlib/assert/is-boolean").isPrimitive,nD=require("@stdlib/assert/is-positive-integer").isPrimitive,li=require("@stdlib/string/format");function aD(r,e){return tD(e)?(oi(e,"thisArg")&&(r.thisArg=e.thisArg),oi(e,"series")&&(r.series=e.series,!iD(r.series))?new TypeError(li("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):oi(e,"limit")&&(r.limit=e.limit,!nD(r.limit))?new TypeError(li("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(li("invalid argument. Options argument must be an object. Value: `%s`.",e))}ol.exports=aD});var fl=l(function(dgr,vl){"use strict";var uD=require("debug"),Rr=uD("for-each-right-async:limit");function sD(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,Rr("Collection length: %d",s),s===0)return Rr("Finished processing a collection."),i();for(s0&&f();function f(){o-=1,Rr("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c){if(!a){if(c)return a=!0,Rr("Encountered an error: %s",c.message),i(c);if(n+=1,Rr("Processed %d of %d collection elements.",n,s),o>0)return f();if(n===s)return Rr("Finished processing a collection."),i()}}}vl.exports=sD});var fi=l(function(ygr,cl){"use strict";var ml=require("@stdlib/assert/is-function"),oD=require("@stdlib/assert/is-collection"),vi=require("@stdlib/string/format"),lD=require("@stdlib/constants/float64/pinf"),vD=ll(),fD=fl();function mD(r,e){var t,i,n;if(t={},arguments.length>1){if(i=vD(t,r),i)throw i;n=e}else n=r;if(!ml(n))throw new TypeError(vi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=lD),a;function a(u,s){if(!oD(u))throw new TypeError(vi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!ml(s))throw new TypeError(vi("invalid argument. Last argument must be a function. Value: `%s`.",s));return fD(u,t,n,o);function o(v){if(v)return s(v);s()}}}cl.exports=mD});var pl=l(function(qgr,hl){"use strict";var gl=fi();function cD(r,e,t,i){if(arguments.length<4)return gl(e)(r,t);gl(e,t)(r,i)}hl.exports=cD});var ql=l(function(wgr,yl){"use strict";var gD=k(),dl=pl(),hD=fi();gD(dl,"factory",hD);yl.exports=dl});var bl=l(function(bgr,wl){"use strict";var pD=require("@stdlib/assert/is-function"),dD=require("@stdlib/string/format");function yD(){var r,e,t;if(r=arguments.length,r<2)throw new Error("insufficient arguments. Must provide multiple functions to execute sequentially.");for(e=new Array(r),t=0;t1){if(i=VD(t,r),i)throw i;n=e}else n=r;if(!Vl(n))throw new TypeError(ci("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=AD),a;function a(u,s){if(!PD(u))throw new TypeError(ci("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Vl(s))throw new TypeError(ci("invalid argument. Last argument must be a function. Value: `%s`.",s));return FD(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}Fl.exports=kD});var Sl=l(function(Ogr,Il){"use strict";var kl=gi();function ID(r,e,t,i){if(arguments.length<4)return kl(e)(r,t);kl(e,t)(r,i)}Il.exports=ID});var Rl=l(function(Pgr,Nl){"use strict";var SD=k(),Ll=Sl(),LD=gi();SD(Ll,"factory",LD);Nl.exports=Ll});var Dl=l(function(Agr,Bl){"use strict";var jl=require("@stdlib/assert/is-function"),Cl=require("@stdlib/string/format");function ND(r,e,t,i){if(!jl(r))throw new TypeError(Cl("invalid argument. First argument must be a function. Value: `%s`.",r));if(!jl(i))throw new TypeError(Cl("invalid argument. Last argument must be a function. Value: `%s`.",i));r(n);function n(a,u){if(a)return i(a);if(u)return i(null,e);i(null,t)}}Bl.exports=ND});var $l=l(function(Vgr,Ml){"use strict";var RD=Dl();Ml.exports=RD});var Kl=l(function(Fgr,Wl){"use strict";var Me=require("@stdlib/assert/is-function"),$e=require("@stdlib/string/format");function jD(r,e,t,i){if(!Me(r))throw new TypeError($e("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Me(e))throw new TypeError($e("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!Me(t))throw new TypeError($e("invalid argument. Third argument must be a function. Value: `%s`.",t));if(!Me(i))throw new TypeError($e("invalid argument. Last argument must be a function. Value: `%s`.",i));r(n);function n(u,s){if(u)return i(u);if(s)return e(a);t(a)}function a(u){var s,o,v;if(u)return i(u);for(s=arguments.length,o=new Array(s),o[0]=null,v=1;v1){if(i=GD(t,r),i)throw i;n=e}else n=r;if(!Yl(n))throw new TypeError(di("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=zD),a;function a(u,s){if(!UD(u))throw new TypeError(di("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Yl(s))throw new TypeError(di("invalid argument. Last argument must be a function. Value: `%s`.",s));return QD(u,t,n,o);function o(v){if(v)return s(v,u);s(null,u)}}}Hl.exports=JD});var ev=l(function(Ngr,rv){"use strict";var Zl=yi();function XD(r,e,t,i){if(arguments.length<4)return Zl(e)(r,t);Zl(e,t)(r,i)}rv.exports=XD});var nv=l(function(Rgr,iv){"use strict";var YD=k(),tv=ev(),HD=yi();YD(tv,"factory",HD);iv.exports=tv});var uv=l(function(jgr,av){"use strict";var ZD=require("@stdlib/assert/is-plain-object"),qi=require("@stdlib/assert/has-own-property"),rM=require("@stdlib/assert/is-boolean").isPrimitive,eM=require("@stdlib/assert/is-positive-integer").isPrimitive,wi=require("@stdlib/string/format");function tM(r,e){return ZD(e)?(qi(e,"thisArg")&&(r.thisArg=e.thisArg),qi(e,"series")&&(r.series=e.series,!rM(r.series))?new TypeError(wi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):qi(e,"limit")&&(r.limit=e.limit,!eM(r.limit))?new TypeError(wi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(wi("invalid argument. Options argument must be an object. Value: `%s`.",e))}av.exports=tM});var ov=l(function(Cgr,sv){"use strict";var iM=require("debug"),Cr=iM("inmap-right-async:limit");function nM(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,Cr("Collection length: %d",s),s===0)return Cr("Finished processing a collection."),i();for(s0&&f();function f(){var c;o-=1,c=o,Cr("Collection element %d: %s.",c,JSON.stringify(r[c])),t.length===2?t.call(e.thisArg,r[c],g):t.length===3?t.call(e.thisArg,r[c],c,g):t.call(e.thisArg,r[c],c,r,g);function g(h,y){if(!a){if(h)return a=!0,m(h);r[c]=y,m()}}}function m(c){if(c)return Cr("Encountered an error: %s",c.message),i(c);if(n+=1,Cr("Processed %d of %d collection elements.",n,s),o>0)return f();if(n===s)return Cr("Finished processing a collection."),i()}}sv.exports=nM});var _i=l(function(Bgr,vv){"use strict";var lv=require("@stdlib/assert/is-function"),aM=require("@stdlib/assert/is-collection"),bi=require("@stdlib/string/format"),uM=require("@stdlib/constants/float64/pinf"),sM=uv(),oM=ov();function lM(r,e){var t,i,n;if(t={},arguments.length>1){if(i=sM(t,r),i)throw i;n=e}else n=r;if(!lv(n))throw new TypeError(bi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=uM),a;function a(u,s){if(!aM(u))throw new TypeError(bi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!lv(s))throw new TypeError(bi("invalid argument. Last argument must be a function. Value: `%s`.",s));return oM(u,t,n,o);function o(v){if(v)return s(v,u);s(null,u)}}}vv.exports=lM});var cv=l(function(Dgr,mv){"use strict";var fv=_i();function vM(r,e,t,i){if(arguments.length<4)return fv(e)(r,t);fv(e,t)(r,i)}mv.exports=vM});var pv=l(function(Mgr,hv){"use strict";var fM=k(),gv=cv(),mM=_i();fM(gv,"factory",mM);hv.exports=gv});var yv=l(function($gr,dv){"use strict";var cM=require("@stdlib/assert/is-plain-object"),xi=require("@stdlib/assert/has-own-property"),gM=require("@stdlib/assert/is-boolean").isPrimitive,hM=require("@stdlib/assert/is-positive-integer").isPrimitive,Ei=require("@stdlib/string/format");function pM(r,e){return cM(e)?(xi(e,"thisArg")&&(r.thisArg=e.thisArg),xi(e,"series")&&(r.series=e.series,!gM(r.series))?new TypeError(Ei("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):xi(e,"limit")&&(r.limit=e.limit,!hM(r.limit))?new TypeError(Ei("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ei("invalid argument. Options argument must be an object. Value: `%s`.",e))}dv.exports=pM});var wv=l(function(Wgr,qv){"use strict";var dM=require("debug"),Gr=dM("map-function-async:limit");function yM(r,e,t,i){var n,a,u,s,o,v,f;if(Gr("Number of invocations: %d",r),u=new Array(r),r===0)return Gr("Finished invoking a function."),i(null,u);for(r1){if(i=bM(t,r),i)throw i;n=e}else n=r;if(!bv(n))throw new TypeError(Ti("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=wM),a;function a(u,s){if(!qM(u))throw new TypeError(Ti("invalid argument. Number of function invocations must be a nonnegative integer. Value: `%s`.",u));if(!bv(s))throw new TypeError(Ti("invalid argument. Last argument must be a function. Value: `%s`.",s));return _M(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}_v.exports=xM});var Tv=l(function(Ugr,Ev){"use strict";var xv=Oi();function EM(r,e,t,i){if(arguments.length<4)return xv(r)(e,t);xv(t,r)(e,i)}Ev.exports=EM});var Av=l(function(zgr,Pv){"use strict";var TM=k(),Ov=Tv(),OM=Oi();TM(Ov,"factory",OM);Pv.exports=Ov});var Fv=l(function(Ggr,Vv){"use strict";var PM=require("@stdlib/assert/is-plain-object"),Pi=require("@stdlib/assert/has-own-property"),AM=require("@stdlib/assert/is-boolean").isPrimitive,VM=require("@stdlib/assert/is-positive-integer").isPrimitive,Ai=require("@stdlib/string/format");function FM(r,e){return PM(e)?(Pi(e,"thisArg")&&(r.thisArg=e.thisArg),Pi(e,"series")&&(r.series=e.series,!AM(r.series))?new TypeError(Ai("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Pi(e,"limit")&&(r.limit=e.limit,!VM(r.limit))?new TypeError(Ai("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ai("invalid argument. Options argument must be an object. Value: `%s`.",e))}Vv.exports=FM});var We=l(function(Qgr,kv){"use strict";function kM(r){return Object.keys(Object(r))}kv.exports=kM});var Sv=l(function(Jgr,Iv){"use strict";var IM=We();function SM(){return(IM(arguments)||"").length!==2}function LM(){return SM(1,2)}Iv.exports=LM});var Nv=l(function(Xgr,Lv){"use strict";var NM=typeof Object.keys!="undefined";Lv.exports=NM});var Cv=l(function(Ygr,jv){"use strict";var RM=require("@stdlib/assert/is-arguments"),Rv=We(),jM=Array.prototype.slice;function CM(r){return RM(r)?Rv(jM.call(r)):Rv(r)}jv.exports=CM});var Dv=l(function(Hgr,Bv){"use strict";function BM(){}Bv.exports=BM});var Ke=l(function(Zgr,Mv){"use strict";var DM=Dv();Mv.exports=DM});var Wv=l(function(rhr,$v){"use strict";var MM=require("@stdlib/assert/is-enumerable-property"),$M=Ke(),WM=MM($M,"prototype");$v.exports=WM});var Uv=l(function(ehr,Kv){"use strict";var KM=require("@stdlib/assert/is-enumerable-property"),UM={toString:null},zM=!KM(UM,"toString");Kv.exports=zM});var Gv=l(function(thr,zv){"use strict";var GM=/./;zv.exports=GM});var Jv=l(function(ihr,Qv){"use strict";function QM(){return new Function("return this;")()}Qv.exports=QM});var Yv=l(function(nhr,Xv){"use strict";var JM=typeof self=="object"?self:null;Xv.exports=JM});var Zv=l(function(ahr,Hv){"use strict";var XM=typeof window=="object"?window:null;Hv.exports=XM});var ef=l(function(uhr,rf){"use strict";var YM=typeof global=="object"?global:null;rf.exports=YM});var nf=l(function(shr,tf){"use strict";var HM=typeof globalThis=="object"?globalThis:null;tf.exports=HM});var vf=l(function(ohr,lf){"use strict";var ZM=require("@stdlib/assert/is-boolean").isPrimitive,r$=require("@stdlib/string/format"),e$=Jv(),af=Yv(),uf=Zv(),sf=ef(),of=nf();function t$(r){if(arguments.length){if(!ZM(r))throw new TypeError(r$("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return e$()}if(of)return of;if(af)return af;if(uf)return uf;if(sf)return sf;throw new Error("unexpected error. Unable to resolve global object.")}lf.exports=t$});var Vi=l(function(lhr,ff){"use strict";var i$=vf();ff.exports=i$});var gf=l(function(vhr,cf){"use strict";var n$=Vi(),mf=n$(),a$=mf.document&&mf.document.childNodes;cf.exports=a$});var pf=l(function(fhr,hf){"use strict";var u$=Int8Array;hf.exports=u$});var yf=l(function(mhr,df){"use strict";var s$=Gv(),o$=gf(),l$=pf();function v$(){return typeof s$=="function"||typeof l$=="object"||typeof o$=="function"}df.exports=v$});var Fi=l(function(chr,qf){"use strict";var f$=Object.prototype.toString;qf.exports=f$});var bf=l(function(ghr,wf){"use strict";var m$=Fi();function c$(r){return m$.call(r)}wf.exports=c$});var Ef=l(function(hhr,xf){"use strict";var _f=require("@stdlib/symbol/ctor"),g$=typeof _f=="function"?_f.toStringTag:"";xf.exports=g$});var Of=l(function(phr,Tf){"use strict";var h$=require("@stdlib/assert/has-own-property"),we=Ef(),ki=Fi();function p$(r){var e,t,i;if(r==null)return ki.call(r);t=r[we],e=h$(r,we);try{r[we]=void 0}catch(n){return ki.call(r)}return i=ki.call(r),e?r[we]=t:delete r[we],i}Tf.exports=p$});var Ue=l(function(dhr,Pf){"use strict";var d$=require("@stdlib/assert/has-tostringtag-support"),y$=bf(),q$=Of(),Ii;d$()?Ii=q$:Ii=y$;Pf.exports=Ii});var Vf=l(function(yhr,Af){"use strict";var w$=Ue(),b$=require("@stdlib/regexp/function-name").REGEXP,_$=require("@stdlib/assert/is-buffer");function x$(r){var e,t,i;if(t=w$(r).slice(8,-1),(t==="Object"||t==="Error")&&r.constructor){if(i=r.constructor,typeof i.name=="string")return i.name;if(e=b$.exec(i.toString()),e)return e[1]}return _$(r)?"Buffer":t}Af.exports=x$});var ze=l(function(qhr,Ff){"use strict";var E$=Vf();Ff.exports=E$});var If=l(function(whr,kf){"use strict";var T$=ze();function O$(r){var e;return r===null?"null":(e=typeof r,e==="object"?T$(r).toLowerCase():e)}kf.exports=O$});var Lf=l(function(bhr,Sf){"use strict";var P$=ze();function A$(r){return P$(r).toLowerCase()}Sf.exports=A$});var be=l(function(_hr,Nf){"use strict";var V$=yf(),F$=If(),k$=Lf(),I$=V$()?k$:F$;Nf.exports=I$});var Si=l(function(xhr,Rf){"use strict";function S$(r){return r.constructor&&r.constructor.prototype===r}Rf.exports=S$});var jf=l(function(Ehr,L$){L$.exports=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"]});var Bf=l(function(Thr,Cf){"use strict";var N$=typeof window=="undefined"?void 0:window;Cf.exports=N$});var Wf=l(function(Ohr,$f){"use strict";var R$=require("@stdlib/assert/has-own-property"),j$=H(),Df=be(),C$=Si(),B$=jf(),ne=Bf(),Mf;function D$(){var r;if(Df(ne)==="undefined")return!1;for(r in ne)try{j$(B$,r)===-1&&R$(ne,r)&&ne[r]!==null&&Df(ne[r])==="object"&&C$(ne[r])}catch(e){return!0}return!1}Mf=D$();$f.exports=Mf});var Uf=l(function(Phr,Kf){"use strict";var M$=typeof window!="undefined";Kf.exports=M$});var Qf=l(function(Ahr,Gf){"use strict";var $$=Wf(),zf=Si(),W$=Uf();function K$(r){if(W$===!1&&!$$)return zf(r);try{return zf(r)}catch(e){return!1}}Gf.exports=K$});var Jf=l(function(Vhr,U$){U$.exports=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]});var Hf=l(function(Fhr,Yf){"use strict";var z$=require("@stdlib/assert/is-object-like"),Li=require("@stdlib/assert/has-own-property"),G$=require("@stdlib/assert/is-arguments"),Q$=Wv(),J$=Uv(),X$=Qf(),Xf=Jf();function Y$(r){var e,t,i,n,a,u,s;if(n=[],G$(r)){for(s=0;s0&&!Li(r,"0"))for(s=0;s %s: %s",P,JSON.stringify(y)),m[P]=y,h()}}}function h(y){if(y)return Vr("Encountered an error: %s",y.message),i(y);if(a+=1,Vr("Processed %d of %d properties.",a,v),f1){if(i=oW(t,r),i)throw i;n=e}else n=r;if(!nm(n))throw new TypeError(Ni("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=sW),a;function a(u,s){if(typeof u!="object"||u===null)throw new TypeError(Ni("invalid argument. First argument must be an object. Value: `%s`.",u));if(!nm(s))throw new TypeError(Ni("invalid argument. Last argument must be a function. Value: `%s`.",s));return lW(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}am.exports=vW});var om=l(function(Nhr,sm){"use strict";var um=Ri();function fW(r,e,t,i){if(arguments.length<4)return um(e)(r,t);um(e,t)(r,i)}sm.exports=fW});var fm=l(function(Rhr,vm){"use strict";var mW=k(),lm=om(),cW=Ri();mW(lm,"factory",cW);vm.exports=lm});var cm=l(function(jhr,mm){"use strict";var gW=require("@stdlib/assert/is-plain-object"),ji=require("@stdlib/assert/has-own-property"),hW=require("@stdlib/assert/is-boolean").isPrimitive,pW=require("@stdlib/assert/is-positive-integer").isPrimitive,Ci=require("@stdlib/string/format");function dW(r,e){return gW(e)?(ji(e,"thisArg")&&(r.thisArg=e.thisArg),ji(e,"series")&&(r.series=e.series,!hW(r.series))?new TypeError(Ci("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):ji(e,"limit")&&(r.limit=e.limit,!pW(r.limit))?new TypeError(Ci("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Ci("invalid argument. Options argument must be an object. Value: `%s`.",e))}mm.exports=dW});var hm=l(function(Chr,gm){"use strict";var yW=require("debug"),qW=z(),Fr=yW("map-values-async:limit");function wW(r,e,t,i){var n,a,u,s,o,v,f,m,c;if(u=qW(r),v=u.length,Fr("Number of keys: %d",v),m={},v===0)return Fr("Finished processing an object."),i(null,m);for(v %s: %s",y,JSON.stringify(E)),m[y]=E,h()}}}function h(y){if(y)return Fr("Encountered an error: %s",y.message),i(y);if(a+=1,Fr("Processed %d of %d properties.",a,v),f1){if(i=_W(t,r),i)throw i;n=e}else n=r;if(!pm(n))throw new TypeError(Bi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bW),a;function a(u,s){if(typeof u!="object"||u===null)throw new TypeError(Bi("invalid argument. First argument must be an object. Value: `%s`.",u));if(!pm(s))throw new TypeError(Bi("invalid argument. Last argument must be a function. Value: `%s`.",s));return xW(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}dm.exports=EW});var wm=l(function(Dhr,qm){"use strict";var ym=Di();function TW(r,e,t,i){if(arguments.length<4)return ym(e)(r,t);ym(e,t)(r,i)}qm.exports=TW});var xm=l(function(Mhr,_m){"use strict";var OW=k(),bm=wm(),PW=Di();OW(bm,"factory",PW);_m.exports=bm});var Tm=l(function($hr,Em){"use strict";var AW=require("@stdlib/assert/is-plain-object"),Mi=require("@stdlib/assert/has-own-property"),VW=require("@stdlib/assert/is-boolean").isPrimitive,FW=require("@stdlib/assert/is-positive-integer").isPrimitive,$i=require("@stdlib/string/format");function kW(r,e){return AW(e)?(Mi(e,"thisArg")&&(r.thisArg=e.thisArg),Mi(e,"series")&&(r.series=e.series,!VW(r.series))?new TypeError($i("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Mi(e,"limit")&&(r.limit=e.limit,!FW(r.limit))?new TypeError($i("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError($i("invalid argument. Options argument must be an object. Value: `%s`.",e))}Em.exports=kW});var Pm=l(function(Whr,Om){"use strict";var IW=require("debug"),br=IW("none-by-async:limit");function SW(r,e,t,i){var n,a,u,s,o,v,f;if(o=r.length,br("Collection length: %d",o),o===0)return br("Finished processing a collection."),i(null,!0);for(o1){if(i=RW(t,r),i)throw i;n=e}else n=r;if(!Am(n))throw new TypeError(Wi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=NW),a;function a(u,s){if(!LW(u))throw new TypeError(Wi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Am(s))throw new TypeError(Wi("invalid argument. Last argument must be a function. Value: `%s`.",s));return jW(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Vm.exports=CW});var Im=l(function(Uhr,km){"use strict";var Fm=Ki();function BW(r,e,t,i){if(arguments.length<4)return Fm(e)(r,t);Fm(e,t)(r,i)}km.exports=BW});var Nm=l(function(zhr,Lm){"use strict";var DW=k(),Sm=Im(),MW=Ki();DW(Sm,"factory",MW);Lm.exports=Sm});var jm=l(function(Ghr,Rm){"use strict";var $W=require("@stdlib/assert/is-plain-object"),Ui=require("@stdlib/assert/has-own-property"),WW=require("@stdlib/assert/is-boolean").isPrimitive,KW=require("@stdlib/assert/is-positive-integer").isPrimitive,zi=require("@stdlib/string/format");function UW(r,e){return $W(e)?(Ui(e,"thisArg")&&(r.thisArg=e.thisArg),Ui(e,"series")&&(r.series=e.series,!WW(r.series))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Ui(e,"limit")&&(r.limit=e.limit,!KW(r.limit))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}Rm.exports=UW});var Bm=l(function(Qhr,Cm){"use strict";var zW=require("debug"),_r=zW("none-by-right-async:limit");function GW(r,e,t,i){var n,a,u,s,o,v;if(s=r.length,_r("Collection length: %d",s),s===0)return _r("Finished processing a collection."),i(null,!0);for(s0&&f();function f(){o-=1,_r("Collection element %d: %s.",o,JSON.stringify(r[o])),t.length===2?t.call(e.thisArg,r[o],m):t.length===3?t.call(e.thisArg,r[o],o,m):t.call(e.thisArg,r[o],o,r,m)}function m(c,g){if(!a){if(c)return a=!0,_r("Encountered an error: %s",c.message),i(c);if(n+=1,_r("Processed %d of %d collection elements.",n,s),_r("Test result: %s",!!g),g&&!a)return a=!0,_r("Finished processing a collection."),i(null,!1);if(o>0)return f();if(n===s)return _r("Finished processing a collection."),i(null,!0)}}}Cm.exports=GW});var Qi=l(function(Jhr,Mm){"use strict";var Dm=require("@stdlib/assert/is-function"),QW=require("@stdlib/assert/is-collection"),Gi=require("@stdlib/string/format"),JW=require("@stdlib/constants/float64/pinf"),XW=jm(),YW=Bm();function HW(r,e){var t,i,n;if(t={},arguments.length>1){if(i=XW(t,r),i)throw i;n=e}else n=r;if(!Dm(n))throw new TypeError(Gi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=JW),a;function a(u,s){if(!QW(u))throw new TypeError(Gi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Dm(s))throw new TypeError(Gi("invalid argument. Last argument must be a function. Value: `%s`.",s));return YW(u,t,n,o);function o(v,f){if(v)return s(v,!1);s(null,f)}}}Mm.exports=HW});var Km=l(function(Xhr,Wm){"use strict";var $m=Qi();function ZW(r,e,t,i){if(arguments.length<4)return $m(e)(r,t);$m(e,t)(r,i)}Wm.exports=ZW});var Gm=l(function(Yhr,zm){"use strict";var r3=k(),Um=Km(),e3=Qi();r3(Um,"factory",e3);zm.exports=Um});var Jm=l(function(Hhr,Qm){"use strict";var t3=require("@stdlib/assert/is-plain-object"),Ji=require("@stdlib/assert/has-own-property"),i3=require("@stdlib/assert/is-boolean").isPrimitive,n3=require("@stdlib/assert/is-positive-integer").isPrimitive,Xi=require("@stdlib/string/format");function a3(r,e){return t3(e)?(Ji(e,"thisArg")&&(r.thisArg=e.thisArg),Ji(e,"series")&&(r.series=e.series,!i3(r.series))?new TypeError(Xi("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Ji(e,"limit")&&(r.limit=e.limit,!n3(r.limit))?new TypeError(Xi("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(Xi("invalid argument. Options argument must be an object. Value: `%s`.",e))}Qm.exports=a3});var Ym=l(function(Zhr,Xm){"use strict";var u3=require("debug"),kr=u3("reduce-async:limit");function s3(r,e,t,i,n){var a,u,s,o,v,f,m;if(v=r.length,kr("Collection length: %d",v),v===0)return kr("Finished processing a collection."),n(null,e);for(v1){if(i=v3(t,r),i)throw i;n=e}else n=r;if(!Hm(n))throw new TypeError(Yi("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series===void 0&&t.limit===void 0&&(t.series=!0),t.series?t.limit=1:t.limit||(t.limit=l3),a;function a(u,s,o){if(!o3(u))throw new TypeError(Yi("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Hm(o))throw new TypeError(Yi("invalid argument. Last argument must be a function. Value: `%s`.",o));return f3(u,s,t,n,v);function v(f,m){if(f)return o(f);o(null,m)}}}Zm.exports=m3});var tc=l(function(epr,ec){"use strict";var rc=Hi();function c3(r,e,t,i,n){if(arguments.length<5)return rc(t)(r,e,i);rc(t,i)(r,e,n)}ec.exports=c3});var ac=l(function(tpr,nc){"use strict";var g3=k(),ic=tc(),h3=Hi();g3(ic,"factory",h3);nc.exports=ic});var sc=l(function(ipr,uc){"use strict";var p3=require("@stdlib/assert/is-plain-object"),Zi=require("@stdlib/assert/has-own-property"),d3=require("@stdlib/assert/is-boolean").isPrimitive,y3=require("@stdlib/assert/is-positive-integer").isPrimitive,rn=require("@stdlib/string/format");function q3(r,e){return p3(e)?(Zi(e,"thisArg")&&(r.thisArg=e.thisArg),Zi(e,"series")&&(r.series=e.series,!d3(r.series))?new TypeError(rn("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):Zi(e,"limit")&&(r.limit=e.limit,!y3(r.limit))?new TypeError(rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uc.exports=q3});var lc=l(function(npr,oc){"use strict";var w3=require("debug"),Ir=w3("reduce-right-async:limit");function b3(r,e,t,i,n){var a,u,s,o,v,f;if(o=r.length,Ir("Collection length: %d",o),o===0)return Ir("Finished processing a collection."),n(null,e);for(o0&&m();function m(){v-=1,Ir("Collection element %d: %s.",v,JSON.stringify(r[v])),i.length===3?i.call(t.thisArg,e,r[v],g):i.length===4?i.call(t.thisArg,e,r[v],v,g):i.call(t.thisArg,e,r[v],v,r,g);function g(h,y){if(!u){if(h)return u=!0,c(h);Ir("Accumulator: %s",JSON.stringify(y)),e=y,c()}}}function c(g){if(g)return Ir("Encountered an error: %s",g.message),n(g);if(a+=1,Ir("Processed %d of %d collection elements.",a,o),v>0)return m();if(a===o)return Ir("Finished processing a collection."),n(null,e)}}oc.exports=b3});var tn=l(function(apr,fc){"use strict";var vc=require("@stdlib/assert/is-function"),_3=require("@stdlib/assert/is-collection"),en=require("@stdlib/string/format"),x3=require("@stdlib/constants/float64/pinf"),E3=sc(),T3=lc();function O3(r,e){var t,i,n;if(t={},arguments.length>1){if(i=E3(t,r),i)throw i;n=e}else n=r;if(!vc(n))throw new TypeError(en("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series===void 0&&t.limit===void 0&&(t.series=!0),t.series?t.limit=1:t.limit||(t.limit=x3),a;function a(u,s,o){if(!_3(u))throw new TypeError(en("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!vc(o))throw new TypeError(en("invalid argument. Last argument must be a function. Value: `%s`.",o));return T3(u,s,t,n,v);function v(f,m){if(f)return o(f);o(null,m)}}}fc.exports=O3});var gc=l(function(upr,cc){"use strict";var mc=tn();function P3(r,e,t,i,n){if(arguments.length<5)return mc(t)(r,e,i);mc(t,i)(r,e,n)}cc.exports=P3});var dc=l(function(spr,pc){"use strict";var A3=k(),hc=gc(),V3=tn();A3(hc,"factory",V3);pc.exports=hc});var nn=l(function(opr,qc){"use strict";var F3=require("@stdlib/assert/is-function-array"),k3=require("@stdlib/assert/is-function"),yc=require("@stdlib/string/format");function I3(r,e,t){if(!F3(r))throw new TypeError(yc("invalid argument. First argument must be an array of functions. Value: `%s`.",r));if(!k3(e))throw new TypeError(yc("invalid argument. Second argument must be a function. Value: `%s`.",e));return i;function i(){var n=-1;a();function a(){var u,s,o;if(arguments[0])return e(arguments[0]);if(n+=1,n>=r.length)return e();for(s=arguments.length,u=new Array(s),o=0;o1){if(i=z3(t,r),i)throw i;n=e}else n=r;if(!Vc(n))throw new TypeError(Qe("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=U3),a;function a(u,s,o){if(!W3(u))throw new TypeError(Qe("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!K3(s))throw new TypeError(Qe("invalid argument. Second argument must be a positive integer. Value: `%s`.",s));if(!Vc(o))throw new TypeError(Qe("invalid argument. Last argument must be a function. Value: `%s`.",o));return G3(u,s,t,n,v);function v(f,m){if(f)return o(f,!1);o(null,m)}}}Fc.exports=Q3});var Sc=l(function(gpr,Ic){"use strict";var kc=sn();function J3(r,e,t,i,n){if(arguments.length<5)return kc(t)(r,e,i);kc(t,i)(r,e,n)}Ic.exports=J3});var Rc=l(function(hpr,Nc){"use strict";var X3=k(),Lc=Sc(),Y3=sn();X3(Lc,"factory",Y3);Nc.exports=Lc});var Cc=l(function(ppr,jc){"use strict";var H3=require("@stdlib/assert/is-plain-object"),on=require("@stdlib/assert/has-own-property"),Z3=require("@stdlib/assert/is-boolean").isPrimitive,rK=require("@stdlib/assert/is-positive-integer").isPrimitive,ln=require("@stdlib/string/format");function eK(r,e){return H3(e)?(on(e,"thisArg")&&(r.thisArg=e.thisArg),on(e,"series")&&(r.series=e.series,!Z3(r.series))?new TypeError(ln("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):on(e,"limit")&&(r.limit=e.limit,!rK(r.limit))?new TypeError(ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}jc.exports=eK});var Dc=l(function(dpr,Bc){"use strict";var tK=require("debug"),Er=tK("some-by-right-async:limit");function iK(r,e,t,i,n){var a,u,s,o,v,f,m;if(o=r.length,Er("Collection length: %d",o),o===0)return Er("Finished processing a collection."),n(null,!1);for(o0&&c();function c(){v-=1,Er("Collection element %d: %s.",v,JSON.stringify(r[v])),i.length===2?i.call(t.thisArg,r[v],g):i.length===3?i.call(t.thisArg,r[v],v,g):i.call(t.thisArg,r[v],v,r,g)}function g(h,y){if(!u){if(h)return u=!0,Er("Encountered an error: %s",h.message),n(h);if(a+=1,Er("Processed %d of %d collection elements.",a,o),Er("Test result: %s",!!y),y&&!u&&(f+=1,f===e))return u=!0,Er("Finished processing a collection."),n(null,!0);if(v>0)return c();if(a===o)return Er("Finished processing a collection."),n(null,!1)}}}Bc.exports=iK});var vn=l(function(ypr,$c){"use strict";var Mc=require("@stdlib/assert/is-function"),nK=require("@stdlib/assert/is-positive-integer").isPrimitive,aK=require("@stdlib/assert/is-collection"),Je=require("@stdlib/string/format"),uK=require("@stdlib/constants/float64/pinf"),sK=Cc(),oK=Dc();function lK(r,e){var t,i,n;if(t={},arguments.length>1){if(i=sK(t,r),i)throw i;n=e}else n=r;if(!Mc(n))throw new TypeError(Je("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=uK),a;function a(u,s,o){if(!aK(u))throw new TypeError(Je("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!nK(s))throw new TypeError(Je("invalid argument. Second argument must be a positive integer. Value: `%s`.",s));if(!Mc(o))throw new TypeError(Je("invalid argument. Last argument must be a function. Value: `%s`.",o));return oK(u,s,t,n,v);function v(f,m){if(f)return o(f,!1);o(null,m)}}}$c.exports=lK});var Uc=l(function(qpr,Kc){"use strict";var Wc=vn();function vK(r,e,t,i,n){if(arguments.length<5)return Wc(t)(r,e,i);Wc(t,i)(r,e,n)}Kc.exports=vK});var Qc=l(function(wpr,Gc){"use strict";var fK=k(),zc=Uc(),mK=vn();fK(zc,"factory",mK);Gc.exports=zc});var Xc=l(function(bpr,Jc){"use strict";var cK=require("@stdlib/assert/is-plain-object"),fn=require("@stdlib/assert/has-own-property"),gK=require("@stdlib/assert/is-boolean").isPrimitive,hK=require("@stdlib/assert/is-positive-integer").isPrimitive,mn=require("@stdlib/string/format");function pK(r,e){return cK(e)?(fn(e,"thisArg")&&(r.thisArg=e.thisArg),fn(e,"series")&&(r.series=e.series,!gK(r.series))?new TypeError(mn("invalid option. `%s` option must be a boolean. Option: `%s`.","series",r.series)):fn(e,"limit")&&(r.limit=e.limit,!hK(r.limit))?new TypeError(mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","limit",r.limit)):null):new TypeError(mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Jc.exports=pK});var Hc=l(function(_pr,Yc){"use strict";var dK=require("debug"),yK=H(),Sr=dK("tabulate-by-async:limit");function qK(r,e,t,i){var n,a,u,s,o,v,f,m,c;if(o=r.length,Sr("Collection length: %d",o),f=[],o===0)return Sr("Finished processing a collection."),i(null,f);for(m=[],o1){if(i=_K(t,r),i)throw i;n=e}else n=r;if(!Zc(n))throw new TypeError(cn("invalid argument. Last argument must be a function. Value: `%s`.",n));return t.series?t.limit=1:t.limit||(t.limit=bK),a;function a(u,s){if(!wK(u))throw new TypeError(cn("invalid argument. First argument must be a collection. Value: `%s`.",u));if(!Zc(s))throw new TypeError(cn("invalid argument. Last argument must be a function. Value: `%s`.",s));return xK(u,t,n,o);function o(v,f){if(v)return s(v);s(null,f)}}}rg.exports=EK});var ig=l(function(Epr,tg){"use strict";var eg=gn();function TK(r,e,t,i){if(arguments.length<4)return eg(e)(r,t);eg(e,t)(r,i)}tg.exports=TK});var ug=l(function(Tpr,ag){"use strict";var OK=k(),ng=ig(),PK=gn();OK(ng,"factory",PK);ag.exports=ng});var vg=l(function(Opr,lg){"use strict";var sg=require("@stdlib/assert/is-function"),og=require("@stdlib/string/format");function AK(r,e,t){if(!sg(r))throw new TypeError(og("invalid argument. First argument must be a function. Value: `%s`.",r));if(!sg(t))throw new TypeError(og("invalid argument. Last argument must be a function. Value: `%s`.",t));r(i);function i(n,a){if(n)return t(n,e);t(null,a)}}lg.exports=AK});var mg=l(function(Ppr,fg){"use strict";var VK=vg();fg.exports=VK});var gg=l(function(Apr,cg){"use strict";var hn=require("@stdlib/assert/is-function"),pn=require("@stdlib/string/format");function FK(r,e,t){if(!hn(r))throw new TypeError(pn("invalid argument. First argument must be a function. Value: `%s`.",r));if(!hn(e))throw new TypeError(pn("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!hn(t))throw new TypeError(pn("invalid argument. Last argument must be a function. Value: `%s`.",t));r(i);function i(a){var u,s,o;if(a)return e.length===1?e(n):e(a,n);for(u=arguments.length,s=new Array(u),s[0]=null,o=1;o1)for(n=new Array(arguments.length-1),v=1;v1)for(n=new Array(arguments.length-1),v=1;va?{done:!0}:i._count!==i._length?(n=!0,{done:!0}):(s=(s+1)%i._length,{value:i._buffer.accessors[0](i._buffer.data,s),done:!1})}function v(m){return n=!0,arguments.length?{value:m,done:!0}:{done:!0}}function f(){return i.iterator(a)}});bn(cr.prototype,"length",function(){return this._length});Br(cr.prototype,"push",function(e){var t,i,n,a;if(n=this._buffer.data,i=this._buffer.accessors[0],t=this._buffer.accessors[1],this._i=(this._i+1)%this._length,this._count>e&1)}cp.exports=bz});var pp=l(function(bdr,hp){"use strict";function _z(r,e){return r>>e&1}hp.exports=_z});var xp=l(function(_dr,_p){"use strict";var lr=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xe=require("@stdlib/assert/is-array-like-object"),dp=require("@stdlib/assert/is-collection"),Dr=require("@stdlib/assert/is-function"),yp=require("@stdlib/assert/is-object"),xz=require("@stdlib/assert/has-iterator-symbol-support"),Ye=require("@stdlib/symbol/iterator"),vr=k(),En=Tr(),qp=require("@stdlib/array/int32"),Ez=require("@stdlib/array/int8"),R=require("@stdlib/string/format"),Tz=require("@stdlib/math/base/special/ceil"),Oz=require("@stdlib/math/base/special/floor"),Pz=require("@stdlib/blas/ext/base/grev"),Az=tp(),Vz=np(),Fz=up(),kz=op(),Iz=vp(),Sz=mp(),Mr=gp(),wp=pp(),bp=xz(),xn=qp.BYTES_PER_ELEMENT*8;function X(r){if(!(this instanceof X))return new X(r);if(!lr(r))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));return this._N=r,this._M=0,this._buffer=new qp(Tz(r*r/xn)),this}vr(X,"fromAdjacencyList",function(e){var t,i,n,a,u,s,o,v,f,m;if(!Dr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(this!==X)throw new TypeError("invalid invocation. `this` is not a compact adjacency matrix.");if(i=arguments.length,i>1){if(a=arguments[1],!Dr(a))throw new TypeError(R("invalid argument. Second argument must be a function. Value: `%s`.",a));i>2&&(t=arguments[2])}if(Xe(e)){if(v=e.length,u=new this(v),a){for(f=0;f2){if(a=arguments[2],!Dr(a))throw new TypeError(R("invalid argument. Third argument must be a function. Value: `%s`.",a));n>3&&(i=arguments[3])}if(!lr(e))throw new TypeError(R("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(Xe(t)){if(a){for(s=new this(e),f=0;f=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])===!1&&(this._buffer[i[0]]=Iz(this._buffer[i[0]],i[1]),this._M+=1),this});En(X.prototype,"edges",function(){var e,t,i,n;for(e=[],t=[0,0],i=0;i=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])});vr(X.prototype,"inDegree",function(e){var t,i,n;if(!lr(e))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(e>=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=0,i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=[],i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=0,i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.",e));for(t=[],i=[0,0],n=0;n=this._N)throw new RangeError(R("invalid argument. First argument exceeds matrix dimensions. Value: `%u`.",e));if(t>=this._N)throw new RangeError(R("invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.",t));return i=this._loc(e,t,[0,0]),Mr(this._buffer[i[0]],i[1])&&(this._buffer[i[0]]=Sz(this._buffer[i[0]],i[1]),this._M-=1),this});vr(X.prototype,"toAdjacencyList",function(){var e,t,i,n,a;for(e=[],t=[0,0],n=0;n=0;a--)n=e[a](n);return n}}Op.exports=jz});var Vp=l(function(Tdr,Ap){"use strict";var Cz=Pp();Ap.exports=Cz});var kp=l(function(Odr,Fp){"use strict";function Bz(r){return e;function e(){return r}}Fp.exports=Bz});var Sp=l(function(Pdr,Ip){"use strict";var Dz=kp();Ip.exports=Dz});var Rp=l(function(Adr,Np){"use strict";var Lp=require("@stdlib/assert/is-string").isPrimitive,Mz=require("@stdlib/regexp/extended-length-path"),$z=require("@stdlib/string/base/lowercase"),Qr=require("@stdlib/string/replace"),He=require("@stdlib/string/format"),Ze=/^([A-Za-z]):[\\\/]+/,rt=/^\/([A-Za-z])\//;function Wz(r,e){var t,i,n;if(!Lp(r))throw new TypeError(He("invalid argument. First argument must be a string. Value: `%s`.",r));if(!Lp(e))throw new TypeError(He("invalid argument. Second argument must be a string. Value: `%s`.",e));if(e!=="win32"&&e!=="mixed"&&e!=="posix")throw new Error(He("invalid argument. Second argument must be a recognized output path convention. Value: `%s`.",e));if(n=r,e==="win32")return i=rt.exec(n),i&&(t=i[1]+":\\",n=Qr(n,rt,t)),Qr(n,"/","\\");if(Mz.REGEXP.test(r))throw new Error(He("invalid argument. Cannot convert Windows extended-length paths to POSIX paths. Value: `%s`.",r));return e==="mixed"?(i=rt.exec(n),i?(t=i[1]+":/",n=Qr(n,rt,t)):(i=Ze.exec(n),i&&(t=i[1]+":/",n=Qr(n,Ze,t))),Qr(n,"\\","/")):(i=Ze.exec(n),i&&(t="/"+$z(i[1])+"/",n=Qr(n,Ze,t)),Qr(n,"\\","/"))}Np.exports=Wz});var Cp=l(function(Vdr,jp){"use strict";var Kz=Rp();jp.exports=Kz});var Dp=l(function(Fdr,Bp){"use strict";var Uz=require("@stdlib/assert/is-string").isPrimitive,zz=require("@stdlib/regexp/regexp"),Gz=require("@stdlib/string/format");function Qz(r){if(!Uz(r))throw new TypeError(Gz("invalid argument. Must provide a regular expression string. Value: `%s`.",r));return r=zz().exec(r),r?new RegExp(r[1],r[2]):null}Bp.exports=Qz});var Tn=l(function(kdr,Mp){"use strict";var Jz=Dp();Mp.exports=Jz});var Wp=l(function(Idr,$p){"use strict";var Xz=typeof Object.getOwnPropertyNames!="undefined";$p.exports=Xz});var zp=l(function(Sdr,Up){"use strict";var Kp=require("@stdlib/object/ctor"),Yz=Kp.getOwnPropertyNames;function Hz(r){return Yz(Kp(r))}Up.exports=Hz});var Qp=l(function(Ldr,Gp){"use strict";var Zz=require("@stdlib/object/ctor"),rG=z();function eG(r){return rG(Zz(r))}Gp.exports=eG});var G=l(function(Ndr,Jp){"use strict";var tG=Wp(),iG=zp(),nG=Qp(),On;tG?On=iG:On=nG;Jp.exports=On});var Yp=l(function(Rdr,Xp){"use strict";var aG=typeof Object.getOwnPropertyDescriptor!="undefined";Xp.exports=aG});var Zp=l(function(jdr,Hp){"use strict";var uG=Object.getOwnPropertyDescriptor;function sG(r,e){var t;return r==null?null:(t=uG(r,e),t===void 0?null:t)}Hp.exports=sG});var ed=l(function(Cdr,rd){"use strict";var oG=require("@stdlib/assert/has-own-property");function lG(r,e){return oG(r,e)?{configurable:!0,enumerable:!0,writable:!0,value:r[e]}:null}rd.exports=lG});var ae=l(function(Bdr,td){"use strict";var vG=Yp(),fG=Zp(),mG=ed(),Pn;vG?Pn=fG:Pn=mG;td.exports=Pn});var nd=l(function(Ddr,id){"use strict";var cG=Object.getPrototypeOf;id.exports=cG});var ud=l(function(Mdr,ad){"use strict";function gG(r){return r.__proto__}ad.exports=gG});var od=l(function($dr,sd){"use strict";var hG=Ue(),pG=ud();function dG(r){var e=pG(r);return e||e===null?e:hG(r.constructor)==="[object Function]"?r.constructor.prototype:r instanceof Object?Object.prototype:null}sd.exports=dG});var vd=l(function(Wdr,ld){"use strict";var yG=require("@stdlib/assert/is-function"),qG=nd(),wG=od(),An;yG(Object.getPrototypeOf)?An=qG:An=wG;ld.exports=An});var md=l(function(Kdr,fd){"use strict";var bG=require("@stdlib/object/ctor"),_G=vd();function xG(r){return r==null?null:(r=bG(r),_G(r))}fd.exports=xG});var C=l(function(Udr,cd){"use strict";var EG=md();cd.exports=EG});var pd=l(function(zdr,hd){"use strict";var TG=require("@stdlib/array/int8"),OG=require("@stdlib/array/uint8"),PG=require("@stdlib/array/uint8c"),AG=require("@stdlib/array/int16"),VG=require("@stdlib/array/uint16"),FG=require("@stdlib/array/int32"),kG=require("@stdlib/array/uint32"),IG=require("@stdlib/array/float32"),SG=require("@stdlib/array/float64"),gd;function LG(r){return new TG(r)}function NG(r){return new OG(r)}function RG(r){return new PG(r)}function jG(r){return new AG(r)}function CG(r){return new VG(r)}function BG(r){return new FG(r)}function DG(r){return new kG(r)}function MG(r){return new IG(r)}function $G(r){return new SG(r)}function WG(){var r={int8array:LG,uint8array:NG,uint8clampedarray:RG,int16array:jG,uint16array:CG,int32array:BG,uint32array:DG,float32array:MG,float64array:$G};return r}gd=WG();hd.exports=gd});var bd=l(function(Gdr,wd){"use strict";var et=require("@stdlib/assert/has-own-property"),Vn=require("@stdlib/assert/is-array"),dd=require("@stdlib/assert/is-buffer"),KG=require("@stdlib/assert/is-error"),yd=be(),UG=Tn(),zG=H(),qd=z(),GG=G(),_e=ae(),QG=C(),xe=W(),JG=require("@stdlib/buffer/from-buffer"),XG=pd();function YG(r){var e,t,i,n,a,u,s,o;for(e=[],n=[],s=Object.create(QG(r)),e.push(r),n.push(s),t=GG(r),o=0;o0)for(a=s,h=0;h1){if(!r6(e))throw new TypeError(e6("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(e===0)return r}else e=t6;return t=ZG(r)?new Array(r.length):{},i6(r,t,[r],[t],e)}_d.exports=n6});var Xr=l(function(Jdr,Ed){"use strict";var a6=xd();Ed.exports=a6});var Od=l(function(Xdr,Td){"use strict";var u6=require("@stdlib/assert/is-plain-object"),s6=require("@stdlib/assert/has-own-property"),o6=require("@stdlib/string/format");function l6(r,e){return u6(e)?(s6(e,"thisArg")&&(r.thisArg=e.thisArg),null):new TypeError(o6("invalid argument. Options argument must be an object. Value: `%s`.",e))}Td.exports=l6});var Vd=l(function(Ydr,Ad){"use strict";var v6=require("@stdlib/assert/is-collection"),f6=require("@stdlib/assert/is-function"),m6=require("@stdlib/assert/has-own-property"),Pd=require("@stdlib/string/format"),c6=Od();function g6(r,e,t){var i,n,a,u,s,o,v,f;if(!v6(r))throw new TypeError(Pd("invalid argument. First argument must be a collection. Value: `%s`.",r));if(n={},arguments.length===2)o=e;else{if(a=c6(n,e),a)throw a;o=t}if(!f6(o))throw new TypeError(Pd("invalid argument. Last argument must be a function. Value: `%s`.",o));for(i=n.thisArg,s=r.length,u={},f=0;f2){if(n=e,i=t,!tt(n))throw new TypeError(it("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else if(tt(e))n=e;else{if(n=r.length,!tt(n))throw new TypeError(it("invalid argument. First argument must be a function having at least one parameter. Value: `%s`.",n));i=e}return a([]);function a(u){return s;function s(o){var v=u.slice();return v.push(o),v.length2){if(n=e,i=t,!nt(n))throw new TypeError(at("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else if(nt(e))n=e;else{if(n=r.length,!nt(n))throw new TypeError(at("invalid argument. First argument must be a function having at least one parameter. Value: `%s`.",n));i=e}return a([]);function a(u){return s;function s(o){var v=u.slice();return v.unshift(o),v.lengthe&&(n.length=e);return n=n.join(","),s+="return function decorator("+n+"){",s+="var __$$args$$__=[];",s+="for (var __$$i$$__=0;__$$i$$__2&&(u=K6(a,t),u))throw u;return i?n=e.split(a.sep):n=e,z6(r,n)}}Zd.exports=G6});var ty=l(function(vyr,ey){"use strict";var Q6=require("@stdlib/assert/is-string").isPrimitive,J6=require("@stdlib/assert/is-array"),X6=require("@stdlib/assert/is-object-like"),Y6=require("@stdlib/string/format"),H6=In(),Z6=Sn(),r4=Ln();function e4(r,e){var t,i,n,a;if(t=Q6(r),!t&&!J6(r))throw new TypeError(Y6("invalid argument. Key path must be a string or a key array. Value: `%s`.",r));if(n=Z6(),arguments.length>1&&(a=H6(n,e),a))throw a;return t?i=r.split(n.sep):i=r,u;function u(s){if(X6(s))return r4(s,i)}}ey.exports=e4});var Nn=l(function(fyr,ny){"use strict";var t4=k(),iy=ry(),i4=ty();t4(iy,"factory",i4);ny.exports=iy});var uy=l(function(myr,ay){"use strict";function n4(){return{copy:!0,sep:"."}}ay.exports=n4});var ly=l(function(cyr,oy){"use strict";var a4=require("@stdlib/assert/is-boolean").isPrimitive,u4=require("@stdlib/assert/is-string").isPrimitive,s4=require("@stdlib/assert/is-plain-object"),sy=require("@stdlib/assert/has-own-property"),Rn=require("@stdlib/string/format");function o4(r,e){return s4(e)?sy(e,"copy")&&(r.copy=e.copy,!a4(r.copy))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):sy(e,"sep")&&(r.sep=e.sep,!u4(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):null:new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}oy.exports=o4});var fy=l(function(gyr,vy){"use strict";var l4=Nn().factory,v4=require("@stdlib/assert/is-array"),f4=require("@stdlib/string/format"),m4=uy(),c4=ly();function g4(r,e,t){var i,n,a,u,s;if(!v4(r))throw new TypeError(f4("invalid argument. First argument must be an array. Value: `%s`.",r));if(n=m4(),arguments.length>2&&(u=c4(n,t),u))throw u;for(n.copy?a=new Array(r.length):a=r,i=l4(e,{sep:n.sep}),s=0;s3&&(s=V4(u,i),s))throw s;return n?a=e.split(u.sep):a=e,k4(r,a,u.create,t)}yy.exports=I4});var by=l(function(wyr,wy){"use strict";var S4=require("@stdlib/assert/is-string").isPrimitive,L4=require("@stdlib/assert/is-array"),N4=require("@stdlib/assert/is-object-like"),R4=require("@stdlib/string/format"),j4=Cn(),C4=Bn(),B4=Dn();function D4(r,e){var t,i,n,a;if(t=S4(r),!t&&!L4(r))throw new TypeError(R4("invalid argument. Key path must be a string or a key array. Value: `%s`.",r));if(n=C4(),arguments.length>1&&(a=j4(n,e),a))throw a;return t?i=r.split(n.sep):i=r,u;function u(s,o){return N4(s)?B4(s,i,n.create,o):!1}}wy.exports=D4});var Ey=l(function(byr,xy){"use strict";var M4=k(),_y=qy(),$4=by();M4(_y,"factory",$4);xy.exports=_y});var Oy=l(function(_yr,Ty){"use strict";var W4=W();function K4(r,e,t){W4(r,e,{configurable:!0,enumerable:!0,get:t})}Ty.exports=K4});var Ay=l(function(xyr,Py){"use strict";var U4=Oy();Py.exports=U4});var Fy=l(function(Eyr,Vy){"use strict";var z4=W();function G4(r,e,t){z4(r,e,{configurable:!0,enumerable:!0,writable:!1,value:t})}Vy.exports=G4});var Iy=l(function(Tyr,ky){"use strict";var Q4=Fy();ky.exports=Q4});var Ly=l(function(Oyr,Sy){"use strict";var J4=W();function X4(r,e,t,i){J4(r,e,{configurable:!0,enumerable:!0,get:t,set:i})}Sy.exports=X4});var Ry=l(function(Pyr,Ny){"use strict";var Y4=Ly();Ny.exports=Y4});var Cy=l(function(Ayr,jy){"use strict";var H4=W();function Z4(r,e,t){H4(r,e,{configurable:!0,enumerable:!0,set:t})}jy.exports=Z4});var Dy=l(function(Vyr,By){"use strict";var rQ=Cy();By.exports=rQ});var Ky=l(function(Fyr,Wy){"use strict";var My=require("@stdlib/assert/is-object"),eQ=require("@stdlib/assert/is-function"),$y=W(),Mn=require("@stdlib/string/format");function tQ(r,e,t){if(!My(r))throw new TypeError(Mn("invalid argument. First argument must be an object. Value: `%s`.",r));if(!My(t))throw new TypeError(Mn("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(!eQ(t.value))throw new TypeError(Mn("invalid argument. The `value` property of the property descriptor must be a function. Value: `%s`.",t.value));t={configurable:t.configurable===void 0?!1:t.configurable,enumerable:t.enumerable===void 0?!1:t.enumerable,writable:t.writable===void 0?!1:t.writable,value:t.value},$y(r,e,{configurable:!0,enumerable:t.enumerable,get:i,set:t.writable?n:void 0});function i(){var a=t.value.call(r);return n(a),a}function n(a){t.value=a,$y(r,e,t)}}Wy.exports=tQ});var ut=l(function(kyr,Uy){"use strict";var iQ=Ky();Uy.exports=iQ});var Qy=l(function(Iyr,Gy){"use strict";var nQ=require("@stdlib/assert/is-object"),aQ=require("@stdlib/assert/is-function"),uQ=ut(),zy=require("@stdlib/string/format");function sQ(r,e,t){if(!nQ(r))throw new TypeError(zy("invalid argument. First argument must be an object. Value: `%s`.",r));if(!aQ(t))throw new TypeError(zy("invalid argument. Third argument must be a function. Value: `%s`.",t));uQ(r,e,{configurable:!0,enumerable:!0,writable:!1,value:t})}Gy.exports=sQ});var Xy=l(function(Syr,Jy){"use strict";var oQ=Qy();Jy.exports=oQ});var Zy=l(function(Lyr,Hy){"use strict";var lQ=require("@stdlib/assert/is-object"),vQ=require("@stdlib/assert/is-function"),fQ=ut(),Yy=require("@stdlib/string/format");function mQ(r,e,t){if(!lQ(r))throw new TypeError(Yy("invalid argument. First argument must be an object. Value: `%s`.",r));if(!vQ(t))throw new TypeError(Yy("invalid argument. Third argument must be a function. Value: `%s`.",t));fQ(r,e,{configurable:!1,enumerable:!0,writable:!1,value:t})}Hy.exports=mQ});var eq=l(function(Nyr,rq){"use strict";var cQ=Zy();rq.exports=cQ});var iq=l(function(Ryr,tq){"use strict";var gQ=W();function hQ(r,e,t){gQ(r,e,{configurable:!0,enumerable:!1,writable:!0,value:t})}tq.exports=hQ});var $n=l(function(jyr,nq){"use strict";var pQ=iq();nq.exports=pQ});var uq=l(function(Cyr,aq){"use strict";var dQ=W();function yQ(r,e,t,i){dQ(r,e,{configurable:!1,enumerable:!1,get:t,set:i})}aq.exports=yQ});var Wn=l(function(Byr,sq){"use strict";var qQ=uq();sq.exports=qQ});var lq=l(function(Dyr,oq){"use strict";var wQ=W();function bQ(r,e,t){wQ(r,e,{configurable:!1,enumerable:!1,set:t})}oq.exports=bQ});var fq=l(function(Myr,vq){"use strict";var _Q=lq();vq.exports=_Q});var cq=l(function($yr,mq){"use strict";var xQ=Object.defineProperties;mq.exports=xQ});var dq=l(function(Wyr,pq){"use strict";var gq=require("@stdlib/assert/is-object"),EQ=z(),TQ=W(),hq=require("@stdlib/string/format");function OQ(r,e){var t,i,n;if(!gq(r))throw new TypeError(hq("invalid argument. First argument must be an object. Value: `%s`.",r));if(!gq(e))throw new TypeError(hq("invalid argument. Second argument must be an object containing property descriptors. Value: `%s`.",e));for(t=EQ(e),n=0;n=0&&!t(r[a+1],a+1,r));return r}Qq.exports=XQ});var Yq=l(function(nqr,Xq){"use strict";var YQ=Jq();Xq.exports=YQ});var ew=l(function(aqr,rw){"use strict";var Hq=require("@stdlib/assert/is-function"),Zq=require("@stdlib/string/format");function HQ(r,e,t){var i;if(!Hq(r))throw new TypeError(Zq("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Hq(e))throw new TypeError(Zq("invalid argument. Second argument must be a function. Value: `%s`.",e));i=0;do r.call(t,i),i+=1;while(e(i))}rw.exports=HQ});var iw=l(function(uqr,tw){"use strict";var ZQ=ew();tw.exports=ZQ});var uw=l(function(sqr,aw){"use strict";var rJ=require("@stdlib/assert/is-collection"),nw=require("@stdlib/assert/is-function"),Gn=require("@stdlib/string/format");function eJ(r,e,t,i){var n,a;if(!rJ(r))throw new TypeError(Gn("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!nw(e))throw new TypeError(Gn("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!nw(t))throw new TypeError(Gn("invalid argument. Third argument must be a function. Value: `%s`.",t));if(n=r.length,n===0&&(e.call(i,void 0,void 0,r),n=r.length,n===0))return r;a=0;do e.call(i,r[a],a,r),a+=1,n=r.length;while(a=0&&t(r[a+1],a+1,r));return r}vw.exports=nJ});var cw=l(function(vqr,mw){"use strict";var aJ=fw();mw.exports=aJ});var hw=l(function(fqr,gw){"use strict";var st=W();function uJ(r){return st(this,"next",{configurable:!1,enumerable:!0,get:function(){return this._next}}),st(this,"prev",{configurable:!1,enumerable:!0,get:function(){return this._prev}}),this.value=r,st(this,"_next",{configurable:!1,enumerable:!1,writable:!0,value:null}),st(this,"_prev",{configurable:!1,enumerable:!1,writable:!0,value:null}),this}gw.exports=uJ});var qw=l(function(mqr,yw){"use strict";var ar=k(),sJ=Tr(),pw=require("@stdlib/symbol/iterator"),dw=require("@stdlib/string/format"),Jn=hw();function ir(){return this instanceof ir?(this._length=0,this._first=null,this._last=null,this):new ir}ar(ir.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});ar(ir.prototype,"first",function(){if(this._length)return this._first});ar(ir.prototype,"insert",function(e,t,i){var n,a;if(arguments.length>2){if(n=i,n!=="before"&&n!=="after")throw new Error(dw("invalid argument. Third argument must be a recognized location. Value: `%s`.",n))}else n="after";if(n==="after"&&e===this._last)return this.push(t);if(n==="before"&&e===this._first)return this.unshift(t);for(a=this._first;a!==this._last&&a!==e;)a=a._next;if(a===this._last&&a!==e)throw new Error("invalid argument. The list does not contain the provided list node.");return a=new Jn(t),n==="after"?(e._next._prev=a,a._next=e._next,e._next=a,a._prev=e):(e._prev._next=a,a._prev=e._prev,e._prev=a,a._next=e),this._length+=1,this});ar(ir.prototype,"iterator",function(e){var t,i,n,a,u,s,o;if(arguments.length){if(u=e,u!=="forward"&&u!=="reverse")throw new Error(dw("invalid argument. Must provide a recognized iteration direction. Value: `%s`.",u))}else u="forward";return n=this,u==="forward"?(o=-1,s=1):(o=this._length,s=-1),t=this.toArray(),i={},ar(i,"next",v),ar(i,"return",f),pw&&ar(i,pw,m),i;function v(){return o+=s,a||o<0||o>=t.length?{done:!0}:{value:t[o],done:!1}}function f(c){return a=!0,arguments.length?{value:c,done:!0}:{done:!0}}function m(){return n.iterator()}});ar(ir.prototype,"last",function(){if(this._length)return this._last});sJ(ir.prototype,"length",function(){return this._length});ar(ir.prototype,"pop",function(){var e;return this._length&&(e=this._last.value,this._last._prev?(this._last=this._last._prev,this._last._next=null):(this._first=null,this._last=null),this._length-=1),e});ar(ir.prototype,"push",function(e){var t;return t=new Jn(e),this._length===0?(this._first=t,this._last=t):(t._prev=this._last,this._last._next=t,this._last=t),this._length+=1,this});ar(ir.prototype,"remove",function(e){var t,i;if(e===this._first)return this.shift();if(e===this._last)return this.pop();for(t=e.value,i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return e._prev._next=e._next,e._next._prev=e._prev,this._length-=1,t});ar(ir.prototype,"shift",function(){var e;return this._length&&(e=this._first.value,this._first._next?(this._first=this._first._next,this._first._prev=null):(this._first=null,this._last=null),this._length-=1),e});ar(ir.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i=0&&r[i]!=="/";i--);return i===void 0||i<=0?r.replace(_w,"\\$&"):(t=r.substring(1,i),t=t.replace(_w,"\\$&"),r=r[0]+t+r.substring(i),r)}xw.exports=fJ});var Xn=l(function(hqr,Tw){"use strict";var mJ=Ew();Tw.exports=mJ});var Pw=l(function(pqr,Ow){"use strict";var Yn=Ke();function cJ(r){throw r}function gJ(){return{comment:"",delimiter:",",doublequote:!0,escape:"",ltrim:!1,maxRows:1e308,newline:"\r\n",onClose:Yn,onColumn:Yn,onComment:null,onError:cJ,onRow:Yn,onSkip:null,onWarn:null,quote:'"',quoting:!0,rowBuffer:[],rtrim:!1,skip:"",skipBlankRows:!1,skipRow:null,strict:!0,trimComment:!0,whitespace:[" "]}}Ow.exports=gJ});var ot=l(function(dqr,hJ){hJ.exports=["closed","comment","escape","error","field","init","invalid_quote_end","quote_end","quoted_escape","quoted_field","skip","skipped_comment","skipped_escape","skipped_field","skipped_invalid_quote_end","skipped_quote_end","skipped_quoted_escape","skipped_quoted_field"]});var Y=l(function(yqr,Vw){"use strict";var Aw=ot();function pJ(){var r,e;for(r={},e=0;e=g){if(m){$r("Error."),r._setErrorState("INVALID_ESCAPE")._changeState(FJ);return}$r("Escape sequence is not followed by a special character sequence."),r._raiseWarning("INVALID_ESCAPE")._push(y)._changeState(ue);return}r._push(y)}}Dw.exports=kJ});var Kw=l(function(Eqr,Ww){"use strict";var IJ=require("debug"),lt=Y(),se=IJ("state:field"),SJ=lt.escape,LJ=lt.field,NJ=lt.init,$w=lt.quoted_field;function RJ(r){var e,t,i,n,a,u,s,o,v,f;return i=r._escapeLastIndex,o=r._escape,n=r._quoteLastIndex,f=r._quote,e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,s=r._quoting,v=r._strict,m;function m(c){var g=r._cursor-r._cidx+1;if(se("Char: %s",c),c===o[i]&&r._scan(o,i)){se("Escape."),r._push(c)._changeState(SJ);return}if(g-n===0&&c===f[n]&&r._scan(f,n)){if(s){se("Quote."),r._rewind(n)._changeState($w);return}r._push(c);return}if(v===!1&&c===f[n]&&r._scan(f,n)){if(s&&r._isWhitespace(r._cidx,r._cursor-n)){se("Quote."),r._raiseWarning("INVALID_OPENING_QUOTE")._rewind(g)._changeState($w);return}r._push(c);return}if(c===a[e]&&r._scan(a,e)){se("Delimiter."),r._rewind(e)._changeState(LJ);return}if(c===u[t]&&r._scan(u,t)){se("Newline."),r._rewind(t)._changeState(NJ);return}r._push(c)}}Ww.exports=RJ});var Gw=l(function(Tqr,zw){"use strict";var jJ=require("debug"),oe=Y(),Wr=jJ("state:init"),CJ=oe.comment,BJ=oe.field,DJ=oe.escape,MJ=oe.init,Uw=oe.quoted_field,$J=oe.skip;function WJ(r){var e,t,i,n,a,u,s,o,v,f,m,c,g,h;return i=r._commentLastIndex,v=r._comment,u=r._skipLastIndex,h=r._skip,n=r._escapeLastIndex,m=r._escape,a=r._quoteLastIndex,g=r._quote,e=r._delimiterLastIndex,s=r._delimiter,t=r._newlineLastIndex,o=r._newline,f=r._quoting,c=r._strict,y;function y(q){var _=r._cursor+1;if(Wr("Char: %s",q),v&&_-i===0&&q===v[i]&&r._scan(v,i)){Wr("Comment."),r._rewind(i)._changeState(CJ);return}if(h&&_-u===0&&q===h[u]&&r._scan(h,u)){Wr("Skip."),r._rewind(u)._changeState($J);return}if(q===m[n]&&r._scan(m,n)){Wr("Escape."),r._push(q)._changeState(DJ);return}if(_-a===0&&q===g[a]&&r._scan(g,a)){if(f){Wr("Quote."),r._rewind(a)._changeState(Uw);return}r._push(q);return}if(c===!1&&q===g[a]&&r._scan(g,a)){if(f&&r._isWhitespace(0,r._cursor-a)){Wr("Quote."),r._raiseWarning("INVALID_OPENING_QUOTE")._rewind(_)._changeState(Uw);return}r._push(q);return}if(q===s[e]&&r._scan(s,e)){Wr("Delimiter."),r._rewind(e)._changeState(BJ);return}if(q===o[t]&&r._scan(o,t)){Wr("Newline."),r._rewind(t)._changeState(MJ);return}r._push(q)}}zw.exports=WJ});var Xw=l(function(Oqr,Jw){"use strict";var KJ=require("debug"),Hn=Y(),vt=KJ("state:invalid_quote_end"),UJ=Hn.error,zJ=Hn.field,GJ=Hn.init;function Qw(r,e){if(r._isWhitespace(r._qidx+1,r._cursor)){r._raiseWarning("INVALID_CLOSING_QUOTE")._rewind(r._cursor-r._qidx)._changeState(e);return}vt("Error."),r._setErrorState("INVALID_CLOSING_QUOTE")._changeState(UJ)}function QJ(r){var e,t,i,n;return e=r._delimiterLastIndex,i=r._delimiter,t=r._newlineLastIndex,n=r._newline,a;function a(u){if(vt("Char: %s",u),u===i[e]&&r._scan(i,e)){vt("Delimiter."),r._rewind(e),Qw(r,zJ);return}if(u===n[t]&&r._scan(n,t)){vt("Newline."),r._rewind(t),Qw(r,GJ);return}r._push(u)}}Jw.exports=QJ});var Zw=l(function(Pqr,Hw){"use strict";var JJ=require("debug"),Yw=Ee(),Te=Y(),le=JJ("state:quote_end"),XJ=Te.error,YJ=Te.field,HJ=Te.init,ZJ=Te.invalid_quote_end,rX=Te.quoted_field;function eX(r){var e,t,i,n,a,u,s,o,v;return e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,i=r._quoteLastIndex,o=r._quote,n=r._doublequote,s=r._strict,v=Yw(Yw(e,t),i),f;function f(m){if(le("Char: %s",m),n&&m===o[i]&&r._scan(o,i)){le("Double quote."),r._push(m)._changeState(rX);return}if(m===a[e]&&r._scan(a,e)){le("Delimiter."),r._rewind(e)._changeState(YJ);return}if(m===u[t]&&r._scan(u,t)){le("Newline."),r._rewind(t)._changeState(HJ);return}if(r._cursor-r._qidx>=v){if(s){le("Error."),r._setErrorState("INVALID_CLOSING_QUOTE")._changeState(XJ);return}le("Invalid closing quote."),r._push(m)._changeState(ZJ);return}r._push(m)}}Hw.exports=eX});var ib=l(function(Aqr,tb){"use strict";var tX=require("debug"),eb=Y(),ft=tX("state:quoted_escape"),iX=eb.error,rb=eb.quoted_field;function nX(r){var e,t,i,n,a;return t=r._quoteLastIndex,a=r._quote,e=r._escapeLastIndex,i=r._escapeLength,n=r._strict,u;function u(s){var o=r._cursor,v=r._eidx,f=o-v;if(ft("Char: %s",s),f===t&&s===a[t]&&r._scan(a,t)){ft("Quote."),r._copyWithin(v-e,v+1,t)._rewind(i)._push(s)._changeState(rb);return}if(f>=t){if(n){ft("Error."),r._setErrorState("INVALID_QUOTED_ESCAPE")._changeState(iX);return}ft("Escape sequence is not followed by a quote sequence."),r._raiseWarning("INVALID_QUOTED_ESCAPE")._push(s)._changeState(rb);return}r._push(s)}}tb.exports=nX});var ub=l(function(Vqr,ab){"use strict";var aX=require("debug"),nb=Y(),Zn=aX("state:quoted_field"),uX=nb.quote_end,sX=nb.quoted_escape;function oX(r){var e,t,i,n,a;return e=r._escapeLastIndex,n=r._escape,t=r._quoteLastIndex,a=r._quote,i=r._doublequote,u;function u(s){if(Zn("Char: %s",s),i===!1&&s===n[e]&&r._scan(n,e)){Zn("Escape."),r._push(s)._changeState(sX);return}if(s===a[t]&&r._scan(a,t)){Zn("Quote."),r._rewind(t)._changeState(uX);return}r._push(s)}}ab.exports=oX});var lb=l(function(Fqr,ob){"use strict";var lX=require("debug"),ve=Y(),Kr=lX("state:skip"),vX=ve.init,fX=ve.skip,mX=ve.skipped_comment,cX=ve.skipped_field,gX=ve.skipped_escape,sb=ve.skipped_quoted_field;function hX(r){var e,t,i,n,a,u,s,o,v,f,m,c,g,h;return i=r._commentLastIndex,v=r._comment,u=r._skipLastIndex,h=r._skip,n=r._escapeLastIndex,m=r._escape,a=r._quoteLastIndex,g=r._quote,e=r._delimiterLastIndex,s=r._delimiter,t=r._newlineLastIndex,o=r._newline,f=r._quoting,c=r._strict,y;function y(q){var _=r._cursor+1;if(Kr("Char: %s",q),v&&_-i===0&&q===v[i]&&r._scan(v,i)){Kr("Comment."),r._push(q)._changeState(mX);return}if(h&&_-u===0&&q===h[u]&&r._scan(h,u)){Kr("Skip."),r._push(q)._changeState(fX);return}if(q===m[n]&&r._scan(m,n)){Kr("Escape."),r._push(q)._changeState(gX);return}if(_-a===0&&q===g[a]&&r._scan(g,a)){if(f){Kr("Quote."),r._push(q)._changeState(sb);return}r._push(q);return}if(c===!1&&q===g[a]&&r._scan(g,a)){if(f&&r._isWhitespace(0,r._cursor-a)){Kr("Quote."),r._push(q)._changeState(sb);return}r._push(q);return}if(q===s[e]&&r._scan(s,e)){Kr("Delimiter."),r._push(q)._changeState(cX);return}if(q===o[t]&&r._scan(o,t)){Kr("Newline."),r._rewind(t)._changeState(vX);return}r._push(q)}}ob.exports=hX});var mb=l(function(kqr,fb){"use strict";var pX=require("debug"),dX=Y(),vb=pX("state:skipped_comment"),yX=dX.init;function qX(r){var e,t;return e=r._newlineLastIndex,t=r._newline,i;function i(n){if(vb("Char: %s",n),n===t[e]&&r._scan(t,e)){vb("Newline."),r._rewind(e)._changeState(yX);return}r._push(n)}}fb.exports=qX});var hb=l(function(Iqr,gb){"use strict";var wX=require("debug"),cb=Ee(),bX=Y(),Yr=wX("state:skipped_escape"),fe=bX.skipped_field;function _X(r){var e,t,i,n,a,u,s,o,v,f,m;return e=r._delimiterLastIndex,u=r._delimiter,t=r._newlineLastIndex,s=r._newline,i=r._commentLastIndex,o=r._comment,a=r._skipLastIndex,f=r._skip,n=r._escapeLastIndex,v=r._escape,m=cb(cb(e,t),n),c;function c(g){var h=r._cursor,y=r._eidx,q=h-y;if(Yr("Char: %s",g),q===e&&g===u[e]&&r._scan(u,e)){Yr("Delimiter."),r._push(g)._changeState(fe);return}if(q===t&&g===s[t]&&r._scan(s,t)){Yr("Newline."),r._push(g)._changeState(fe);return}if(q===n&&g===v[n]&&r._scan(v,n)){Yr("Escape."),r._push(g)._changeState(fe);return}if(o&&h-i===0&&g===o[i]&&r._scan(o,i)){Yr("Comment."),r._push(g)._changeState(fe);return}if(f&&h-a===0&&g===f[a]&&r._scan(f,a)){Yr("Skip."),r._push(g)._changeState(fe);return}if(q>=m){Yr("Normal character sequence."),r._push(g)._changeState(fe);return}r._push(g)}}gb.exports=_X});var yb=l(function(Sqr,db){"use strict";var xX=require("debug"),mt=Y(),me=xX("state:skipped_field"),EX=mt.init,TX=mt.skipped_escape,OX=mt.skipped_field,pb=mt.skipped_quoted_field;function PX(r){var e,t,i,n,a,u,s,o,v,f;return i=r._escapeLastIndex,o=r._escape,n=r._quoteLastIndex,f=r._quote,e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,s=r._quoting,v=r._strict,m;function m(c){var g=r._cursor-r._cidx+1;if(me("Char: %s",c),c===o[i]&&r._scan(o,i)){me("Escape."),r._push(c)._changeState(TX);return}if(g-n===0&&c===f[n]&&r._scan(f,n)){if(r._push(c),s){me("Quote."),r._changeState(pb);return}return}if(v===!1&&c===f[n]&&r._scan(f,n)){if(r._push(c),s&&r._isWhitespace(r._cidx,r._cursor-n)){me("Quote."),r._changeState(pb);return}return}if(c===a[e]&&r._scan(a,e)){me("Delimiter."),r._push(c)._changeState(OX);return}if(c===u[t]&&r._scan(u,t)){me("Newline."),r._rewind(t)._changeState(EX);return}r._push(c)}}db.exports=PX});var bb=l(function(Lqr,wb){"use strict";var AX=require("debug"),qb=Y(),ra=AX("state:skipped_invalid_quote_end"),VX=qb.skipped_field,FX=qb.init;function kX(r){var e,t,i,n;return e=r._delimiterLastIndex,i=r._delimiter,t=r._newlineLastIndex,n=r._newline,a;function a(u){if(ra("Char: %s",u),u===i[e]&&r._scan(i,e)){ra("Delimiter."),r._push(u)._changeState(VX);return}if(u===n[t]&&r._scan(n,t)){ra("Newline."),r._rewind(t)._changeState(FX);return}r._push(u)}}wb.exports=kX});var Eb=l(function(Nqr,xb){"use strict";var IX=require("debug"),_b=Ee(),ct=Y(),Oe=IX("state:skipped_quote_end"),SX=ct.init,LX=ct.skipped_field,NX=ct.skipped_invalid_quote_end,RX=ct.skipped_quoted_field;function jX(r){var e,t,i,n,a,u,s,o;return e=r._delimiterLastIndex,a=r._delimiter,t=r._newlineLastIndex,u=r._newline,i=r._quoteLastIndex,s=r._quote,n=r._doublequote,o=_b(_b(e,t),i),v;function v(f){if(Oe("Char: %s",f),n&&f===s[i]&&r._scan(s,i)){Oe("Double quote."),r._push(f)._changeState(RX);return}if(f===a[e]&&r._scan(a,e)){Oe("Delimiter."),r._push(f)._changeState(LX);return}if(f===u[t]&&r._scan(u,t)){Oe("Newline."),r._rewind(t)._changeState(SX);return}if(r._cursor-r._qidx>=o){Oe("Invalid closing quote."),r._push(f)._changeState(NX);return}r._push(f)}}xb.exports=jX});var Pb=l(function(Rqr,Ob){"use strict";var CX=require("debug"),BX=Y(),ea=CX("state:skipped_quoted_escape"),Tb=BX.skipped_quoted_field;function DX(r){var e,t;return e=r._quoteLastIndex,t=r._quote,i;function i(n){var a=r._cursor,u=r._eidx,s=a-u;if(ea("Char: %s",n),s===e&&n===t[e]&&r._scan(t,e)){ea("Quote."),r._push(n)._changeState(Tb);return}if(s>=e){ea("Escape sequence is not followed by a quote sequence."),r._push(n)._changeState(Tb);return}r._push(n)}}Ob.exports=DX});var Fb=l(function(jqr,Vb){"use strict";var MX=require("debug"),Ab=Y(),ta=MX("state:skipped_quoted_field"),$X=Ab.skipped_quote_end,WX=Ab.skipped_quoted_escape;function KX(r){var e,t,i,n,a;return e=r._escapeLastIndex,n=r._escape,t=r._quoteLastIndex,a=r._quote,i=r._doublequote,u;function u(s){if(ta("Char: %s",s),i===!1&&s===n[e]&&r._scan(n,e)){ta("Escape."),r._push(s)._changeState(WX);return}if(s===a[t]&&r._scan(a,t)){ta("Quote."),r._push(s)._changeState($X);return}r._push(s)}}Vb.exports=KX});var Sb=l(function(Cqr,Ib){"use strict";var kb=ot(),UX=kw(),zX=Lw(),GX=Rw(),QX=Mw(),JX=Kw(),XX=Gw(),YX=Xw(),HX=Zw(),ZX=ib(),r8=ub(),e8=lb(),t8=mb(),i8=hb(),n8=yb(),a8=bb(),u8=Eb(),s8=Pb(),o8=Fb(),l8={closed:UX,comment:zX,escape:QX,error:GX,field:JX,init:XX,invalid_quote_end:YX,quote_end:HX,quoted_escape:ZX,quoted_field:r8,skip:e8,skipped_comment:t8,skipped_escape:i8,skipped_field:n8,skipped_invalid_quote_end:a8,skipped_quote_end:u8,skipped_quoted_escape:s8,skipped_quoted_field:o8};function v8(r){var e,t;for(e=[],t=0;t=t.length?(t.push(e),Z("Internal buffer size increased. Length: %d.",t.length)):t[this._cursor]=e,Z("Cursor: %d. Push: %s",this._cursor,e),this});Q(D.prototype,"_rewind",function(e){return this._cursor-=e,Z("Rewind: %d. Cursor: %d.",e,this._cursor),this});Q(D.prototype,"_copyWithin",function(e,t,i){var n,a;for(n=this._buffer,a=0;a=i.length?(i.push(e),Z("Row buffer size increased. Length: %d.",i.length)):i[t]=e,this});Q(D.prototype,"_getField",function(e,t){var i=this._slice(e,t);return this._ltrim?this._rtrim?ce(i,this._reWhitespace,"$1"):ce(i,this._reWhitespaceLeft,""):this._rtrim?ce(i,this._reWhitespaceRight,""):i});Q(D.prototype,"_getRow",function(){return this._rowBufferFLG?this._rowBuffer:this._rowBuffer.slice(0,this._col)});Q(D.prototype,"_scan",function(e,t){var i,n,a;for(i=this._buffer,n=this._cursor-t+1,a=0;a=this._maxRows&&this._changeState(Hr),this)});Q(D.prototype,"_onCommentedRow",function(){var e;return this._onComment?(e=this._slice(0,this._cursor),this._trimComment&&(e=ce(e,this._reWhitespaceLeft,"")),this._onComment(e,this._line),Z("Comment. Line: %d. Value: %s",this._line,e)):Z("Comment. Line: %d.",this._line),this._line+=1,this._reset(),this});Q(D.prototype,"_onSkippedRow",function(){var e;return this._onSkip?(e=this._slice(0,this._cursor),this._onSkip(e,this._line),Z("Skipped row. Line: %d. Value: %s",this._line,e)):Z("Skipped row. Line: %d.",this._line),this._line+=1,this._reset(),this});Q(D.prototype,"_onClosingQuote",function(){return this._qidx=this._cursor,this});Q(D.prototype,"_onEscape",function(){return this._eidx=this._cursor,this});Q(D.prototype,"_createException",function(e){var t;switch(e){case"INVALID_CLOSING_QUOTE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains a closing quote which is not immediately followed by a delimiter or newline.",this._col,this._line));break;case"INVALID_OPENING_QUOTE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an opening quote which does not immediately follow a delimiter or newline.",this._col,this._line));break;case"INVALID_ESCAPE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence which is not immediately followed by a special character sequence.",this._col,this._line));break;case"INVALID_QUOTED_ESCAPE":t=new Error(gt("unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence within a quoted field which is not immediately followed by a quote sequence.",this._col,this._line));break;case"CLOSED":t=new Error("invalid operation. Parser is unable to parse new chunks, as the parser has been closed. To parse new chunks, create a new parser instance.");break;default:t=new Error("invalid operation. Parser is in an unrecoverable error state. To parse new chunks, create a new parser instance.");break}return t});Q(D.prototype,"_raiseWarning",function(e){var t;return this._onWarn&&(t=this._createException(e),Z("Warning: %s",t.message),this._onWarn(t)),this});Q(D.prototype,"_raiseException",function(){var e=this._createException(this._errname);return Z("Error: %s",e.message),this._onError(e),this});Q(D.prototype,"_changeState",function(e){switch(Z("State transition: %s -> %s.",Nb[this._state],Nb[e]),e){case Hr:this._close();break;case p8:this._commented=!0;break;case Pe:this._raiseException();break;case Rb:this._onEscape();break;case jb:this._state!==Rb&&this._onField();break;case Ae:this._commented?this._onCommentedRow():this._skipped?this._onSkippedRow():this._onRecord();break;case d8:break;case Cb:this._onClosingQuote();break;case y8:this._onEscape();break;case q8:break;case ia:this._skipped=!0;break;case w8:case b8:case _8:case x8:case E8:case T8:case O8:break}return this._state=e,this});Q(D.prototype,"_setErrorState",function(e){return e?Z("Error: %s.",e):Z("Reset error state."),this._errname=e,this});Q(D.prototype,"_close",function(){var e,t;return this.done?(this._setErrorState(Hr)._changeState(Pe),this):(this._cursor>=0?(e=this._state,e===Ae||e===jb||e===Cb?this._changeState(Ae)._onClose():(this._col&&this._onRow(this._getRow(),this._row,this._col),t=this._slice(this._cidx,this._cursor),Z("Flush: %s",t),this._onClose(t))):this._onClose(),Z("Closed."),this)});Q(D.prototype,"next",function(e){var t,i;if(Z("Chunk: %s",e),this.done)return this._setErrorState(Hr)._changeState(Pe),this;for(t=this._states,i=0;i=0;a--){if(i=e.call(t,r[a],a,r),!i)return!1;n!==r.length&&(a+=r.length-n,n=r.length)}return!0}M_.exports=AY});var K_=l(function(fwr,W_){"use strict";var VY=$_();W_.exports=VY});var z_=l(function(mwr,U_){"use strict";var FY=require("@stdlib/assert/is-string").isPrimitive,kY=require("@stdlib/regexp/extname").REGEXP,IY=require("@stdlib/string/format");function SY(r){if(!FY(r))throw new TypeError(IY("invalid argument. Filename must be a string. Value: `%s`.",r));return kY.exec(r)[1]}U_.exports=SY});var Q_=l(function(cwr,G_){"use strict";var LY=z_();G_.exports=LY});var X_=l(function(gwr,J_){"use strict";function NY(r){return this.next=null,this.prev=null,this.value=r,this}J_.exports=NY});var Z_=l(function(hwr,H_){"use strict";var hr=k(),RY=Tr(),Y_=require("@stdlib/symbol/iterator"),jY=X_();function fr(){return this instanceof fr?(this._length=0,this._first=null,this._last=null,this):new fr}hr(fr.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});hr(fr.prototype,"first",function(){if(this._length)return this._first.value});hr(fr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=-1,e=this.toArray(),t={},hr(t,"next",u),hr(t,"return",s),Y_&&hr(t,Y_,o),t;function u(){return a+=1,n||a>=e.length?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});hr(fr.prototype,"last",function(){if(this._length)return this._last.value});RY(fr.prototype,"length",function(){return this._length});hr(fr.prototype,"pop",function(){var e;return this._length&&(e=this._first.value,this._first.next?(this._first=this._first.next,this._first.prev=null):(this._first=null,this._last=null),this._length-=1),e});hr(fr.prototype,"push",function(e){var t;return t=new jY(e),this._length===0?(this._first=t,this._last=t):(t.prev=this._last,this._last.next=t,this._last=t),this._length+=1,this});hr(fr.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i0){for(f=0;f=0&&(c=r[f],!(v(c,f,r)&&(n===2?s.push([f,c]):n===1?s.push(c):s.push(f),i+=1,i===m)));f--);return s}fx.exports=zY});var gx=l(function(wwr,cx){"use strict";var GY=mx();cx.exports=GY});var aa=l(function(bwr,hx){"use strict";var QY=require("@stdlib/constants/float64/max"),JY={copy:!1,depth:QY};hx.exports=JY});var yx=l(function(_wr,dx){"use strict";var XY=require("@stdlib/assert/is-plain-object"),px=require("@stdlib/assert/has-own-property"),YY=require("@stdlib/assert/is-boolean").isPrimitive,HY=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ua=require("@stdlib/string/format");function ZY(r,e){return XY(e)?px(e,"depth")&&(r.depth=e.depth,!HY(r.depth))?new TypeError(ua("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","depth",r.depth)):px(e,"copy")&&(r.copy=e.copy,!YY(r.copy))?new TypeError(ua("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):null:new TypeError(ua("invalid argument. Options argument must be an object. Value: `%s`.",e))}dx.exports=ZY});var bx=l(function(xwr,wx){"use strict";var rH=require("@stdlib/assert/is-array-like-object");function qx(r,e,t){var i,n;for(n=0;n1&&(i=nH(t,e),i))throw i;return t.depth===0?n=r:n=aH([],r,t.depth),t.copy?eH(n):n}xx.exports=uH});var Ox=l(function(Twr,Tx){"use strict";var sH=require("@stdlib/function/ctor");function oH(r){var e,t,i,n;for(i="return function flattenArray(x){",e=r.length,t=e-1,i+="var o=[];var ",n=0;n1){if(!dH(e))throw new TypeError(sa("invalid argument. Options argument must be an object. Value: `%s`.",e));if(yH(e,"copy")&&(t=e.copy,!qH(t)))throw new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t))}return i=bH(r),t?xH(i):_H(i)}kx.exports=EH});var Nx=l(function(Vwr,Lx){"use strict";var TH=k(),Sx=Ex(),OH=Ix();TH(Sx,"factory",OH);Lx.exports=Sx});var oa=l(function(Fwr,Rx){"use strict";var PH=require("@stdlib/constants/float64/max");function AH(){return{delimiter:".",depth:PH,copy:!1}}Rx.exports=AH});var la=l(function(kwr,Cx){"use strict";var VH=require("@stdlib/assert/is-plain-object"),ht=require("@stdlib/assert/has-own-property"),FH=require("@stdlib/assert/is-string").isPrimitive,jx=require("@stdlib/assert/is-boolean").isPrimitive,kH=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fe=require("@stdlib/string/format");function IH(r,e){return VH(e)?ht(e,"depth")&&(r.depth=e.depth,!kH(r.depth))?new TypeError(Fe("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","depth",r.depth)):ht(e,"copy")&&(r.copy=e.copy,!jx(r.copy))?new TypeError(Fe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy)):ht(e,"flattenArrays")&&(r.flattenArrays=e.flattenArrays,!jx(r.flattenArrays))?new TypeError(Fe("invalid option. `%s` option must be a boolean. Option: `%s`.","flattenArrays",r.flattenArrays)):ht(e,"delimiter")&&(r.delimiter=e.delimiter,!FH(r.delimiter))?new TypeError(Fe("invalid option. `%s` option must be a string. Option: `%s`.","delimiter",r.delimiter)):null:new TypeError(Fe("invalid argument. Options argument must be an object. Value: `%s`.",e))}Cx.exports=IH});var $x=l(function(Iwr,Mx){"use strict";var Bx=z(),SH=require("@stdlib/assert/is-plain-object"),LH=require("@stdlib/assert/is-array");function Dx(r,e,t,i,n){var a,u,s,o;for(t&&(t+=n.delimiter),a=Bx(e),o=0;o1&&(i=MH(t,e),i))throw i;return $H(r,t)}Kx.exports=WH});var Gx=l(function(Nwr,zx){"use strict";var KH=require("@stdlib/assert/is-object-like"),UH=require("@stdlib/string/format"),zH=oa(),GH=la(),QH=va();function JH(r){var e,t;if(e=zH(),t=GH(e,r),t)throw t;return i;function i(n){if(!KH(n))throw new TypeError(UH("invalid argument. Must provide an object (except null). Value: `%s`.",n));return QH(n,e)}}zx.exports=JH});var Xx=l(function(Rwr,Jx){"use strict";var XH=k(),Qx=Ux(),YH=Gx();XH(Qx,"factory",YH);Jx.exports=Qx});var Zx=l(function(jwr,Hx){"use strict";var HH=require("@stdlib/assert/is-collection"),ZH=require("@stdlib/assert/is-function"),Yx=require("@stdlib/string/format");function r5(r,e,t){var i,n;if(!HH(r))throw new TypeError(Yx("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!ZH(e))throw new TypeError(Yx("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=r.length,n=0;n=0;n--)e.call(t,r[n],n,r),i!==r.length&&(n+=r.length-i,i=r.length);return r}iE.exports=n5});var uE=l(function(Dwr,aE){"use strict";var a5=nE();aE.exports=a5});var lE=l(function(Mwr,oE){"use strict";var u5=require("@stdlib/assert/is-function"),sE=require("@stdlib/string/format");function s5(r,e,t){var i,n;if(typeof r!="object"||r===null)throw new TypeError(sE("invalid argument. First argument must be an object. Value: `%s`.",r));if(!u5(e))throw new TypeError(sE("invalid argument. Second argument must be a function. Value: `%s`.",e));for(n in r)if(i=e.call(t,r[n],n,r),i===!1)return r;return r}oE.exports=s5});var fE=l(function($wr,vE){"use strict";var o5=lE();vE.exports=o5});var gE=l(function(Wwr,cE){"use strict";var l5=z(),v5=require("@stdlib/assert/is-function"),mE=require("@stdlib/string/format");function f5(r,e,t){var i,n,a,u,s;if(typeof r!="object"||r===null)throw new TypeError(mE("invalid argument. First argument must be an object. Value: `%s`.",r));if(!v5(e))throw new TypeError(mE("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=l5(r),a=i.length,s=0;s1){if(!Q9(e))throw new TypeError(Y9("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=G9;if(r==null)return[];for(n=f0(r),t=[],i={},s=1;n&&s<=u;){for(a=J9(n),v=0;v1){if(!e7(e))throw new TypeError(a7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=r7;if(r==null)return[];for(n=d0(r),t={},i=[],s=1;n&&s<=u;){for(a=i7(n),v=0;v1){if(!l7(e))throw new TypeError(c7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=o7;if(r==null)return[];for(n=_0(r),t=[],i={},s=1;n&&s<=u;){for(a=v7(n),v=0;v1){if(!d7(e))throw new TypeError(w7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=p7;if(r==null)return[];for(n=A0(r),t=[],i={},s=1;n&&s<=u;){for(a=y7(n),v=0;v1){if(!E7(e))throw new TypeError(A7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=x7;if(r==null)return[];for(n=L0(r),t=[],i={},s=1;n&&s<=u;){for(a=O7(n),v=0;v1){if(!I7(e))throw new TypeError(R7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=k7;if(r==null)return[];for(n=B0(r),t={},i=[],s=1;n&&s<=u;){for(a=L7(n),v=0;v1){if(!D7(e))throw new TypeError(W7("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=B7;if(r==null)return[];for(i=K0(r),t=[],u=1;i&&u<=a;){for(n=$7(i),s=0;s2){if(!G7(t))throw new TypeError(J7("invalid argument. Third argument must be a positive integer. Value: `%s`.",t));a=t}else a=z7;if(r==null)return null;for(n=X0(r),u=1;n&&u<=a;){if(i=Q7(n,e),i)return i;n=X0(n),u+=1}return null}Y0.exports=X7});var rO=l(function(Ubr,Z0){"use strict";var Y7=H0();Z0.exports=Y7});var tO=l(function(zbr,eO){"use strict";var H7=typeof Object.getOwnPropertyDescriptors!="undefined";eO.exports=H7});var aO=l(function(Gbr,nO){"use strict";var iO=require("@stdlib/object/ctor"),Z7=iO.getOwnPropertyDescriptors;function rZ(r){return Z7(iO(r))}nO.exports=rZ});var lO=l(function(Qbr,oO){"use strict";var eZ=G(),tZ=M(),uO=ae(),sO=W();function iZ(r){var e,t,i,n,a;for(n={},t=eZ(r),a=0;a1){if(!oZ(e))throw new TypeError(mZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=sZ;if(r==null)return{};for(n=fO(r),t={},s=1;n&&s<=u;){for(a=lZ(n),i=fZ(a),o=0;o1){if(!pZ(e))throw new TypeError(yZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=hZ;if(r==null)return[];for(i=yO(r),t=[],u=1;i&&u<=a;){for(n=dZ(i),s=0;s1){if(!xZ(e))throw new TypeError(TZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));a=e}else a=_Z;if(r==null)return[];for(i=xO(r),t=[],u=1;i&&u<=a;){for(n=EZ(i),s=0;s1){if(!FZ(e))throw new TypeError(SZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=VZ;if(r==null)return[];for(n=VO(r),t=[],i={},s=1;n&&s<=u;){for(a=kZ(n),v=0;v1){if(!jZ(e))throw new TypeError(MZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=RZ;if(r==null)return[];for(n=NO(r),t=[],i={},s=1;n&&s<=u;){for(a=BZ(n),v=0;v1){if(!UZ(e))throw new TypeError(JZ("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));u=e}else u=KZ;if(r==null)return[];for(n=DO(r),t={},i=[],s=1;n&&s<=u;){for(a=GZ(n),v=0;v=0;a--)n=e.call(t,r[a],a,r),i!==r.length&&(a+=r.length-i,i=r.length),a>=0&&a=0;u--)a=e.call(t,r[u],u),i[a]=r[u];return i}sP.exports=mrr});var vP=l(function(h_r,lP){"use strict";var crr=oP();lP.exports=crr});var mP=l(function(p_r,fP){"use strict";var ga=W();function grr(r){return ga(this,"next",{configurable:!1,enumerable:!0,get:function(){return this._next}}),this.value=r,ga(this,"_next",{configurable:!1,enumerable:!1,writable:!0,value:null}),ga(this,"_prev",{configurable:!1,enumerable:!1,writable:!0,value:null}),this}fP.exports=grr});var hP=l(function(d_r,gP){"use strict";var ur=k(),hrr=Tr(),cP=require("@stdlib/symbol/iterator"),ha=mP();function nr(){return this instanceof nr?(this._length=0,this._first=null,this._last=null,this):new nr}ur(nr.prototype,"clear",function(){return this._length=0,this._first=null,this._last=null,this});ur(nr.prototype,"first",function(){if(this._length)return this._first});ur(nr.prototype,"insert",function(e,t){var i;if(e===this._last)return this.push(t);for(i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return i=new ha(t),e._next._prev=i,i._next=e._next,e._next=i,i._prev=e,this._length+=1,this});ur(nr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=-1,e=this.toArray(),t={},ur(t,"next",u),ur(t,"return",s),cP&&ur(t,cP,o),t;function u(){return a+=1,n||a>=e.length?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});ur(nr.prototype,"last",function(){if(this._length)return this._last});hrr(nr.prototype,"length",function(){return this._length});ur(nr.prototype,"pop",function(){var e;return this._length&&(e=this._last.value,this._last._prev?(this._last=this._last._prev,this._last._next=null):(this._first=null,this._last=null),this._length-=1),e});ur(nr.prototype,"push",function(e){var t;return t=new ha(e),this._length===0?(this._first=t,this._last=t):(t._prev=this._last,this._last._next=t,this._last=t),this._length+=1,this});ur(nr.prototype,"remove",function(e){var t,i;if(e===this._first)return this.shift();if(e===this._last)return this.pop();for(t=e.value,i=this._first;i!==this._last&&i!==e;)i=i._next;if(i===this._last)throw new Error("invalid argument. The list does not contain the provided list node.");return e._prev._next=e._next,e._next._prev=e._prev,this._length-=1,t});ur(nr.prototype,"shift",function(){var e;return this._length&&(e=this._first.value,this._first._next?(this._first=this._first._next,this._first._prev=null):(this._first=null,this._last=null),this._length-=1),e});ur(nr.prototype,"toArray",function(){var e,t,i;for(t=[],e=this._first,i=0;i=0;y--)h=ser(m,c,g,u,y,oer),s=i.call(n,s,t(v(a,h),y,f),y,f);return s}v1.exports=ler});var c1=l(function(j_r,m1){"use strict";function ver(r,e,t,i,n){var a,u,s,o;for(a=r.data,u=r.accessors[0],s=e,o=a.length-1;o>=0;o--)s=i.call(n,s,t(u(a,o),o,a),o,a);return s}m1.exports=ver});var p1=l(function(C_r,h1){"use strict";var fer=require("@stdlib/assert/is-array-like-object"),mer=require("@stdlib/assert/is-ndarray-like"),g1=require("@stdlib/assert/is-function"),cer=require("@stdlib/ndarray/base/ndarraylike2object"),ger=require("@stdlib/array/base/arraylike2object"),wa=require("@stdlib/string/format"),her=f1(),per=c1();function der(r,e,t,i,n){if(!g1(t))throw new TypeError(wa("invalid argument. Third argument must be a function. Value: `%s`.",t));if(!g1(i))throw new TypeError(wa("invalid argument. Fourth argument must be a function. Value: `%s`.",i));if(mer(r))return her(cer(r),e,t,i,n);if(fer(r))return per(ger(r),e,t,i,n);throw new TypeError(wa("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}h1.exports=der});var y1=l(function(B_r,d1){"use strict";var yer=p1();d1.exports=yer});var ba=l(function(D_r,b1){"use strict";var q1=require("@stdlib/ndarray/base/vind2bind"),w1="throw";function qer(r,e,t,i){var n,a,u,s,o,v,f,m,c,g,h,y,q,_,E,P,A;if(o=r.length,c=r.shape,g=e.shape,n=r.data,a=e.data,h=r.strides,y=e.strides,q=r.offset,_=e.offset,u=r.order,s=e.order,v=r.accessors[0],f=e.accessors[1],m=r.ref,c.length===0){f(a,_,t.call(i,v(n,q),0,m));return}for(A=o-1;A>=0;A--)E=q1(c,h,q,u,A,w1),P=q1(g,y,_,s,A,w1),f(a,P,t.call(i,v(n,E),A,m))}b1.exports=qer});var _a=l(function(M_r,_1){"use strict";function wer(r,e,t,i){var n,a,u,s,o;for(n=r.data,a=e.data,u=r.accessors[0],s=e.accessors[1],o=n.length-1;o>=0;o--)s(a,o,t.call(i,u(n,o),o,n))}_1.exports=wer});var P1=l(function($_r,O1){"use strict";var ber=require("@stdlib/assert/is-array-like-object"),_er=require("@stdlib/assert/is-ndarray-like"),xer=require("@stdlib/assert/is-function"),Eer=require("@stdlib/array/base/zeros"),x1=require("@stdlib/ndarray/base/ndarraylike2object"),E1=require("@stdlib/array/base/arraylike2object"),Ter=require("@stdlib/ndarray/zeros"),T1=require("@stdlib/string/format"),Oer=ba(),Per=_a();function Aer(r,e,t){var i;if(!xer(e))throw new TypeError(T1("invalid argument. Second argument must be a function. Value: `%s`.",e));if(_er(r))return r=x1(r),i=Ter(r.shape,{dtype:"generic",order:r.order}),Oer(r,x1(i),e,t),i;if(ber(r))return i=Eer(r.length),Per(E1(r),E1(i),e,t),i;throw new TypeError(T1("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}O1.exports=Aer});var I1=l(function(W_r,k1){"use strict";var A1=require("@stdlib/assert/is-array-like-object"),xa=require("@stdlib/assert/is-ndarray-like"),Ver=require("@stdlib/assert/is-function"),V1=require("@stdlib/ndarray/base/ndarraylike2object"),F1=require("@stdlib/array/base/arraylike2object"),Fer=require("@stdlib/ndarray/base/maybe-broadcast-array"),ker=require("@stdlib/ndarray/base/assert/is-read-only"),yt=require("@stdlib/string/format"),Ier=ba(),Ser=_a();function Ler(r,e,t,i){var n,a;if(!Ver(t))throw new TypeError(yt("invalid argument. Third argument must be a function. Value: `%s`.",t));if(xa(r)){if(!xa(e))throw new TypeError(yt("invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.",e));if(ker(e))throw new Error("invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.");return e=V1(e),a=e.shape,n=V1(Fer(r,a)),n.ref=r,r=n,Ier(r,e,t,i),e.ref}if(A1(r)){if(!A1(e)||xa(e))throw new TypeError(yt("invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.",e));if(r.length!==e.length)throw new RangeError("invalid arguments. Input and output arrays must have the same length.");return Ser(F1(r),F1(e),t,i),e}throw new TypeError(yt("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}k1.exports=Ler});var N1=l(function(K_r,L1){"use strict";var Ner=k(),S1=P1(),Rer=I1();Ner(S1,"assign",Rer);L1.exports=S1});var C1=l(function(U_r,j1){"use strict";var jer=require("@stdlib/assert/is-function"),Cer=require("@stdlib/assert/has-own-property"),R1=require("@stdlib/string/format");function Ber(r,e){var t,i;if(typeof r!="object"||r===null)throw new TypeError(R1("invalid argument. First argument must be an object. Value: `%s`.",r));if(!jer(e))throw new TypeError(R1("invalid argument. Second argument must be a function. Value: `%s`.",e));t={};for(i in r)Cer(r,i)&&(t[i]=e(r[i],i,r));return t}j1.exports=Ber});var D1=l(function(z_r,B1){"use strict";var Der=C1();B1.exports=Der});var Oa=l(function(G_r,M1){"use strict";var Ea=require("@stdlib/ndarray/base/vind2bind"),Ta="throw";function Mer(r,e,t,i,n){var a,u,s,o,v,f,m,c,g,h,y,q,_,E,P,A,j,K,U,V,F,I,$,or,tr;if(P=r.length,q=r.shape,_=e.shape,E=t.shape,a=r.data,u=e.data,s=t.data,A=r.strides,j=e.strides,K=t.strides,U=r.offset,V=e.offset,F=t.offset,o=r.order,v=e.order,f=t.order,m=r.accessors[0],c=e.accessors[0],g=t.accessors[1],h=r.ref,y=e.ref,q.length===0&&_.length===0){g(s,F,i.call(n,m(a,U),c(u,V),0,[h,y]));return}for(tr=0;tr=0;tr--)I=La(q,A,U,o,tr,Na),$=La(_,j,V,v,tr,Na),or=La(E,K,F,f,tr,Na),g(s,or,i.call(n,m(a,I),c(u,$),tr,[h,y]))}rA.exports=itr});var ja=l(function(Z_r,eA){"use strict";function ntr(r,e,t,i,n){var a,u,s,o,v,f,m;for(a=r.data,u=e.data,s=t.data,o=r.accessors[0],v=e.accessors[0],f=t.accessors[1],m=a.length-1;m>=0;m--)f(s,m,i.call(n,o(a,m),v(u,m),m,[a,u]))}eA.exports=ntr});var uA=l(function(rxr,aA){"use strict";var tA=require("@stdlib/assert/is-array-like-object"),iA=require("@stdlib/assert/is-ndarray-like"),atr=require("@stdlib/assert/is-function"),utr=require("@stdlib/array/base/zeros"),Ca=require("@stdlib/ndarray/base/ndarraylike2object"),Ba=require("@stdlib/array/base/arraylike2object"),str=require("@stdlib/ndarray/zeros"),otr=require("@stdlib/ndarray/base/broadcast-shapes"),nA=require("@stdlib/ndarray/base/maybe-broadcast-array"),wt=require("@stdlib/string/format"),ltr=Ra(),vtr=ja();function ftr(r,e,t,i){var n,a,u,s,o;if(!atr(t))throw new TypeError(wt("invalid argument. Second argument must be a function. Value: `%s`.",t));if(n=iA(r),a=iA(e),n){if(!a)throw new TypeError(wt("invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.",e));if(o=otr([r.shape,e.shape]),o===null)throw new Error("invalid arguments. Input ndarrays must be broadcast compatible.");return s=Ca(nA(r,o)),s.ref=r,r=s,s=Ca(nA(e,o)),s.ref=e,e=s,u=str(o,{dtype:"generic",order:r.order}),ltr(r,e,Ca(u),t,i),u}if(tA(r)){if(a||!tA(e))throw new TypeError(wt("invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.",e));if(e.length!==r.length)throw new RangeError("invalid arguments. Input arrays must have the same length.");return u=utr(r.length),vtr(Ba(r),Ba(e),Ba(u),t,i),u}throw new TypeError(wt("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}aA.exports=ftr});var lA=l(function(exr,oA){"use strict";var Da=require("@stdlib/assert/is-array-like-object"),Ma=require("@stdlib/assert/is-ndarray-like"),mtr=require("@stdlib/assert/is-function"),$a=require("@stdlib/ndarray/base/ndarraylike2object"),Wa=require("@stdlib/array/base/arraylike2object"),sA=require("@stdlib/ndarray/base/maybe-broadcast-array"),ctr=require("@stdlib/ndarray/base/assert/is-read-only"),he=require("@stdlib/string/format"),gtr=Ra(),htr=ja();function ptr(r,e,t,i,n){var a,u,s,o,v;if(!mtr(i))throw new TypeError(he("invalid argument. Fourth argument must be a function. Value: `%s`.",i));if(a=Ma(r),u=Ma(e),s=Ma(t),a){if(!u)throw new TypeError(he("invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.",e));if(!s)throw new TypeError(he("invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.",t));if(ctr(t))throw new Error("invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.");return t=$a(t),v=t.shape,o=$a(sA(r,v)),o.ref=r,r=o,o=$a(sA(e,v)),o.ref=e,e=o,gtr(r,e,t,i,n),t.ref}if(Da(r)){if(u||!Da(e))throw new TypeError(he("invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.",e));if(s||!Da(t))throw new TypeError(he("invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.",t));if(r.length!==e.length||e.length!==t.length)throw new RangeError("invalid arguments. Input and output arrays must have the same length.");return htr(Wa(r),Wa(e),Wa(t),i,n),t}throw new TypeError(he("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}oA.exports=ptr});var mA=l(function(txr,fA){"use strict";var dtr=k(),vA=uA(),ytr=lA();dtr(vA,"assign",ytr);fA.exports=vA});var hA=l(function(ixr,gA){"use strict";var cA=require("@stdlib/assert/is-array-like-object"),qtr=require("@stdlib/assert/is-function"),Ka=require("@stdlib/string/format");function wtr(r,e,t){var i,n,a,u,s,o,v;if(!cA(r))throw new TypeError(Ka("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(!qtr(e))throw new TypeError(Ka("invalid argument. Second argument must be a function. Value: `%s`.",e));for(a=r.length,i=[],o=0;o1&&(a=Dir(n,e),a))throw a;function s(){var o,v,f,m,c;if(f=arguments.length,f<=0?m=Ur(t,n.dtype):f===1?Ha(arguments[0])?m=Ur(t,arguments[0]):TV(arguments[0])?m=Ur(arguments[0],0,t,n.dtype):m=Ur(arguments[0],n.dtype):f===2?TV(arguments[0])?Ha(arguments[1])?m=Ur(arguments[0],0,t,arguments[1]):m=Ur(arguments[0],arguments[1],t,n.dtype):m=Ur(arguments[0],arguments[1]):m=Ur(arguments[0],arguments[1],t,arguments[2]),m.length!==t)throw new RangeError(B("invalid arguments. Arguments are incompatible with the number of tuple fields. Number of fields: `%u`. Number of data elements: `%u`.",t,m.length));for(v=Nir(m),o=[],c=0;c=t?{done:!0}:{value:[x,i[o[x]],m[x]],done:!1}}function S(qe){return T=!0,arguments.length?{value:qe,done:!0}:{done:!0}}function ee(){return b.entries()}}function E(b,w){var T,x;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!sr(b))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",b));for(x=0;x1){if(w=arguments[0],!Zr(w))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",w));if(w>=t)return;w<0&&(w=t+w,w<0&&(w=0))}else w=0;for(;w=t))return i[o[b]]}function I(b){var w;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!Ha(b))throw new TypeError(B("invalid argument. First argument must be a string. Value: `%s`.",b));for(w=0;w=t?{done:!0}:{value:[x,i[o[x]]],done:!1}}function S(qe){return T=!0,arguments.length?{value:qe,done:!0}:{done:!0}}function ee(){return b.keys()}}function or(b){var w;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(arguments.length>1){if(w=arguments[1],!Zr(w))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",w));if(w>=t)w=t-1;else if(w<0&&(w=t+w,w<0))return}else w=t-1;for(;w>=0;w--)if(m[w]===b)return i[o[w]]}function tr(b,w){var T,x;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");if(!sr(b))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",b));for(T=s(v),x=0;x1?(w=arguments[1],T=0):(w=m[0],T=1);T1?(w=arguments[1],T=t-1):(w=m[t-1],T=t-2);T>=0;T--)w=b(w,m[T],T,i[o[T]],m);return w}function Qj(){var b,w,T;if(this!==m)throw new TypeError("invalid invocation. `this` is not host tuple.");for(w=0;wt&&(S=t)}if(O>=S)return null;for(x=[],T=[];Ot&&(O=t)}if(x>=O)return null;for(T=[],S=x;S1){if(g=arguments[1],!sr(g))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",g));m>2&&(f=arguments[2])}if(kir(v)){if(v.length!==t)throw new RangeError(B("invalid argument. Source is incompatible with the number of tuple fields. Number of fields: `%u`. Source length: `%u`.",t,v.length));if(c=s(t,n.dtype),g)for(q=0;q1){if(g=arguments[1],!sr(g))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",g));m>2&&(f=arguments[2])}if(c=s(t,n.dtype),g)for(y=0;y=0;a--){if(i=e.call(t,r[a],a,r),i)return!1;n!==r.length&&(a+=r.length-n,n=r.length)}return!0}XV.exports=vnr});var ZV=l(function(Wxr,HV){"use strict";var fnr=YV();HV.exports=fnr});var tF=l(function(Kxr,eF){"use strict";var mnr=G(),cnr=M(),rF=require("@stdlib/assert/is-nonenumerable-property");function gnr(r){var e,t,i,n;for(e=mnr(r),i=0,n=0;n1){if(!Xnr(e))throw new TypeError(eu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(kF(e,"duplicates")&&(t=e.duplicates,!Hnr(t)))throw new TypeError(eu("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",t))}if(i=Qnr(r),n=i.length,s={},t)for(v=0;v=a?u[s]=e[s-a]:u[s]=arguments[s];return r.apply(null,u)}}uk.exports=Iar});var lk=l(function(dEr,ok){"use strict";var Sar=sk();ok.exports=Sar});var mk=l(function(yEr,fk){"use strict";var vk=require("@stdlib/os/num-cpus");function Lar(){return{workers:vk-1,concurrency:vk-1,cmd:"node",ordered:!1,uid:null,gid:null,encoding:"buffer",maxBuffer:200*1024*1024}}fk.exports=Lar});var hk=l(function(qEr,gk){"use strict";var Nar=require("@stdlib/assert/is-plain-object"),re=require("@stdlib/assert/has-own-property"),ck=require("@stdlib/assert/is-positive-integer").isPrimitive,tu=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rar=require("@stdlib/assert/is-boolean").isPrimitive,jar=require("@stdlib/assert/is-string").isPrimitive,zr=require("@stdlib/string/format");function Car(r,e){return Nar(e)?re(e,"concurrency")&&(r.concurrency=e.concurrency,!ck(r.concurrency))?new TypeError(zr("invalid option. `%s` option must be a positive integer. Option: `%s`.","concurrency",r.concurrency)):re(e,"workers")&&(r.workers=e.workers,!ck(r.workers))?new TypeError(zr("invalid option. `%s` option must be a positive integer. Option: `%s`.","workers",r.workers)):re(e,"cmd")&&(r.cmd=e.cmd,!jar(r.cmd))?new TypeError(zr("invalid option. `%s` option must be a string. Option: `%s`.","cmd",r.cmd)):re(e,"ordered")&&(r.ordered=e.ordered,!Rar(r.ordered))?new TypeError(zr("invalid option. `%s` option must be a boolean. Option: `%s`.","ordered",r.ordered)):re(e,"uid")&&(r.uid=e.uid,!tu(r.uid))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","uid",r.uid)):re(e,"gid")&&(r.gid=e.gid,!tu(r.gid))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","gid",r.gid)):re(e,"maxBuffer")&&(r.maxBuffer=e.maxBuffer,!tu(r.maxBuffer))?new TypeError(zr("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","maxBuffer",r.maxBuffer)):null:new TypeError(zr("invalid argument. Options argument must be an object. Value: `%s`.",e))}gk.exports=Car});var yk=l(function(wEr,dk){"use strict";var Bar=z(),pk=require("@stdlib/process/env");function Dar(){var r,e,t,i;for(r=Bar(pk),t={},i=0;i=r.length){if(F=iu(a).length,F>0){er("%d scripts are pending.",F);return}return er("All scripts have finished."),P()}er("Instructing child process to run script: %s. pid: %d.",r[m],V.pid),V.send(r[m]),a[r[m]]=!0,er("%d of %d scripts have been processed.",m,r.length)}function y(V){return F;function F(I){er("Child process message: %s. pid: %d.",I,V.pid),delete a[I],h(V)}}function q(V){return F;function F(I,$){er("Child process closed. Code: %d. Signal: %s. pid: %d.",I,$,V.pid),K(I,$),_()}}function _(){i+=1,er("%d of %d child processes have closed.",i,e.workers),i===e.workers&&U()}function E(V){return F;function F(I,$){er("Child process exited. Code: %d. Signal: %s. pid: %d.",I,$,V.pid),K(I,$)}}function P(V){var F,I,$;for(V&&!c&&(c=V),er("Instructing child processes to close..."),F=iu(n),$=0;$2){if(r=arguments[1],i=arguments[2],n=iur(t,r),n)throw n}else i=arguments[1];if(!rur(i))throw new TypeError(Ok("invalid argument. Callback argument must be a function. Value: `%s`.",i));for(t.concurrency>e.length&&(t.concurrency=e.length),t.workers>t.concurrency&&(t.workers=t.concurrency),a=eur(),u=0;u1&&!our(e))throw new TypeError(kk("invalid argument. Reviver argument must be a function. Value: `%s`.",e));try{return JSON.parse(r,e)}catch(t){return t}}Ik.exports=lur});var Nk=l(function(PEr,Lk){"use strict";var vur=Sk();Lk.exports=vur});var Bk=l(function(AEr,Ck){"use strict";var fur=require("@stdlib/assert/is-string").isPrimitive,mur=require("@stdlib/assert/is-string-array").primitives,Rk=require("@stdlib/assert/has-own-property"),jk=require("@stdlib/string/format");function cur(r,e){var t,i,n;if(typeof r!="object"||r===null)throw new TypeError(jk("invalid argument. First argument must be an object. Value: `%s`.",r));if(t={},fur(e))return Rk(r,e)&&(t[e]=r[e]),t;if(mur(e)){for(n=0;n2&&(a=Sur(i,t),a))throw a;for(i.copy?n=new Array(r.length):n=r,s=0;s=0)return $ur(r);throw new TypeError(Mur("invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.",r))}vI.exports=Kur});var cI=l(function(MEr,mI){"use strict";var Uur=fI();mI.exports=Uur});var hI=l(function($Er,gI){"use strict";function zur(r,e){var t;for(t=e.length-1;t>=0;t--)r.unshift(e[t]);return r}gI.exports=zur});var dI=l(function(WEr,pI){"use strict";function Gur(r,e){var t,i,n;for(t=r.length,i=e.length,n=t-1;n>=0;n--)r[n+i]=r[n];for(n=0;n=0)return tsr(r,e);throw new TypeError(wI("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}bI.exports=nsr});var EI=l(function(zEr,xI){"use strict";var asr=_I();xI.exports=asr});var OI=l(function(GEr,TI){"use strict";var usr=G(),ssr=M();function osr(r){var e,t,i;for(e=usr(r),t=ssr(r),i=0;i=0)return Wsr(r,e);throw new TypeError(Msr("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}ZI.exports=Usr});var tS=l(function(sTr,eS){"use strict";var zsr=rS();eS.exports=zsr});var nS=l(function(oTr,iS){"use strict";var Gsr=require("@stdlib/string/format"),Qsr=require("@stdlib/constants/float16/max"),Jsr=require("@stdlib/constants/float32/max"),Xsr=require("@stdlib/constants/float64/max");function Ysr(r){switch(r){case"float64":return Xsr;case"float32":return Jsr;case"float16":return Qsr;default:throw new TypeError(Gsr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}iS.exports=Ysr});var uS=l(function(lTr,aS){"use strict";var Hsr=nS();aS.exports=Hsr});var oS=l(function(vTr,sS){"use strict";var Zsr=require("@stdlib/string/format"),ror=require("@stdlib/constants/float16/smallest-normal"),eor=require("@stdlib/constants/float32/smallest-normal"),tor=require("@stdlib/constants/float64/smallest-normal");function ior(r){switch(r){case"float64":return tor;case"float32":return eor;case"float16":return ror;default:throw new TypeError(Zsr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}sS.exports=ior});var vS=l(function(fTr,lS){"use strict";var nor=oS();lS.exports=nor});var mS=l(function(mTr,fS){"use strict";var aor=require("@stdlib/ndarray/base/vind2bind"),uor="throw";function sor(r,e,t,i){var n,a,u,s,o,v,f,m,c,g,h;if(s=r.length,f=r.shape,n=r.data,m=r.strides,c=r.offset,a=r.order,o=r.accessors[0],v=r.ref,f.length===0)return t.call(i,e,o(n,c),0,v);for(u=e,h=0;h=0;h--)g=qor(f,m,c,a,h,wor),u=t.call(i,u,o(n,g),h,v);return u}wS.exports=bor});var xS=l(function(dTr,_S){"use strict";function _or(r,e,t,i){var n,a,u,s;for(n=r.data,a=r.accessors[0],u=e,s=n.length-1;s>=0;s--)u=t.call(i,u,a(n,s),s,n);return u}_S.exports=_or});var OS=l(function(yTr,TS){"use strict";var xor=require("@stdlib/assert/is-array-like-object"),Eor=require("@stdlib/assert/is-ndarray-like"),Tor=require("@stdlib/assert/is-function"),Oor=require("@stdlib/ndarray/base/ndarraylike2object"),Por=require("@stdlib/array/base/arraylike2object"),ES=require("@stdlib/string/format"),Aor=bS(),Vor=xS();function For(r,e,t,i){if(!Tor(t))throw new TypeError(ES("invalid argument. Third argument must be a function. Value: `%s`.",t));if(Eor(r))return Aor(Oor(r),e,t,i);if(xor(r))return Vor(Por(r),e,t,i);throw new TypeError(ES("invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.",r))}TS.exports=For});var AS=l(function(qTr,PS){"use strict";var kor=OS();PS.exports=kor});var kS=l(function(wTr,FS){"use strict";var VS=require("@stdlib/assert/is-array-like-object"),Ior=require("@stdlib/assert/is-collection"),Sor=require("@stdlib/assert/is-function"),Vt=require("@stdlib/string/format");function Lor(r,e,t,i){var n,a,u,s,o,v,f;if(!VS(r))throw new TypeError(Vt("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(!VS(e))throw new TypeError(Vt("invalid argument. Second argument must be an array-like object. Value: `%s`.",e));if(e.length!==r.length)throw new RangeError("invalid argument. Second argument must have a length equal to the size of the outermost input array dimension.");if(!Sor(t))throw new TypeError(Vt("invalid argument. Third argument must be a function. Value: `%s`.",t));for(u=r.length,n=[],v=0;v=0)return vlr(r);throw new TypeError(llr("invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.",r))}uL.exports=mlr});var lL=l(function(NTr,oL){"use strict";var clr=sL();oL.exports=clr});var fL=l(function(RTr,vL){"use strict";var glr=require("@stdlib/string/format"),hlr=require("@stdlib/constants/int8/num-bytes"),plr=require("@stdlib/constants/uint8/num-bytes"),dlr=require("@stdlib/constants/int16/num-bytes"),ylr=require("@stdlib/constants/uint16/num-bytes"),qlr=require("@stdlib/constants/int32/num-bytes"),wlr=require("@stdlib/constants/uint32/num-bytes"),blr=require("@stdlib/constants/float16/num-bytes"),_lr=require("@stdlib/constants/float32/num-bytes"),xlr=require("@stdlib/constants/float64/num-bytes"),Elr=require("@stdlib/constants/complex64/num-bytes"),Tlr=require("@stdlib/constants/complex128/num-bytes");function Olr(r){switch(r){case"float64":return xlr;case"int32":return qlr;case"uint32":return wlr;case"float32":return _lr;case"int8":return hlr;case"uint8":case"uint8c":return plr;case"int16":return dlr;case"uint16":return ylr;case"float16":return blr;case"complex128":return Tlr;case"complex64":return Elr;default:throw new TypeError(glr("invalid argument. Must provide a recognized type. Value: `%s`.",r))}}vL.exports=Olr});var cL=l(function(jTr,mL){"use strict";var Plr=fL();mL.exports=Plr});var pL=l(function(CTr,hL){"use strict";var Alr=require("@stdlib/assert/is-collection"),Vlr=require("@stdlib/assert/is-positive-integer").isPrimitive,gL=require("@stdlib/string/format");function Flr(r,e){var t,i,n;if(!Alr(r))throw new TypeError(gL("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!Vlr(e))throw new TypeError(gL("invalid argument. Second argument must be a positive integer. Value: `%s`.",e));for(i=r.length,t=0,n=0;n=0;s--){if(a=t.call(i,r[s],s,r),a&&(n+=1,n===e))return!0;u!==r.length&&(s+=r.length-u,u=r.length)}return!1}xL.exports=Dlr});var OL=l(function(WTr,TL){"use strict";var Mlr=EL();TL.exports=Mlr});var VL=l(function(KTr,AL){"use strict";var pr=k(),$lr=Tr(),PL=require("@stdlib/symbol/iterator");function mr(){return this instanceof mr?(this._buffer=[],this):new mr}pr(mr.prototype,"clear",function(){return this._buffer.length=0,this});pr(mr.prototype,"first",function(){if(this._buffer.length)return this._buffer[this._buffer.length-1]});pr(mr.prototype,"iterator",function(){var e,t,i,n,a;return i=this,a=this._buffer.length,e=this._buffer.slice(),t={},pr(t,"next",u),pr(t,"return",s),PL&&pr(t,PL,o),t;function u(){return a-=1,n||a<0?{done:!0}:{value:e[a],done:!1}}function s(v){return n=!0,arguments.length?{value:v,done:!0}:{done:!0}}function o(){return i.iterator()}});pr(mr.prototype,"last",function(){if(this._buffer.length)return this._buffer[0]});$lr(mr.prototype,"length",function(){return this._buffer.length});pr(mr.prototype,"pop",function(){if(this._buffer.length)return this._buffer.pop()});pr(mr.prototype,"push",function(e){return this._buffer.push(e),this});pr(mr.prototype,"toArray",function(){var e,t;for(e=[],t=this._buffer.length-1;t>=0;t--)e.push(this._buffer[t]);return e});pr(mr.prototype,"toJSON",function(){var e={};return e.type="stack",e.data=this.toArray(),e});AL.exports=mr});var kL=l(function(UTr,FL){"use strict";var Wlr=VL();FL.exports=Wlr});var SL=l(function(zTr,IL){"use strict";var Klr=require("@stdlib/assert/is-collection"),Ulr=H(),zlr=require("@stdlib/string/format");function Glr(r){var e,t,i,n,a,u,s;if(!Klr(r))throw new TypeError(zlr("invalid argument. First argument must be a collection. Value: `%s`.",r));for(e=0,t=[],n=[],i=r.length,u=0;u1?t=e:t=null,i;function i(){var n,a,u;for(a=arguments.length,n=new Array(a),u=0;u2){if(n=e,i=t,!ZN(n))throw new TypeError(Ne("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else ZN(e)?n=e:(n=null,i=e);return a;function a(){var u,s;if(u=r,n){if(n>arguments.length)throw new Error(Ne("insufficient arguments. Expected %u argument(s) and only received %u argument(s).",n,arguments.length));for(s=0;s2){if(n=e,i=t,!nR(n))throw new TypeError(Re("invalid argument. Arity argument must be a positive integer. Value: `%s`.",n))}else nR(e)?n=e:(n=null,i=e);return a;function a(){var u,s;if(u=r,n){if(n>arguments.length)throw new Error(Re("insufficient arguments. Expected %u argument(s) and only received %u argument(s).",n,arguments.length));for(s=n-1;s>=0;s--)if(mu(u))u=u.call(i,arguments[s]);else throw new Error(Re("invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.",n,s));return u}for(s=arguments.length-1;s>=0;s--)if(mu(u))u=u.call(i,arguments[s]);else throw new Error(Re("invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.",arguments.length,s));return u}}aR.exports=Ffr});var oR=l(function(A0r,sR){"use strict";var kfr=uR();sR.exports=kfr});var vR=l(function(V0r,lR){"use strict";function Ifr(r,e){var t;for(t=e.length-1;t>=0;t--)r.unshift(e[t]);return r}lR.exports=Ifr});var mR=l(function(F0r,fR){"use strict";function Sfr(r,e){var t,i,n;for(t=r.length,i=e.length,n=t-1;n>=0;n--)r[n+i]=r[n];for(n=0;n=0)return $fr(r,e);throw new TypeError(Dfr("invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.",r))}hR.exports=Kfr});var yR=l(function(S0r,dR){"use strict";var Ufr=pR();dR.exports=Ufr});var _R=l(function(L0r,bR){"use strict";var qR=require("@stdlib/assert/is-function"),wR=require("@stdlib/string/format");function zfr(r,e,t){var i;if(!qR(r))throw new TypeError(wR("invalid argument. First argument must be a function. Value: `%s`.",r));if(!qR(e))throw new TypeError(wR("invalid argument. Second argument must be a function. Value: `%s`.",e));for(i=0;!r(i);)e.call(t,i),i+=1}bR.exports=zfr});var ER=l(function(N0r,xR){"use strict";var Gfr=_R();xR.exports=Gfr});var PR=l(function(R0r,OR){"use strict";var Qfr=require("@stdlib/assert/is-collection"),TR=require("@stdlib/assert/is-function"),cu=require("@stdlib/string/format");function Jfr(r,e,t,i){var n,a;if(!Qfr(r))throw new TypeError(cu("invalid argument. First argument must be a collection. Value: `%s`.",r));if(!TR(e))throw new TypeError(cu("invalid argument. Second argument must be a function. Value: `%s`.",e));if(!TR(t))throw new TypeError(cu("invalid argument. Third argument must be a function. Value: `%s`.",t));for(n=r.length,a=0;a=0&&!e(r[a],a,r);)t.call(i,r[a],a,r),n!==r.length&&(a+=r.length-n,n=r.length),a-=1;return r}kR.exports=Hfr});var LR=l(function(B0r,SR){"use strict";var Zfr=IR();SR.exports=Zfr});var RR=l(function(D0r,NR){"use strict";var rmr=require("@stdlib/assert/is-integer"),hu=require("@stdlib/assert/is-array");function emr(r,e){var t,i,n,a,u,s,o;if(!hu(r))throw new TypeError("invalid argument. Must provide a zipped array.");for(i=r.length,u=0;u1){if(!hu(e))throw new TypeError("invalid argument. Indices must be specified as an array.");for(u=0;ut)throw new Error("invalid argument. Must provide valid indices (i.e., must be a nonnegative integer less than or equal to the tuple length).")}t=e.length}else for(e=new Array(t),u=0;u=0&&e(r[a],a,r);)t.call(i,r[a],a,r),n!==r.length&&(a+=r.length-n,n=r.length),a-=1;return r}lj.exports=_mr});var mj=l(function(Z0r,fj){"use strict";var xmr=vj();fj.exports=xmr});var hj=l(function(rOr,gj){"use strict";var Emr=G(),Tmr=M(),cj=require("@stdlib/assert/is-writable-property");function Omr(r){var e,t,i,n;for(e=Emr(r),i=0,n=0;nu&&(u=v);for(o=new Array(u),m=0;m\n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasDefinePropertySupport;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils/define-property\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nvar hasDefinePropertySupport = require( './has_define_property_support.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-only property.\n*\n* @module @stdlib/utils/define-read-only-property\n*\n* @example\n* var setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n*\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection is truthy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether at least one element is truthy\n*\n* @example\n* var arr = [ 0, 0, 0, 0, 1 ];\n*\n* var bool = any( arr );\n* // returns true\n*/\nfunction any( collection ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( collection[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = any;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection is truthy.\n*\n* @module @stdlib/utils/any\n*\n* @example\n* var any = require( '@stdlib/utils/any' );\n*\n* var arr = [ 0, 0, 0, 0, 1 ];\n*\n* var bool = any( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4, -1 ];\n*\n* var bool = anyBy( arr, isNegative );\n* // returns true\n*/\nfunction anyBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @module @stdlib/utils/any-by\n*\n* @example\n* var anyBy = require( '@stdlib/utils/any-by' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4, -1 ];\n*\n* var bool = anyBy( arr, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, 2, 3, 4 ];\n*\n* var bool = anyByRight( arr, isNegative );\n* // returns true\n*/\nfunction anyByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/any-by-right\n*\n* @example\n* var anyByRight = require( '@stdlib/utils/any-by-right' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, 2, 3, 4 ];\n*\n* var bool = anyByRight( arr, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( arr, items ) {\n\tvar i;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tarr.push( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = append( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 1.0, '1': 2.0, '2': 3.0, '3': 4.0 }\n*/\nfunction append( obj, items ) {\n\tvar len;\n\tvar i;\n\tlen = obj.length;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tobj[ len+i ] = items[ i ];\n\t}\n\tobj.length = len + items.length;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is followed by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\ttotal = nbytes + ibytes + arr.byteOffset;\n\n\tif ( arr.buffer.byteLength < total ) {\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\tv = new arr.constructor( buf, 0, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i ] = arr[ i ];\n\t\t}\n\t} else {\n\t\tv = new arr.constructor( arr.buffer, arr.byteOffset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ len+i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar appendArray = require( './append_array.js' );\nvar appendObject = require( './append_object.js' );\nvar appendTypedArray = require( './append_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the end of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn appendArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn appendTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn appendObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add the elements of one collection to the end of another collection.\n*\n* @module @stdlib/utils/append\n*\n* @example\n* var append = require( '@stdlib/utils/append' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function which always returns a specified argument.\n*\n* @param {NonNegativeInteger} idx - argument index\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Function} argument function\n*\n* @example\n* var argn = wrap( 1 );\n*\n* var v = argn( 1.0, 2.0, 3.0 );\n* // returns 2.0\n*\n* v = argn( 'a', 'b', 'c' );\n* // returns 'b'\n*\n* v = argn( null );\n* // returns undefined\n*/\nfunction wrap( idx ) {\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\treturn argn;\n\n\t/**\n\t* Argument function.\n\t*\n\t* @private\n\t* @returns {*} argument\n\t*/\n\tfunction argn() {\n\t\treturn arguments[ idx ];\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function which always returns a specified argument.\n*\n* @module @stdlib/utils/argument-function\n*\n* @example\n* var argumentFunction = require( '@stdlib/utils/argument-function' );\n*\n* var argn = argumentFunction( 1 );\n*\n* var v = argn( 1.0, 2.0, 3.0 );\n* // returns 2.0\n*\n* v = argn( 'a', 'b', 'c' );\n* // returns 'b'\n*\n* v = argn( null );\n* // returns undefined\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only property.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-property\n*\n* @example\n* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'any-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `anyByAsync` function which invokes the predicate function for each collection element sequentially:\n* var anyByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* anyByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn anyByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction anyByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* anyByAsync( files, predicate, done );\n*/\nfunction anyByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/any-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var anyByAsync = require( '@stdlib/utils/async/any-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* anyByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'any-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `anyByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var anyByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* anyByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn anyByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction anyByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* anyByRightAsync( files, predicate, done );\n*/\nfunction anyByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/any-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var anyByRightAsync = require( '@stdlib/utils/async/any-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* anyByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = indexOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the first index at which a given element can be found.\n*\n* @module @stdlib/utils/index-of\n*\n* @example\n* var indexOf = require( '@stdlib/utils/index-of' );\n*\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* arr = [ 4, 3, 2, 1 ];\n* idx = indexOf( arr, 5 );\n* // returns -1\n*\n* // Using a `fromIndex`:\n* arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* // `fromIndex` which exceeds `array` length:\n* arr = [ 1, 2, 3, 4, 2, 5 ];\n* idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* // Negative `fromIndex`:\n* arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* // Negative `fromIndex` exceeding input `array` length:\n* arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* // Array-like objects:\n* var str = 'bebop';\n* idx = indexOf( str, 'o' );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar indexOf = require( './../../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10,\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'bifurcate-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {string} [options.returns] - output format\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = [];\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tout.push( [], [] );\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, v, cb );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [bool] - group indicator\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, bool ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, ( bool ) ? '0' : '1' );\n\n\t\t\t// Default is to return values...\n\t\t\tif ( opts.returns === 'indices' ) {\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tout[ 0 ].push( j );\n\t\t\t\t} else {\n\t\t\t\t\tout[ 1 ].push( j );\n\t\t\t\t}\n\t\t\t} else if ( opts.returns === '*' ) {\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tout[ 0 ].push( [ j, v ] );\n\t\t\t\t} else {\n\t\t\t\t\tout[ 1 ].push( [ j, v ] );\n\t\t\t\t}\n\t\t\t} else if ( bool ) {\n\t\t\t\tout[ 0 ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( v );\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function which splits values into two groups according to a predicate function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `bifurcateByAsync` function which invokes the predicate function for each collection element sequentially:\n* var bifurcateByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* bifurcateByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn bifurcateByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction bifurcateByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} results - bifurcation results\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, results ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, results );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* bifurcateByAsync( files, predicate, done );\n*/\nfunction bifurcateByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/async/bifurcate-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* bifurcateByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function composition.\n*\n* @param {...Function} f - functions to compose\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} composite function\n*\n* @example\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = composeAsync( c, b, a );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\nfunction composeAsync() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to compose.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn composite;\n\n\t/**\n\t* Composite function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @param {Callback} done - callback to invoke after invoking all functions\n\t*/\n\tfunction composite() {\n\t\tvar done;\n\t\tvar args;\n\t\tvar i;\n\n\t\t// Cache the callback function:\n\t\tdone = arguments[ arguments.length-1 ];\n\n\t\t// Copy arguments which should be provided to the first invoked function...\n\t\targs = new Array( arguments.length-1 );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\t// Append the callback an invoked function should call upon completion:\n\t\targs.push( next );\n\n\t\t// Start invoking provided functions:\n\t\ti = nFuncs - 1;\n\t\tf[ i ].apply( null, args );\n\n\t\t/**\n\t\t* Callback invoked upon completion of a composed function.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {*} result - result to pass to next function\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\ti -= 1;\n\t\t\tif ( i < 0 ) {\n\t\t\t\treturn done( null, result );\n\t\t\t}\n\t\t\tf[ i ]( result, next );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = composeAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function composition.\n*\n* @module @stdlib/utils/async/compose\n*\n* @example\n* var composeAsync = require( '@stdlib/utils/async/compose' );\n*\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = composeAsync( c, b, a );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'count-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\tout[ group ] += 1;\n\t\t\t} else {\n\t\t\t\tout[ group ] = 1;\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for grouping values according to an indicator function and returns group counts.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `countByAsync` function which invokes the indicator function for each collection element sequentially:\n* var countByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* countByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn countByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction countByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - counts\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and returns group counts.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* countByAsync( files, indicator, done );\n*/\nfunction countByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = countByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function and return group counts.\n*\n* @module @stdlib/utils/async/count-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var countByAsync = require( '@stdlib/utils/async/count-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* countByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doUntilAsync( fcn, predicate, done );\n*/\nfunction doUntilAsync( fcn, predicate, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tfcn.call( thisArg, idx, next );\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/async/do-until\n*\n* @example\n* var doUntilAsync = require( '@stdlib/utils/async/do-until' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doUntilAsync( fcn, predicate, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doWhileAsync( fcn, predicate, done );\n*/\nfunction doWhileAsync( fcn, predicate, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tfcn.call( thisArg, idx, next );\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/async/do-while\n*\n* @example\n* var doWhileAsync = require( '@stdlib/utils/async/do-while' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doWhileAsync( fcn, predicate, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'every-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( !result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `everyByAsync` function which invokes the predicate function for each collection element sequentially:\n* var everyByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* everyByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn everyByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction everyByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* everyByAsync( files, predicate, done );\n*/\nfunction everyByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/every-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var everyByAsync = require( '@stdlib/utils/async/every-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* everyByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'every-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions, and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( !result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `everyByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var everyByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* everyByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn everyByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction everyByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* everyByRightAsync( files, predicate, done );\n*/\nfunction everyByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/every-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var everyByRightAsync = require( '@stdlib/utils/async/every-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* everyByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'for-each-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `forEachAsync` function which invokes `read` for each collection element sequentially:\n* var forEachAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* // Run `read` for each element in `files`:\n* forEachAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn forEachAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction forEachAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* forEachAsync( files, read, done );\n*/\nfunction forEachAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/async/for-each\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var forEachAsync = require( '@stdlib/utils/async/for-each' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* forEachAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'for-each-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `forEachRightAsync` function which invokes `read` for each collection element sequentially:\n* var forEachRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* // Run `read` for each element in `files`:\n* forEachRightAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn forEachRightAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction forEachRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* forEachRightAsync( files, read, done );\n*/\nfunction forEachRightAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/async/for-each-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var forEachRightAsync = require( '@stdlib/utils/async/for-each-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* forEachRightAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function sequence.\n*\n* @param {...Function} f - functions to evaluate in sequential order\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} pipeline function\n*\n* @example\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = funseqAsync( a, b, c );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\nfunction funseqAsync() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn pipeline;\n\n\t/**\n\t* Pipeline function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @param {Callback} done - callback to invoke after invoking all functions\n\t*/\n\tfunction pipeline() {\n\t\tvar done;\n\t\tvar args;\n\t\tvar i;\n\n\t\t// Cache the callback function:\n\t\tdone = arguments[ arguments.length-1 ];\n\n\t\t// Copy arguments which should be provided to the first invoked function...\n\t\targs = new Array( arguments.length-1 );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\t// Append the callback an invoked function should call upon completion:\n\t\targs.push( next );\n\n\t\t// Start invoking provided functions:\n\t\ti = 0;\n\t\tf[ i ].apply( null, args );\n\n\t\t/**\n\t\t* Callback invoked upon completion of a provided function.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {*} result - result to pass to next function\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\ti += 1;\n\t\t\tif ( i === nFuncs ) {\n\t\t\t\treturn done( null, result );\n\t\t\t}\n\t\t\tf[ i ]( result, next );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = funseqAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function sequence.\n*\n* @module @stdlib/utils/async/function-sequence\n*\n* @example\n* var funseqAsync = require( '@stdlib/utils/async/function-sequence' );\n*\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = funseqAsync( a, b, c );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar indexOf = require( './../../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10,\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'group-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {string} [options.returns] - output format\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Default is to return values...\n\t\t\tif ( opts.returns === 'indices' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( j );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ j ];\n\t\t\t\t}\n\t\t\t} else if ( opts.returns === '*' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( [ j, v ] );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ [ j, v ] ];\n\t\t\t\t}\n\t\t\t} else if ( hasOwnProp( out, group ) ) {\n\t\t\t\tout[ group ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ group ] = [ v ];\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for grouping values according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `groupByAsync` function which invokes the indicator function for each collection element sequentially:\n* var groupByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* groupByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn groupByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction groupByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - group-by result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* groupByAsync( files, indicator, done );\n*/\nfunction groupByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function.\n*\n* @module @stdlib/utils/async/group-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var groupByAsync = require( '@stdlib/utils/async/group-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* groupByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a predicate function returns a truthy value, returns `x`; otherwise, returns `y`.\n*\n* @param {Function} predicate - predicate function\n* @param {*} x - value to return if a condition is truthy\n* @param {*} y - value to return if a condition is falsy\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifelseAsync( predicate, 1.0, -1.0, done );\n*/\nfunction ifelseAsync( predicate, x, y, done ) {\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tpredicate( clbk );\n\n\t/**\n\t* Callback invoked by a predicate function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} bool - condition\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, bool ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( bool ) {\n\t\t\treturn done( null, x );\n\t\t}\n\t\tdone( null, y );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifelseAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a predicate function returns a truthy value, return `x`; otherwise, return `y`.\n*\n* @module @stdlib/utils/async/if-else\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifelseAsync = require( '@stdlib/utils/async/if-else' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifelseAsync( predicate, 1.0, -1.0, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a predicate function returns a truthy value, invokes `x`; otherwise, invokes `y`.\n*\n* @param {Function} predicate - predicate function\n* @param {Function} x - function to invoke if a condition is truthy\n* @param {Function} y - function to invoke if a condition is falsy\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, 1.0 );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifthenAsync( predicate, x, y, done );\n*/\nfunction ifthenAsync( predicate, x, y, done ) {\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tpredicate( clbk1 );\n\n\t/**\n\t* Callback invoked by a predicate function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} bool - condition\n\t* @returns {void}\n\t*/\n\tfunction clbk1( error, bool ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( bool ) {\n\t\t\treturn x( clbk2 );\n\t\t}\n\t\ty( clbk2 );\n\t}\n\n\t/**\n\t* Callback invoked by either `x` or `y`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - results\n\t* @returns {void}\n\t*/\n\tfunction clbk2( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifthenAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a predicate function returns a truthy value, invoke `x`; otherwise, invoke `y`.\n*\n* @module @stdlib/utils/async/if-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifthenAsync = require( '@stdlib/utils/async/if-then' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, 1.0 );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifthenAsync( predicate, x, y, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'inmap-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions, and updates a collection in-place.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection and to update the collection in-place.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `inmapAsync` function which invokes `read` for each collection element sequentially:\n* var inmapAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* // Run `read` for each element in `files`:\n* inmapAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn inmapAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection and updates a collection in-place.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction inmapAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, collection );\n\t\t\t}\n\t\t\tdone( null, collection );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates a collection in-place.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* inmapAsync( files, read, done );\n*/\nfunction inmapAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update a collection in-place.\n*\n* @module @stdlib/utils/async/inmap\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var inmapAsync = require( '@stdlib/utils/async/inmap' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* inmapAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'inmap-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left, and updates a collection in-place.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx -= 1;\n\t\tj = idx;\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection and to update the collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `inmapRightAsync` function which invokes `read` for each collection element sequentially:\n* var inmapRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* // Run `read` for each element in `files`:\n* inmapRightAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn inmapRightAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection and updates a collection in-place, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction inmapRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, collection );\n\t\t\t}\n\t\t\tdone( null, collection );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates a collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* inmapRightAsync( files, read, done );\n*/\nfunction inmapRightAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update a collection in-place, iterating from right to left.\n*\n* @module @stdlib/utils/async/inmap-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var inmapRightAsync = require( '@stdlib/utils/async/inmap-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* inmapRightAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before the next invocation\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-function-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times, limiting the number of concurrently pending invocations, and returns an array of accumulated function return values.\n*\n* @private\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( n, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar out;\n\tvar lim;\n\tvar idx;\n\tvar m;\n\tvar i;\n\n\tdebug( 'Number of invocations: %d', n );\n\n\t// Note: we explicitly preallocate in order to facilitate inserting a function result into its associated output array index. This means we do not ensure \"fast\" elements for large output arrays.\n\tout = new Array( n );\n\tif ( n === 0 ) {\n\t\tdebug( 'Finished invoking a function.' );\n\t\treturn done( null, out );\n\t}\n\tif ( n < opts.limit ) {\n\t\tlim = n;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\n\tcount = 0;\n\tidx = -1;\n\tm = n - 1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all invocations...\n\t\tif ( idx < m ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to process the next function invocation.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\tdebug( 'Invocation number: %d', j );\n\t\tfcn.call( opts.thisArg, j, cb );\n\n\t\t/**\n\t\t* Callback invoked once a provided function completes.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further invocations:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tout[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next invocation.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Completed invocation %d of %d.', count, n );\n\t\tif ( idx < m ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === n ) {\n\t\t\tdebug( 'Finished invoking a function.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function `n` times and return an array of accumulated function return values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function again\n* @param {Function} fcn - function to invoke\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes a function `n` times and returns an array of accumulated function return values\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* var mapFunAsync = factory( opts, fcn );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* mapFunAsync( 10, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapFunAsync;\n\n\t/**\n\t* Invokes a function `n` times and returns an array of accumulated function return values.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} n - number of function invocations\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapFunAsync( n, done ) {\n\t\tif ( !isNonNegativeInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Number of function invocations must be a nonnegative integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {Array} results - results\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, results ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, results );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times and returns an array of accumulated function return values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Function} fcn - function to invoke\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function again\n* @param {Function} done - callback to invoke upon invoking a function `n` times\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( JSON.stringify( out ) );\n* // => [ 0, 1, 2, 3, 4 ]\n* }\n*\n* mapFunAsync( fcn, 5, done );\n*/\nfunction mapFunAsync( fcn, n, options, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( fcn )( n, options );\n\t}\n\tfactory( options, fcn )( n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapFunAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function `n` times and return an array of accumulated function return values.\n*\n* @module @stdlib/utils/async/map-function\n*\n* @example\n* var mapFunAsync = require( '@stdlib/utils/async/map-function' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( JSON.stringify( out ) );\n* // => [ 0, 1, 2, 3, 4 ]\n* }\n*\n* mapFunAsync( fcn, 5, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keys = require( './builtin.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = check;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArguments = require( '@stdlib/assert/is-arguments' );\nvar builtin = require( './builtin.js' );\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nmodule.exports = noop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @module @stdlib/utils/noop\n*\n* @example\n* var noop = require( '@stdlib/utils/noop' );\n*\n* noop();\n* // ...does nothing.\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar noop = require( './../../noop' );\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nmodule.exports = RE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof global === 'object' ) ? global : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar getThis = require( './codegen.js' );\nvar Self = require( './self.js' );\nvar Win = require( './window.js' );\nvar Global = require( './global.js' );\nvar GlobalThis = require( './global_this.js' );\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: Node.js\n\tif ( Global ) {\n\t\treturn Global;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the global object.\n*\n* @module @stdlib/utils/global\n*\n* @example\n* var getGlobal = require( '@stdlib/utils/global' );\n*\n* var g = getGlobal();\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getGlobal = require( './../../../global' );\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nmodule.exports = nodeList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = typedarray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar RE = require( './fixtures/re.js' );\nvar nodeList = require( './fixtures/nodelist.js' );\nvar typedarray = require( './fixtures/typedarray.js' );\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = check;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nmodule.exports = toStr;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Symbol = require( '@stdlib/symbol/ctor' );\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nmodule.exports = toStrTag;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar toStringTag = require( './tostringtag.js' );\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils/native-class\n*\n* @example\n* var nativeClass = require( '@stdlib/utils/native-class' );\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nvar hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( './../../native-class' );\nvar RE = require( '@stdlib/regexp/function-name' ).REGEXP;\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nmodule.exports = constructorName;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine the name of a value's constructor.\n*\n* @module @stdlib/utils/constructor-name\n*\n* @example\n* var constructorName = require( '@stdlib/utils/constructor-name' );\n*\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* v = constructorName( {} );\n* // returns 'Object'\n*\n* v = constructorName( true );\n* // returns 'Boolean'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils/type-of\n*\n* @example\n* var typeOf = require( '@stdlib/utils/type-of' );\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nvar usePolyfill = require( './check.js' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isConstructorPrototype;\n", "[\n\t\"console\",\n\t\"external\",\n\t\"frame\",\n\t\"frameElement\",\n\t\"frames\",\n\t\"innerHeight\",\n\t\"innerWidth\",\n\t\"outerHeight\",\n\t\"outerWidth\",\n\t\"pageXOffset\",\n\t\"pageYOffset\",\n\t\"parent\",\n\t\"scrollLeft\",\n\t\"scrollTop\",\n\t\"scrollX\",\n\t\"scrollY\",\n\t\"self\",\n\t\"webkitIndexedDB\",\n\t\"webkitStorageInfo\",\n\t\"window\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nmodule.exports = w;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar typeOf = require( './../../type-of' );\nvar isConstructorPrototype = require( './is_constructor_prototype.js' );\nvar EXCLUDED_KEYS = require( './excluded_keys.json' );\nvar win = require( './window.js' );\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasAutomationEqualityBug = require( './has_automation_equality_bug.js' );\nvar isConstructorPrototype = require( './is_constructor_prototype.js' );\nvar HAS_WINDOW = require( './has_window.js' );\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\n", "[\n\t\"toString\",\n\t\"toLocaleString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"constructor\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isArguments = require( '@stdlib/assert/is-arguments' );\nvar HAS_ENUM_PROTO_BUG = require( './has_enumerable_prototype_bug.js' );\nvar HAS_NON_ENUM_PROPS_BUG = require( './has_non_enumerable_properties_bug.js' );\nvar isConstructorPrototype = require( './is_constructor_prototype_wrapper.js' );\nvar NON_ENUMERABLE = require( './non_enumerable.json' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasArgumentsBug = require( './has_arguments_bug.js' );\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar wrapper = require( './builtin_wrapper.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names.\n*\n* @module @stdlib/utils/keys\n*\n* @example\n* var keys = require( '@stdlib/utils/keys' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-values-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own property in a source object, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - We need to cache an object value to prevent the edge case where, during the invocation of the transform function, the value corresponding to a particular key is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Object} obj - source object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( obj, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar keys;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tdebug( 'Number of keys: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing an object.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all properties...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next property.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar value;\n\t\tvar key;\n\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\n\t\tvalue = obj[ key ];\n\t\tdebug( '%s: %s', key, JSON.stringify( value ) );\n\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, key, cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, key, value, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, key, value, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [key] - transformed key\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, key ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next property.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d properties.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing an object.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which maps keys from one object to a new object having the same values\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a reusable function:\n* var mapKeysAsync = factory( opts, read );\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, done );\n*/\nfunction factory( options, transform ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = transform;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapKeysAsync;\n\n\t/**\n\t* Maps keys from one object to a new object having the same values.\n\t*\n\t* @private\n\t* @param {Object} obj - source object\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapKeysAsync( obj, done ) {\n\t\tif ( typeof obj !== 'object' || obj === null ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( obj, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} [out] - output object\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, out ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Maps keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, opts, read, done );\n*/\nfunction mapKeysAsync( obj, options, transform, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( obj, transform );\n\t}\n\tfactory( options, transform )( obj, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapKeysAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map keys from one object to a new object having the same values.\n*\n* @module @stdlib/utils/async/map-keys\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var mapKeysAsync = require( '@stdlib/utils/async/map-keys' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, opts, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-values-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own property in a source object, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Object} obj - source object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( obj, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar keys;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tdebug( 'Number of keys: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing an object.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all properties...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next property.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar key;\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\t\tdebug( '%s: %s', key, JSON.stringify( obj[ key ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property value.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [value] - transformed value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, value ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next property.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d properties.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing an object.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which maps values from one object to a new object having the same keys\n*\n* @example\n* var stat = require( 'fs' ).stat;\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a reusable function:\n* var mapValuesAsync = factory( opts, getStats );\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, done );\n*/\nfunction factory( options, transform ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = transform;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapValuesAsync;\n\n\t/**\n\t* Maps values from one object to a new object having the same keys.\n\t*\n\t* @private\n\t* @param {Object} obj - source object\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapValuesAsync( obj, done ) {\n\t\tif ( typeof obj !== 'object' || obj === null ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( obj, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} [out] - output object\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, out ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Maps values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var stat = require( 'fs' ).stat;\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, opts, getStats, done );\n*/\nfunction mapValuesAsync( obj, options, transform, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( obj, transform );\n\t}\n\tfactory( options, transform )( obj, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapValuesAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map values from one object to a new object having the same keys.\n*\n* @module @stdlib/utils/async/map-values\n*\n* @example\n* var stat = require( 'fs' ).stat;\n* var mapValuesAsync = require( '@stdlib/utils/async/map-values' );\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, opts, getStats, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'none-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection fail a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `noneByAsync` function which invokes the predicate function for each collection element sequentially:\n* var noneByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* noneByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn noneByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction noneByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* noneByAsync( files, predicate, done );\n*/\nfunction noneByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/none-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var noneByAsync = require( '@stdlib/utils/async/none-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* noneByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'none-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions, and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `noneByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var noneByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* noneByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn noneByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction noneByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* noneByRightAsync( files, predicate, done );\n*/\nfunction noneByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/none-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var noneByRightAsync = require( '@stdlib/utils/async/none-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* noneByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'reduce-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {*} acc - initial value\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, acc, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, acc );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var opts = {\n* 'series': false\n* };\n*\n* // Create a `reduceAsync` function which invokes `read` for each collection element concurrently:\n* var reduceAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* // Run `read` for each element in `files`:\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series === void 0 && opts.limit === void 0 ) {\n\t\topts.series = true;\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn reduceAsync;\n\n\t/**\n\t* Applies a function against an accumulator and each element in a collection and return the accumulated result.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {*} initial - initial value\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction reduceAsync( collection, initial, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, initial, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [acc] - accumulated value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, acc ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {*} initial - initial value\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, read, done );\n*/\nfunction reduceAsync( collection, initial, options, fcn, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, initial, fcn );\n\t}\n\tfactory( options, fcn )( collection, initial, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* @module @stdlib/utils/async/reduce\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var reduceAsync = require( '@stdlib/utils/async/reduce' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'reduce-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {*} acc - initial value\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, acc, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, acc );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var opts = {\n* 'series': false\n* };\n*\n* // Create a `reduceRightAsync` function which invokes `read` for each collection element concurrently:\n* var reduceRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* // Run `read` for each element in `files`:\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series === void 0 && opts.limit === void 0 ) {\n\t\topts.series = true;\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn reduceRightAsync;\n\n\t/**\n\t* Applies a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {*} initial - initial value\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction reduceRightAsync( collection, initial, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, initial, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [acc] - accumulated value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, acc ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {*} initial - initial value\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, read, done );\n*/\nfunction reduceRightAsync( collection, initial, options, fcn, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, initial, fcn );\n\t}\n\tfactory( options, fcn )( collection, initial, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* @module @stdlib/utils/async/reduce-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var reduceRightAsync = require( '@stdlib/utils/async/reduce-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunctionArray = require( '@stdlib/assert/is-function-array' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a reusable waterfall function.\n*\n* @param {FunctionArray} fcns - array of functions\n* @param {Callback} clbk - callback to invoke upon completion\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be an array of functions\n* @throws {TypeError} second argument must be a function\n* @returns {Function} waterfall function\n*\n* @example\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* var waterfall = factory( fcns, done );\n*\n* waterfall();\n* waterfall();\n* waterfall();\n*/\nfunction factory( fcns, clbk, thisArg ) {\n\tif ( !isFunctionArray( fcns ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of functions. Value: `%s`.', fcns ) );\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\treturn waterfall;\n\n\t/**\n\t* Executes functions in series, passing the results of one function as arguments to the next function.\n\t*\n\t* @private\n\t*/\n\tfunction waterfall() {\n\t\tvar idx = -1;\n\t\tnext(); // eslint-disable-line node/callback-return\n\n\t\t/**\n\t\t* Executes the next function in the series.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {...*} args - results to pass to next callback\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next() {\n\t\t\tvar args;\n\t\t\tvar len;\n\t\t\tvar i;\n\n\t\t\t// Check for an error...\n\t\t\tif ( arguments[ 0 ] ) {\n\t\t\t\treturn clbk( arguments[ 0 ] );\n\t\t\t}\n\t\t\t// Update the counter and check if we have run all functions...\n\t\t\tidx += 1;\n\t\t\tif ( idx >= fcns.length ) {\n\t\t\t\treturn clbk();\n\t\t\t}\n\t\t\t// Copy the remaining arguments...\n\t\t\tlen = arguments.length;\n\t\t\targs = new Array( len );\n\t\t\tfor ( i = 0; i < len-1; i++ ) {\n\t\t\t\targs[ i ] = arguments[ i+1 ];\n\t\t\t}\n\t\t\t// Add the callback:\n\t\t\targs[ i ] = next;\n\n\t\t\t// Apply the arguments to the next function in the waterfall:\n\t\t\tfcns[ idx ].apply( thisArg, args );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Executes functions in series, passing the results of one function as arguments to the next function.\n*\n* @param {FunctionArray} fcns - array of functions\n* @param {Callback} clbk - callback to invoke upon completion\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be an array of functions\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* waterfall( fcns, done );\n*/\nfunction waterfall( fcns, clbk, thisArg ) {\n\tfactory( fcns, clbk, thisArg )();\n}\n\n\n// EXPORTS //\n\nmodule.exports = waterfall;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Execute functions in series, passing the results of one function as arguments to the next function.\n*\n* @module @stdlib/utils/async/series-waterfall\n*\n* @example\n* var waterfall = require( '@stdlib/utils/async/series-waterfall' );\n*\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* waterfall( fcns, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'some-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, n, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar cnt;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0; // processed element count\n\tidx = -1;\n\tcnt = 0; // success count\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tcnt += 1;\n\t\t\tif ( cnt === n ) {\n\t\t\t\tflg = true;\n\t\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\t\treturn done( null, true );\n\t\t\t}\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `someByAsync` function which invokes the predicate function for each collection element sequentially:\n* var someByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* someByAsync( files, 2, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn someByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {PositiveInteger} n - number of elements\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} second argument must be a positive integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction someByAsync( collection, n, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isPositiveInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* someByAsync( files, 2, predicate, done );\n*/\nfunction someByAsync( collection, n, options, predicate, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, n, predicate );\n\t}\n\tfactory( options, predicate )( collection, n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/some-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var someByAsync = require( '@stdlib/utils/async/some-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* someByAsync( files, 2, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'some-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, n, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar cnt;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0; // processed element count\n\tidx = len;\n\tcnt = 0; // success count\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tcnt += 1;\n\t\t\tif ( cnt === n ) {\n\t\t\t\tflg = true;\n\t\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\t\treturn done( null, true );\n\t\t\t}\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `someByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var someByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* someByRightAsync( files, 2, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn someByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {PositiveInteger} n - number of elements\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} second argument must be a positive integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction someByRightAsync( collection, n, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isPositiveInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* someByRightAsync( files, 2, predicate, done );\n*/\nfunction someByRightAsync( collection, n, options, predicate, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, n, predicate );\n\t}\n\tfactory( options, predicate )( collection, n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/some-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var someByRightAsync = require( '@stdlib/utils/async/some-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* someByRightAsync( files, 2, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar indexOf = require( './../../../index-of' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'tabulate-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = [];\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\ttmp = [];\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tvar i;\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Determine if we've seen the group/category before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\t\t\ti = indexOf( tmp, group );\n\t\t\tif ( i === -1 ) {\n\t\t\t\ttmp.push( group );\n\t\t\t\tout.push( [ group, 1, 0 ] );\n\t\t\t} else {\n\t\t\t\tout[ i ][ 1 ] += 1;\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\t// Compute percentages...\n\t\t\tfor ( i = 0; i < out.length; i++ ) {\n\t\t\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t\t\t}\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating a frequency table according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* - The output frequency table is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `tabulateByAsync` function which invokes the indicator function for each collection element sequentially:\n* var tabulateByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* tabulateByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn tabulateByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction tabulateByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - frequency table\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* - The output frequency table is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* tabulateByAsync( files, indicator, done );\n*/\nfunction tabulateByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulateByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table according to an indicator function.\n*\n* @module @stdlib/utils/async/tabulate-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* tabulateByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not return an error, invokes a callback with the function result; otherwise, invokes a callback with a value `y`.\n*\n* @param {Function} x - function to invoke\n* @param {*} y - value to return if `x` returns an error\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* console.log( error.message );\n* }\n* console.log( result );\n* }\n*\n* trycatchAsync( x, -1.0, done );\n*/\nfunction trycatchAsync( x, y, done ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tx( clbk );\n\n\t/**\n\t* Callback invoked by `x`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {*} result - result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error, y );\n\t\t}\n\t\tdone( null, result );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trycatchAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not return an error, invoke a callback with the function result; otherwise, invoke a callback with a value `y`.\n*\n* @module @stdlib/utils/async/try-catch\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trycatchAsync = require( '@stdlib/utils/async/try-catch' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* console.log( error.message );\n* }\n* console.log( result );\n* }\n*\n* trycatchAsync( x, -1.0, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not return an error, invokes a callback with the function result; otherwise, invokes a second function `y`.\n*\n* @param {Function} x - function to invoke\n* @param {Function} y - function to invoke if `x` returns an error\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* trythenAsync( x, y, done );\n*/\nfunction trythenAsync( x, y, done ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tx( clbk1 );\n\n\t/**\n\t* Callback invoked by `x`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - function results\n\t* @returns {void}\n\t*/\n\tfunction clbk1( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\tif ( y.length === 1 ) {\n\t\t\t\treturn y( clbk2 );\n\t\t\t}\n\t\t\treturn y( error, clbk2 );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\treturn done.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked by `y`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - function results\n\t* @returns {void}\n\t*/\n\tfunction clbk2( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\treturn done.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trythenAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not return an error, invoke a callback with the function result; otherwise, invoke a second function `y`.\n*\n* @module @stdlib/utils/async/try-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trythenAsync = require( '@stdlib/utils/async/try-then' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* trythenAsync( x, y, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* untilAsync( predicate, fcn, done );\n*/\nfunction untilAsync( predicate, fcn, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tpredicate( idx, onPredicate );\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/async/until\n*\n* @example\n* var untilAsync = require( '@stdlib/utils/async/until' );\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* untilAsync( predicate, fcn, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* whileAsync( predicate, fcn, done );\n*/\nfunction whileAsync( predicate, fcn, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tpredicate( idx, onPredicate );\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/async/while\n*\n* @example\n* var whileAsync = require( '@stdlib/utils/async/while' );\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* whileAsync( predicate, fcn, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name anyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by}\n*/\nsetReadOnly( ns, 'anyByAsync', require( './../../async/any-by' ) );\n\n/**\n* @name anyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by-right}\n*/\nsetReadOnly( ns, 'anyByRightAsync', require( './../../async/any-by-right' ) );\n\n/**\n* @name bifurcateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/bifurcate-by}\n*/\nsetReadOnly( ns, 'bifurcateByAsync', require( './../../async/bifurcate-by' ) );\n\n/**\n* @name composeAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/compose}\n*/\nsetReadOnly( ns, 'composeAsync', require( './../../async/compose' ) );\n\n/**\n* @name countByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/count-by}\n*/\nsetReadOnly( ns, 'countByAsync', require( './../../async/count-by' ) );\n\n/**\n* @name doUntilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-until}\n*/\nsetReadOnly( ns, 'doUntilAsync', require( './../../async/do-until' ) );\n\n/**\n* @name doWhileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-while}\n*/\nsetReadOnly( ns, 'doWhileAsync', require( './../../async/do-while' ) );\n\n/**\n* @name everyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by}\n*/\nsetReadOnly( ns, 'everyByAsync', require( './../../async/every-by' ) );\n\n/**\n* @name everyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by-right}\n*/\nsetReadOnly( ns, 'everyByRightAsync', require( './../../async/every-by-right' ) );\n\n/**\n* @name forEachAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each}\n*/\nsetReadOnly( ns, 'forEachAsync', require( './../../async/for-each' ) );\n\n/**\n* @name forEachRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each-right}\n*/\nsetReadOnly( ns, 'forEachRightAsync', require( './../../async/for-each-right' ) );\n\n/**\n* @name functionSequenceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/function-sequence}\n*/\nsetReadOnly( ns, 'functionSequenceAsync', require( './../../async/function-sequence' ) );\n\n/**\n* @name groupByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/group-by}\n*/\nsetReadOnly( ns, 'groupByAsync', require( './../../async/group-by' ) );\n\n/**\n* @name ifelseAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-else}\n*/\nsetReadOnly( ns, 'ifelseAsync', require( './../../async/if-else' ) );\n\n/**\n* @name ifthenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-then}\n*/\nsetReadOnly( ns, 'ifthenAsync', require( './../../async/if-then' ) );\n\n/**\n* @name inmapAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap}\n*/\nsetReadOnly( ns, 'inmapAsync', require( './../../async/inmap' ) );\n\n/**\n* @name inmapRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap-right}\n*/\nsetReadOnly( ns, 'inmapRightAsync', require( './../../async/inmap-right' ) );\n\n/**\n* @name mapFunAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-function}\n*/\nsetReadOnly( ns, 'mapFunAsync', require( './../../async/map-function' ) );\n\n/**\n* @name mapKeysAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-keys}\n*/\nsetReadOnly( ns, 'mapKeysAsync', require( './../../async/map-keys' ) );\n\n/**\n* @name mapValuesAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-values}\n*/\nsetReadOnly( ns, 'mapValuesAsync', require( './../../async/map-values' ) );\n\n/**\n* @name noneByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by}\n*/\nsetReadOnly( ns, 'noneByAsync', require( './../../async/none-by' ) );\n\n/**\n* @name noneByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by-right}\n*/\nsetReadOnly( ns, 'noneByRightAsync', require( './../../async/none-by-right' ) );\n\n/**\n* @name reduceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce}\n*/\nsetReadOnly( ns, 'reduceAsync', require( './../../async/reduce' ) );\n\n/**\n* @name reduceRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce-right}\n*/\nsetReadOnly( ns, 'reduceRightAsync', require( './../../async/reduce-right' ) );\n\n/**\n* @name waterfall\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/series-waterfall}\n*/\nsetReadOnly( ns, 'waterfall', require( './../../async/series-waterfall' ) );\n\n/**\n* @name someByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by}\n*/\nsetReadOnly( ns, 'someByAsync', require( './../../async/some-by' ) );\n\n/**\n* @name someByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by-right}\n*/\nsetReadOnly( ns, 'someByRightAsync', require( './../../async/some-by-right' ) );\n\n/**\n* @name tabulateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/tabulate-by}\n*/\nsetReadOnly( ns, 'tabulateByAsync', require( './../../async/tabulate-by' ) );\n\n/**\n* @name trycatchAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-catch}\n*/\nsetReadOnly( ns, 'trycatchAsync', require( './../../async/try-catch' ) );\n\n/**\n* @name trythenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-then}\n*/\nsetReadOnly( ns, 'trythenAsync', require( './../../async/try-then' ) );\n\n/**\n* @name untilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/until}\n*/\nsetReadOnly( ns, 'untilAsync', require( './../../async/until' ) );\n\n/**\n* @name whileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/while}\n*/\nsetReadOnly( ns, 'whileAsync', require( './../../async/while' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar returnValues = require( '@stdlib/array/base/bifurcate-values' );\nvar returnIndices = require( '@stdlib/array/base/bifurcate-indices' );\nvar returnPairs = require( '@stdlib/array/base/bifurcate-entries' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Collection} filter - collection indicating which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a collection\n* @throws {RangeError} first and last arguments must be the same length\n* @returns {(Array|ArrayArray)} results\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcate( arr, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcate( collection, options, filter ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tf = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = filter;\n\t}\n\tif ( !isCollection( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a collection. Value: `%s`.', f ) );\n\t}\n\tif ( collection.length !== f.length ) {\n\t\tthrow new RangeError( 'invalid arguments. First and last arguments must be the same length.' );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, f );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, f );\n\t}\n\treturn returnPairs( collection, f );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups.\n*\n* @module @stdlib/utils/bifurcate\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcate( arr, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tbool = predicate.call( thisArg, v, i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( v );\n\t\t} else {\n\t\t\tout[ 1 ].push( v );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as element indices.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbool = predicate.call( thisArg, collection[ i ], i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( i );\n\t\t} else {\n\t\t\tout[ 1 ].push( i );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as index-element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tbool = predicate.call( thisArg, v, i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( [ i, v ] );\n\t\t} else {\n\t\t\tout[ 1 ].push( [ i, v ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnIndices = require( './return_indices.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcateBy( collection, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, opts, cb );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, opts, cb );\n\t}\n\treturn returnPairs( collection, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-by\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tv = obj[ key ];\n\t\tbool = predicate.call( thisArg, v, key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( v );\n\t\t} else {\n\t\t\tout[ 1 ].push( v );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tbool = predicate.call( thisArg, obj[ key ], key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( key );\n\t\t} else {\n\t\t\tout[ 1 ].push( key );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tv = obj[ key ];\n\t\tbool = predicate.call( thisArg, v, key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( [ key, v ] );\n\t\t} else {\n\t\t\tout[ 1 ].push( [ key, v ] );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits an object's own and inherited property values into two groups according to a predicate function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateIn( obj, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split an object's own and inherited property values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-in\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tv = obj[ key ];\n\t\t\tbool = predicate.call( thisArg, v, key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( v );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tbool = predicate.call( thisArg, obj[ key ], key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( key );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tv = obj[ key ];\n\t\t\tbool = predicate.call( thisArg, v, key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( [ key, v ] );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( [ key, v ] );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits an object's own property values into two groups according to a predicate function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateOwn( obj, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split an object's own property values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-own\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var out = bifurcateOwn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts the first letter of each object key to uppercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'aa': 1,\n* 'bb': 2\n* };\n*\n* var obj2 = capitalizeKeys( obj1 );\n* // returns { 'Aa': 1, 'Bb': 2 }\n*/\nfunction capitalizeKeys( obj ) {\n\tvar out;\n\tvar key;\n\tvar k;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tif ( key === '' ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t} else {\n\t\t\t\tk = key.charAt( 0 ).toUpperCase() + key.slice( 1 );\n\t\t\t\tout[ k ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = capitalizeKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert the first letter of each object key to uppercase.\n*\n* @module @stdlib/utils/capitalize-keys\n*\n* @example\n* var capitalizeKeys = require( '@stdlib/utils/capitalize-keys' );\n*\n* var obj1 = {\n* 'aa': 1,\n* 'bb': 2\n* };\n*\n* var obj2 = capitalizeKeys( obj1 );\n* // returns { 'Aa': 1, 'Bb': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-accessor\n*\n* @example\n* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar MAX_ITERATIONS = require( '@stdlib/constants/float64/max' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Circular buffer constructor.\n*\n* @constructor\n* @param {(PositiveInteger|Collection)} buffer - buffer size or an array-like object to use as the underlying buffer\n* @throws {TypeError} must provide either a valid buffer size or an array-like object\n* @returns {CircularBuffer} circular buffer instance\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer...\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\nfunction CircularBuffer( buffer ) {\n\tvar buf;\n\tvar i;\n\tif ( !(this instanceof CircularBuffer) ) {\n\t\treturn new CircularBuffer( buffer );\n\t}\n\tif ( isPositiveInteger( buffer ) ) {\n\t\tbuf = [];\n\t\tfor ( i = 0; i < buffer; i++ ) {\n\t\t\tbuf.push( 0.0 ); // initialize with zeros, but could be any value (we're just ensuring a contiguous block of memory)\n\t\t}\n\t} else if ( isCollection( buffer ) ) {\n\t\tbuf = buffer;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide either a valid buffer size (i.e., a positive integer) or an array-like object which can serve as the underlying buffer. Value: `%s`.', buffer ) );\n\t}\n\tthis._buffer = arraylike2object( buf );\n\tthis._length = buf.length;\n\tthis._count = 0;\n\tthis._i = -1;\n\treturn this;\n}\n\n/**\n* Clears the buffer.\n*\n* @name clear\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {CircularBuffer} circular buffer instance\n*\n* @example\n* var b = new CircularBuffer( 2 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Get the number of elements currently in the buffer:\n* var n = b.count;\n* // returns 2\n*\n* // Clear the buffer:\n* b.clear();\n*\n* // Get the number of buffer values:\n* n = b.count;\n* // returns 0\n*/\nsetReadOnly( CircularBuffer.prototype, 'clear', function clear() {\n\tthis._count = 0;\n\tthis._i = -1; // this ensures that we always fill the buffer starting at index `0`.\n\treturn this;\n});\n\n/**\n* Number of elements currently in the buffer.\n*\n* @name count\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var b = new CircularBuffer( 4 );\n*\n* // Get the value count:\n* var n = b.count;\n* // returns 0\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n*\n* // Get the value count:\n* n = b.count;\n* // returns 2\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'count', function get() {\n\treturn this._count;\n});\n\n/**\n* Boolean indicating whether a circular buffer is full.\n*\n* @name full\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {boolean}\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Determine if the buffer is full:\n* var bool = b.full;\n* // returns false\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Determine if the buffer is full:\n* bool = b.full;\n* // returns true\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'full', function get() {\n\treturn this._count === this._length;\n});\n\n/**\n* Returns an iterator for iterating over a circular buffer.\n*\n* ## Notes\n*\n* - An iterator does not iterate over partially full buffers.\n*\n* @name iterator\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @param {NonNegativeInteger} [niters] - number of iterations\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Iterator} iterator\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Create an iterator:\n* var it = b.iterator( b.length );\n*\n* // Iterate over the buffer...\n* var v = it.next().value;\n* // returns 'bar'\n*\n* v = it.next().value;\n* // returns 'beep'\n*\n* v = it.next().value;\n* // returns 'boop'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( CircularBuffer.prototype, 'iterator', function iterator( niters ) {\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length ) {\n\t\tif ( !isNonNegativeInteger( niters ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', niters ) );\n\t\t}\n\t\tN = niters;\n\t} else {\n\t\tN = MAX_ITERATIONS;\n\t}\n\tself = this;\n\n\t// Initialize the iteration index and counter:\n\ti = this._i;\n\tn = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\tn += 1;\n\t\tif ( FLG || n > N ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\t// If the buffer is only partially full, don't allow iteration over \"undefined\" elements (this ensures similar behavior with `toArray()`)...\n\t\tif ( self._count !== self._length ) {\n\t\t\tFLG = true;\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\ti = (i+1) % self._length;\n\t\treturn {\n\t\t\t'value': self._buffer.accessors[ 0 ]( self._buffer.data, i ),\n\t\t\t'done': false\n\t\t};\n\n\t\t/* eslint-enable no-underscore-dangle */\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator( N );\n\t}\n});\n\n/**\n* Circular buffer length (i.e., capacity).\n*\n* @name length\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var b = new CircularBuffer( 4 );\n*\n* // Get the buffer capacity:\n* var len = b.length;\n* // returns 4\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Adds a value to the circular buffer.\n*\n* @name push\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @param {*} value - value to add\n* @returns {(*|void)} removed element or undefined\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer:\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\nsetReadOnly( CircularBuffer.prototype, 'push', function push( value ) {\n\tvar set;\n\tvar get;\n\tvar buf;\n\tvar v;\n\n\tbuf = this._buffer.data;\n\tget = this._buffer.accessors[ 0 ];\n\tset = this._buffer.accessors[ 1 ];\n\n\t// Compute the next buffer index:\n\tthis._i = (this._i+1) % this._length;\n\n\t// Check if we are still filling the buffer...\n\tif ( this._count < this._length ) {\n\t\tset( buf, this._i, value );\n\t\tthis._count += 1;\n\t\treturn;\n\t}\n\t// Replace an existing buffer element...\n\tv = get( buf, this._i );\n\tset( buf, this._i, value );\n\treturn v;\n});\n\n/**\n* Returns an array of circular buffer values.\n*\n* @name toArray\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {Array} circular buffer values\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Get an array of buffer values:\n* var vals = b.toArray();\n* // returns [ 'bar', 'beep', 'boop' ]\n*/\nsetReadOnly( CircularBuffer.prototype, 'toArray', function toArray() {\n\tvar buf;\n\tvar get;\n\tvar out;\n\tvar k;\n\tvar i;\n\n\tbuf = this._buffer.data;\n\tget = this._buffer.accessors[ 0 ];\n\n\tout = [];\n\tfor ( i = 1; i <= this._count; i++ ) {\n\t\t// Note: in a full buffer, `count == length`; in a partially full buffer, we need to ensure we always start at index `0`\n\t\tk = (this._i+i) % this._count;\n\t\tout.push( get( buf, k ) );\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a circular buffer as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `CircularBuffer` instance.\n*\n* @name toJSON\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {Object} serialized circular buffer\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Serialize to JSON:\n* var o = b.toJSON();\n* // returns { 'type': 'circular-buffer', 'length': 3, 'data': [ 'bar', 'beep', 'boop' ] }\n*/\nsetReadOnly( CircularBuffer.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'circular-buffer';\n\tout.length = this._length;\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = CircularBuffer;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Circular buffer.\n*\n* @module @stdlib/utils/circular-buffer\n*\n* @example\n* var CircularBuffer = require( '@stdlib/utils/circular-buffer' );\n*\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer...\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns the common own property names of two or more objects.\n*\n* @param {*} obj1 - first object\n* @param {*} obj2 - second object\n* @param {...*} [obj] - additional objects\n* @throws {Error} must provide at least two objects\n* @returns {(StringArray|EmptyArray)} common keys\n*\n* @example\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeys( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj3 = {\n* 'a': 1,\n* };\n*\n* var keys = commonKeys( obj1, obj2, obj3 );\n* // returns [ 'a' ]\n*/\nfunction commonKeys() {\n\tvar nargs;\n\tvar keys;\n\tvar arg;\n\tvar ptr;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tnargs = arguments.length;\n\tif ( nargs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least two objects.' );\n\t}\n\tkeys = objectKeys( arguments[ 0 ] );\n\tN = keys.length;\n\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\targ = arguments[ i ];\n\t\tptr = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tif ( hasOwnProp( arg, keys[ j ] ) ) {\n\t\t\t\tkeys[ ptr ] = keys[ j ];\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t}\n\t\tN = ptr;\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = commonKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the common own property names of two or more objects.\n*\n* @module @stdlib/utils/common-keys\n*\n* @example\n* var commonKeys = require( '@stdlib/utils/common-keys' );\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeys( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property names.\n*\n* @param {ObjectLike} obj - input object\n* @returns {Array} key array\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = keysIn( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keysIn( obj ) {\n\tvar out;\n\tvar key;\n\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( key );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keysIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property names.\n*\n* @module @stdlib/utils/keys-in\n*\n* @example\n* var keysIn = require( '@stdlib/utils/keys-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = keysIn( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keysIn = require( './../../keys-in' );\nvar hasProp = require( '@stdlib/assert/has-property' );\n\n\n// MAIN //\n\n/**\n* Returns the common own and inherited property names of two or more objects.\n*\n* @param {*} obj1 - first object\n* @param {*} obj2 - second object\n* @param {...*} [obj] - additional objects\n* @throws {Error} must provide at least two objects\n* @returns {(StringArray|EmptyArray)} common keys\n*\n* @example\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeysIn( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj3 = {\n* 'a': 1,\n* };\n*\n* var keys = commonKeysIn( obj1, obj2, obj3 );\n* // returns [ 'a' ]\n*/\nfunction commonKeysIn() {\n\tvar nargs;\n\tvar keys;\n\tvar arg;\n\tvar ptr;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tnargs = arguments.length;\n\tif ( nargs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least two objects.' );\n\t}\n\tkeys = keysIn( arguments[ 0 ] );\n\tN = keys.length;\n\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\targ = arguments[ i ];\n\t\tptr = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tif ( hasProp( arg, keys[ j ] ) ) {\n\t\t\t\tkeys[ ptr ] = keys[ j ];\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t}\n\t\tN = ptr;\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = commonKeysIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the common own and inherited property names of two or more objects.\n*\n* @module @stdlib/utils/common-keys-in\n*\n* @example\n* var commonKeysIn = require( '@stdlib/utils/common-keys-in' );\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeysIn( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\ti += 1;\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tz = clbk.call( thisArg, z, i );\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Callback must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\ti += 1;\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tz = clbk.call( thisArg, z, i );\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Callback must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Sets a bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to set\n* @returns {integer32} updated integer value\n*\n* @example\n* var v = setBit( 0, 2 );\n* // returns 4\n*/\nfunction setBit( value, i ) {\n\tvalue |= 1 << i;\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setBit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Clears a bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to clear\n* @returns {integer32} updated integer value\n*\n* @example\n* var v = clearBit( 5, 2 );\n* // returns 1\n*/\nfunction clearBit( value, i ) {\n\tvalue &= ~( 1 << i );\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clearBit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Boolean = require( '@stdlib/boolean/ctor' );\n\n\n// MAIN //\n\n/**\n* Checks whether a bit is set.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to check\n* @returns {boolean} boolean indicating whether a bit is set\n*\n* @example\n* var bool = isSet( 4, 2 );\n* // returns true\n*\n* bool = isSet( 4, 0 );\n* // returns false\n*/\nfunction isSet( value, i ) {\n\treturn Boolean( ( value >> i ) & 1 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the value (either `0` or `1`) of a specified bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit number\n* @returns {NonNegativeInteger} bit value\n*\n* @example\n* var b = bitValue( 4, 2 );\n* // returns 1\n*\n* b = bitValue( 4, 0 );\n* // returns 0\n*/\nfunction bitValue( value, i ) {\n\treturn ( value >> i ) & 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bitValue;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Int8Array = require( '@stdlib/array/int8' );\nvar format = require( '@stdlib/string/format' );\nvar ceil = require( '@stdlib/math/base/special/ceil' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar fromIteratorAdjList = require( './from_adjacency_list_iterator.js' );\nvar fromIteratorAdjListMap = require( './from_adjacency_list_iterator_map.js' );\nvar fromIteratorEdges = require( './from_edges_iterator.js' );\nvar fromIteratorEdgesMap = require( './from_edges_iterator_map.js' );\nvar setBit = require( './set_bit.js' );\nvar clearBit = require( './clear_bit.js' );\nvar isSet = require( './is_set.js' );\nvar bitValue = require( './bit_value.js' );\n\n\n// VARIABLES //\n\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\nvar NBITS = Int32Array.BYTES_PER_ELEMENT * 8; // 8 bits per byte\n\n\n// MAIN //\n\n/**\n* Compact adjacency matrix constructor.\n*\n* @constructor\n* @param {NonNegativeInteger} N - number of vertices\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*/\nfunction CompactAdjacencyMatrix( N ) {\n\tif ( !( this instanceof CompactAdjacencyMatrix ) ) {\n\t\treturn new CompactAdjacencyMatrix( N );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tthis._N = N; // number of vertices\n\tthis._M = 0; // number of edges\n\tthis._buffer = new Int32Array( ceil( N*N/NBITS ) ); // square matrix\n\treturn this;\n}\n\n/**\n* Creates a compact adjacency matrix from an adjacency list.\n*\n* @name fromAdjacencyList\n* @memberof CompactAdjacencyMatrix\n* @type {Function}\n* @param {(ArrayLikeObject|Iterable)} list - adjacency list\n* @param {Function} [clbk] - callback to invoke for each list element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a compact adjacency matrix\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} each element of a provided adjacency list must be an array-like object\n* @throws {TypeError} an iterator must return an array-like object containing vertices\n* @throws {TypeError} when provided an iterator, a callback must return an array-like object containing vertices\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var list = [ [ 1, 2 ], [ 2 ], [ 3 ], [] ];\n*\n* var adj = CompactAdjacencyMatrix.fromAdjacencyList( list );\n* // returns \n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*/\nsetReadOnly( CompactAdjacencyMatrix, 'fromAdjacencyList', function fromAdjacencyList( list ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar edges;\n\tvar clbk;\n\tvar adj;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( this !== CompactAdjacencyMatrix ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a compact adjacency matrix.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isArrayLikeObject( list ) ) {\n\t\tN = list.length;\n\t\tadj = new this( N );\n\t\tif ( clbk ) {\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tedges = clbk.call( thisArg, list[ i ], i );\n\t\t\t\tif ( !isCollection( edges ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return an array-like object. Value: `%s`.', edges ) );\n\t\t\t\t}\n\t\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn adj;\n\t\t}\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tedges = list[ i ];\n\t\t\tif ( !isCollection( edges ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of the adjacency list must be an array-like object. Value: `%s`.', list ) );\n\t\t\t}\n\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t}\n\t\t}\n\t\treturn adj;\n\t}\n\tif ( isObject( list ) && HAS_ITERATOR_SYMBOL && isFunction( list[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\ttmp = list[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( tmp.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', list ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorAdjListMap( tmp, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIteratorAdjList( tmp );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length;\n\t\tadj = new this( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tedges = tmp[ i ];\n\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t}\n\t\t}\n\t\treturn adj;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', list ) );\n});\n\n/**\n* Creates a compact adjacency matrix from a list of edges.\n*\n* @name fromEdges\n* @memberof CompactAdjacencyMatrix\n* @type {Function}\n* @param {NonNegativeInteger} N - number of vertices\n* @param {(ArrayLikeObject|Iterable)} edges - list of edges\n* @param {Function} [clbk] - callback to invoke for each list element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a compact adjacency matrix\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be an array-like object\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} each element of a provided list of edges must be a two-element array-like object containing vertices\n* @throws {TypeError} an iterator must return a two-element array-like object containing vertices\n* @throws {TypeError} when provided an iterator, a callback must return a two-element array-like object containing vertices\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var edges = [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ], [ 2, 3 ] ];\n*\n* var adj = CompactAdjacencyMatrix.fromEdges( 4, edges );\n* // returns \n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*/\nsetReadOnly( CompactAdjacencyMatrix, 'fromEdges', function fromEdges( N, edges ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar edge;\n\tvar adj;\n\tvar tmp;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( this !== CompactAdjacencyMatrix ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a compact adjacency matrix.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( isArrayLikeObject( edges ) ) {\n\t\tif ( clbk ) {\n\t\t\tadj = new this( N );\n\t\t\tfor ( i = 0; i < edges.length; i++ ) {\n\t\t\t\tedge = clbk.call( thisArg, edges[ i ], i );\n\t\t\t\tif ( !isArrayLikeObject( edge ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return an array-like object. Value: `%s`.', edge ) );\n\t\t\t\t}\n\t\t\t\tadj.addEdge( edge[ 0 ], edge[ 1 ] );\n\t\t\t}\n\t\t\treturn adj;\n\t\t}\n\t\tadj = new this( N );\n\t\tfor ( i = 0; i < edges.length; i++ ) {\n\t\t\tedge = edges[ i ];\n\t\t\tif ( !isArrayLikeObject( edge ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of the edge list must be an array-like object. Value: `%s`.', edge ) );\n\t\t\t}\n\t\t\tadj.addEdge( edge[ 0 ], edge[ 1 ] );\n\t\t}\n\t\treturn adj;\n\t}\n\n\tif ( isObject( edges ) && HAS_ITERATOR_SYMBOL && isFunction( edges[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\ttmp = edges[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( tmp.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', edges ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorEdgesMap( tmp, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIteratorEdges( tmp );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length;\n\t\tadj = new this( len/2 );\n\t\tfor ( i = 0; i < len; i += 2 ) {\n\t\t\tadj.addEdge( tmp[ i ], tmp[ i+1 ] );\n\t\t}\n\t\treturn adj;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', edges ) );\n});\n\n/**\n* Returns indices (\"bucket\" and bit offset) for an `(i,j)` vertex pair.\n*\n* @private\n* @name _loc\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @param {Array} out - output array\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {Array} output array\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, '_loc', function loc( i, j, out ) {\n\tvar bucket;\n\tvar bit;\n\tvar idx;\n\n\t// Compute a strided index for the desired bit:\n\tidx = ( i*this._N ) + j;\n\n\t// Compute the index of the buffer element (bucket) containing the bit:\n\tbucket = floor( idx / NBITS );\n\n\t// Compute the bit offset:\n\tbit = idx - ( bucket*NBITS );\n\n\t// Set the output values:\n\tout[ 0 ] = bucket;\n\tout[ 1 ] = bit;\n\n\treturn out;\n});\n\n/**\n* Adds a directed edge between two vertices.\n*\n* @name addEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'addEdge', function addEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Set the bit for the edge:\n\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) === false ) {\n\t\tthis._buffer[ idx[0] ] = setBit( this._buffer[ idx[0] ], idx[1] );\n\t\tthis._M += 1;\n\t}\n\treturn this;\n});\n\n/**\n* Returns the list of all edges.\n*\n* @name edges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Array}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var edges = adj.edges;\n* // returns [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ], [ 2, 3 ] ]\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'edges', function edges() {\n\tvar edges;\n\tvar idx;\n\tvar i;\n\tvar j;\n\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\tfor ( j = 0; j < this._N; j++ ) {\n\t\t\t// Resolve the `(i,j)` pair:\n\t\t\tidx = this._loc( i, j, idx );\n\n\t\t\t// Check for an edge:\n\t\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\t\tedges.push( [ i, j ] );\n\t\t\t}\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Checks whether a directed edge exists between two vertices.\n*\n* @name hasEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {boolean} boolean indicating if an edge exists\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 3 );\n* // returns false\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'hasEdge', function hasEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Check for an edge:\n\treturn isSet( this._buffer[ idx[0] ], idx[1] );\n});\n\n/**\n* Returns the indegree of a vertex (i.e., number of edges ending at a vertex).\n*\n* @name inDegree\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} j - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {NonNegativeInteger} indegree\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var d = adj.inDegree( 2 );\n* // returns 2\n*\n* d = adj.inDegree( 3 );\n* // returns 1\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'inDegree', function inDegree( j ) {\n\tvar deg;\n\tvar idx;\n\tvar i;\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Iterate over the rows and add up the number of edges...\n\tdeg = 0;\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tdeg += bitValue( this._buffer[ idx[0] ], idx[1] );\n\t}\n\treturn deg;\n});\n\n/**\n* Returns a list of vertices having edges ending at a specified vertex.\n*\n* @name inEdges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} j - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {Array} list of vertices\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var e = adj.inEdges( 2 );\n* // returns [ 0, 1 ]\n*\n* e = adj.inEdges( 3 );\n* // returns [ 2 ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'inEdges', function inEdges( j ) {\n\tvar edges;\n\tvar idx;\n\tvar i;\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Iterate over the rows and retrieve edges...\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\tedges.push( i );\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Returns the total number of edges.\n*\n* @name nedges\n* @memberof CompactAdjacencyMatrix.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n*\n* // ...\n*\n* var M = adj.nedges;\n* // returns 3\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'nedges', function nedges() {\n\treturn this._M;\n});\n\n/**\n* Returns the number of vertices.\n*\n* @name nvertices\n* @memberof CompactAdjacencyMatrix.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* var N = adj.nvertices;\n* // returns 4\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'nvertices', function nvertices() {\n\treturn this._N;\n});\n\n/**\n* Returns the outdegree of a vertex (i.e., number of edges starting from a vertex).\n*\n* @name outDegree\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {NonNegativeInteger} outdegree\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var d = adj.outDegree( 2 );\n* // returns 1\n*\n* d = adj.outDegree( 0 );\n* // returns 2\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'outDegree', function outDegree( i ) {\n\tvar deg;\n\tvar idx;\n\tvar j;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', i ) );\n\t}\n\t// Iterate over the columns and add up the number of edges...\n\tdeg = 0;\n\tidx = [ 0, 0 ];\n\tfor ( j = 0; j < this._N; j++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tdeg += bitValue( this._buffer[ idx[0] ], idx[1] );\n\t}\n\treturn deg;\n});\n\n/**\n* Returns a list of vertices having edges starting at a specified vertex.\n*\n* @name outEdges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {Array} list of vertices\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var e = adj.outEdges( 2 );\n* // returns [ 3 ]\n*\n* e = adj.outEdges( 0 );\n* // returns [ 1, 2 ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'outEdges', function outEdges( i ) {\n\tvar edges;\n\tvar idx;\n\tvar j;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', i ) );\n\t}\n\t// Iterate over the rows and retrieve edges...\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( j = 0; j < this._N; j++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\tedges.push( j );\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Removes a directed edge between two vertices.\n*\n* @name removeEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*\n* adj.removeEdge( 0, 1 );\n* adj.removeEdge( 0, 2 );\n* adj.removeEdge( 1, 2 );\n* adj.removeEdge( 2, 3 );\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'removeEdge', function removeEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Clear the bit for the edge:\n\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\tthis._buffer[ idx[0] ] = clearBit( this._buffer[ idx[0] ], idx[1] );\n\t\tthis._M -= 1;\n\t}\n\treturn this;\n});\n\n/**\n* Returns an adjacency list representation.\n*\n* @name toAdjacencyList\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @returns {Array} adjacency list representation\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var list = adj.toAdjacencyList();\n* // returns [ [ 1, 2 ], [ 2 ], [ 3 ], [] ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'toAdjacencyList', function toAdjacencyList() {\n\tvar list;\n\tvar idx;\n\tvar tmp;\n\tvar i;\n\tvar j;\n\n\tlist = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\ttmp = [];\n\t\tfor ( j = 0; j < this._N; j++ ) {\n\t\t\t// Resolve the `(i,j)` pair:\n\t\t\tidx = this._loc( i, j, idx );\n\n\t\t\t// Check for an edge:\n\t\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\t\ttmp.push( j );\n\t\t\t}\n\t\t}\n\t\tlist.push( tmp );\n\t}\n\treturn list;\n});\n\n/**\n* Returns a topological ordering of the directed graph.\n*\n* ## Notes\n*\n* - The function returns a two-element array.\n* - If the function is able to compute a topological ordering, the first array element is the topological ordering and the second element is `null`.\n* - If a topological ordering cannot be achieved (e.g., due to the graph not being a directed acyclic graph (DAG)), the first array element is `null` and the second element is the first encountered cycle.\n*\n* @name toposort\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @returns {Array} topological ordering\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 1, 0 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var results = adj.toposort();\n* // returns \n*\n* var order = results[ 0 ];\n* // returns [ 1, 0, 2, 3 ]\n*\n* var cycle = results[ 1 ];\n* // returns null\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'toposort', function toposort() {\n\tvar marks;\n\tvar self;\n\tvar out;\n\tvar idx;\n\tvar err;\n\tvar N;\n\tvar s;\n\tvar i;\n\n\tself = this;\n\tN = this._N;\n\n\t// Initialize an empty list that will contain the sorted vertices:\n\tout = [];\n\n\t// If the graph is empty, nothing to sort...\n\tif ( this._N === 0 ) {\n\t\treturn [ out, null ];\n\t}\n\t// Initialize an array for keeping track of whether a vertex has been \"visited\":\n\tmarks = new Int8Array( N );\n\n\t// Initialize a stack for keeping track of cycles:\n\ts = [];\n\n\t// Process vertices using depth-first-search...\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( marks[ i ] === 0 ) {\n\t\t\terr = visit( i );\n\t\t\tif ( err !== 0 ) {\n\t\t\t\t// Found a cycle...\n\t\t\t\ts.push( i );\n\t\t\t\treturn [ null, s ];\n\t\t\t}\n\t\t}\n\t}\n\t// Reverse the output array as the leaves were added first, followed the by the roots, via depth-first-search:\n\tgrev( out.length, out, 1 );\n\n\treturn [ out, null ];\n\n\t/**\n\t* Visits a graph vertex and follows edges until finding a leaf vertex (if one exists).\n\t*\n\t* ## Notes\n\t*\n\t* - If the function is able to successfully perform a depth-first-search, the functions returns `0`; otherwise, the function returns `-1` in the event of a cycle.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} i - vertex\n\t* @returns {integer} error code\n\t*/\n\tfunction visit( i ) {\n\t\tvar err;\n\t\tvar j;\n\n\t\t// Check if we've already processed/visited this vertex...\n\t\tif ( marks[ i ] === 2 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t// Check if we've seen this vertex before and the vertex is still being processed...\n\t\tif ( marks[ i ] === 1 ) {\n\t\t\t// We've found a cycle...\n\t\t\treturn -1;\n\t\t}\n\t\t// Mark the current vertex as currently being processed:\n\t\tmarks[ i ] = 1;\n\n\t\t// Follow all edges from the current vertex...\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tidx = self._loc( i, j, idx ); // eslint-disable-line no-underscore-dangle\n\t\t\tif ( isSet( self._buffer[ idx[0] ], idx[1] ) ) { // eslint-disable-line no-underscore-dangle\n\t\t\t\terr = visit( j );\n\t\t\t\tif ( err !== 0 ) {\n\t\t\t\t\t// This vertex is part of a cycle, so add to cycle stack...\n\t\t\t\t\ts.push( j );\n\t\t\t\t\treturn err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Mark the current vertex as processed:\n\t\tmarks[ i ] = 2;\n\n\t\t// Add to the output array now that all subsequent vertices (relative to this vertex) in the graph have already been added to the output array:\n\t\tout.push( i );\n\n\t\treturn 0;\n\t}\n});\n\n\n// EXPORTS //\n\nmodule.exports = CompactAdjacencyMatrix;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compact adjacency matrix.\n*\n* @module @stdlib/utils/compact-adjacency-matrix\n*\n* @example\n* var CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' );\n*\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function composition.\n*\n* @param {...Function} f - functions to compose\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} composite function\n*\n* @example\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = compose( c, b, a );\n*\n* var z = f( 6 );\n* // returns 3\n*/\nfunction compose() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to compose.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn composite;\n\n\t/**\n\t* Composite function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} result\n\t*/\n\tfunction composite() {\n\t\tvar args;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\targs = f[ nFuncs-1 ].apply( null, args );\n\t\tfor ( i = nFuncs-2; i >= 0; i-- ) {\n\t\t\targs = f[ i ]( args );\n\t\t}\n\t\treturn args;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = compose;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function composition.\n*\n* @module @stdlib/utils/compose\n*\n* @example\n* var compose = require( '@stdlib/utils/compose' );\n*\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = compose( c, b, a );\n*\n* var z = f( 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Creates a function which always returns the same value.\n*\n* @param {*} [value] - value to always return\n* @returns {Function} constant function\n*\n* @example\n* var fcn = wrap( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\nfunction wrap( value ) {\n\treturn constantFunction;\n\n\t/**\n\t* Constant function.\n\t*\n\t* @private\n\t* @returns {*} constant value\n\t*/\n\tfunction constantFunction() {\n\t\treturn value;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a constant function.\n*\n* @module @stdlib/utils/constant-function\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var fcn = constantFunction( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' );\nvar lowercase = require( '@stdlib/string/base/lowercase' );\nvar replace = require( '@stdlib/string/replace' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RE_WIN_DEVICE_ROOT = /^([A-Za-z]):[\\\\\\/]+/; // eslint-disable-line no-useless-escape\nvar RE_POSIX_DEVICE_ROOT =/^\\/([A-Za-z])\\//;\n\n\n// MAIN //\n\n/**\n* Converts between POSIX and Windows paths.\n*\n* @param {string} from - path to convert\n* @param {string} to - output path convention\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a string\n* @throws {RangeError} second argument must be a recognized output path convention\n* @throws {Error} cannot convert a Windows extended-length path to a non-Windows path convention\n* @returns {string} converted path\n*\n* @example\n* var p = convertPath( '/c/foo/bar/beep.c', 'win32' );\n* // returns 'c:\\foo\\bar\\beep.c'\n*\n* @example\n* var p = convertPath( '/c/foo/bar/beep.c', 'mixed' );\n* // returns 'c:/foo/bar/beep.c'\n*\n* @example\n* var p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'posix' );\n* // returns '/c/foo/bar/beep.c'\n*\n* @example\n* var p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'mixed' );\n* // returns 'C:/foo/bar/beep.c'\n*/\nfunction convertPath( from, to ) {\n\tvar device;\n\tvar parts;\n\tvar out;\n\tif ( !isString( from ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', from ) );\n\t}\n\tif ( !isString( to ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', to ) );\n\t}\n\tif (\n\t\tto !== 'win32' &&\n\t\tto !== 'mixed' &&\n\t\tto !== 'posix'\n\t) {\n\t\tthrow new Error( format( 'invalid argument. Second argument must be a recognized output path convention. Value: `%s`.', to ) );\n\t}\n\tout = from;\n\n\t// Convert to a Windows path convention by transforming a POSIX device root (if present) and using a Windows path separator...\n\tif ( to === 'win32' ) {\n\t\tparts = RE_POSIX_DEVICE_ROOT.exec( out );\n\t\tif ( parts ) {\n\t\t\tdevice = parts[ 1 ]+':\\\\';\n\t\t\tout = replace( out, RE_POSIX_DEVICE_ROOT, device );\n\t\t}\n\t\treturn replace( out, '/', '\\\\' );\n\t}\n\t// Check for Windows extended-length paths...\n\tif ( reExtendedLengthPath.REGEXP.test( from ) ) {\n\t\tthrow new Error( format( 'invalid argument. Cannot convert Windows extended-length paths to POSIX paths. Value: `%s`.', from ) );\n\t}\n\t// Convert to a mixed path convention by combining a Windows drive letter convention with a POSIX path separator...\n\tif ( to === 'mixed' ) {\n\t\tparts = RE_POSIX_DEVICE_ROOT.exec( out );\n\t\tif ( parts ) {\n\t\t\tdevice = parts[ 1 ]+':/';\n\t\t\tout = replace( out, RE_POSIX_DEVICE_ROOT, device );\n\t\t} else {\n\t\t\tparts = RE_WIN_DEVICE_ROOT.exec( out );\n\t\t\tif ( parts ) {\n\t\t\t\tdevice = parts[ 1 ]+':/';\n\t\t\t\tout = replace( out, RE_WIN_DEVICE_ROOT, device );\n\t\t\t}\n\t\t}\n\t\treturn replace( out, '\\\\', '/' );\n\t}\n\t// Convert to a POSIX path convention by transforming a Windows device root (if present) and using a POSIX path separator...\n\tparts = RE_WIN_DEVICE_ROOT.exec( out );\n\tif ( parts ) {\n\t\tdevice = '/'+lowercase( parts[ 1 ] )+'/';\n\t\tout = replace( out, RE_WIN_DEVICE_ROOT, device );\n\t}\n\treturn replace( out, '\\\\', '/' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = convertPath;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert between POSIX and Windows paths.\n*\n* @module @stdlib/utils/convert-path\n*\n* @example\n* var convertPath = require( '@stdlib/utils/convert-path' );\n*\n* var p = convertPath( '/c/foo/bar/beep.c', 'win32' );\n* // returns 'c:\\foo\\bar\\beep.c'\n*\n* p = convertPath( '/c/foo/bar/beep.c', 'mixed' );\n* // returns 'c:/foo/bar/beep.c'\n*\n* p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'posix' );\n* // returns '/c/foo/bar/beep.c'\n*\n* p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'mixed' );\n* // returns 'C:/foo/bar/beep.c'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar reRegExp = require( '@stdlib/regexp/regexp' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Parses a regular expression string and returns a new regular expression.\n*\n* @param {string} str - regular expression string\n* @throws {TypeError} must provide a regular expression string\n* @returns {(RegExp|null)} regular expression or null\n*\n* @example\n* var re = reFromString( '/beep/' );\n* // returns /beep/\n*/\nfunction reFromString( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a regular expression string. Value: `%s`.', str ) );\n\t}\n\t// Capture the regular expression pattern and any flags:\n\tstr = reRegExp().exec( str );\n\n\t// Create a new regular expression:\n\treturn ( str ) ? new RegExp( str[1], str[2] ) : null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reFromString;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a regular expression from a regular expression string.\n*\n* @module @stdlib/utils/regexp-from-string\n*\n* @example\n* var reFromString = require( '@stdlib/utils/regexp-from-string' );\n*\n* var re = reFromString( '/beep/' );\n* // returns /beep/\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertyNames = Object.getOwnPropertyNames;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn propertyNames( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\nvar keys = require( './../../keys' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/property-names\n*\n* @example\n* var getOwnPropertyNames = require( '@stdlib/utils/property-names' );\n*\n* var keys = getOwnPropertyNames({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar propertyDescriptor = Object.getOwnPropertyDescriptor;\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tvar desc;\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\tdesc = propertyDescriptor( value, property );\n\treturn ( desc === void 0 ) ? null : desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tif ( hasOwnProp( value, property ) ) {\n\t\treturn {\n\t\t\t'configurable': true,\n\t\t\t'enumerable': true,\n\t\t\t'writable': true,\n\t\t\t'value': value[ property ]\n\t\t};\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's own property.\n*\n* @module @stdlib/utils/property-descriptor\n*\n* @example\n* var getOwnPropertyDescriptor = require( '@stdlib/utils/property-descriptor' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var keys = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( './../../native-class' );\nvar getProto = require( './proto.js' );\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getPrototypeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar builtin = require( './native.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\nvar getProto = require( './detect.js' );\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getPrototypeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the prototype of a provided object.\n*\n* @module @stdlib/utils/get-prototype-of\n*\n* @example\n* var getPrototype = require( '@stdlib/utils/get-prototype-of' );\n*\n* var proto = getPrototype( {} );\n* // returns {}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Int8Array = require( '@stdlib/array/int8' );\nvar Uint8Array = require( '@stdlib/array/uint8' );\nvar Uint8ClampedArray = require( '@stdlib/array/uint8c' );\nvar Int16Array = require( '@stdlib/array/int16' );\nvar Uint16Array = require( '@stdlib/array/uint16' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float32Array = require( '@stdlib/array/float32' );\nvar Float64Array = require( '@stdlib/array/float64' );\n\n\n// VARIABLES //\n\nvar hash;\n\n\n// FUNCTIONS //\n\n/**\n* Copies an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - array to copy\n* @returns {Int8Array} new array\n*/\nfunction int8array( arr ) {\n\treturn new Int8Array( arr );\n}\n\n/**\n* Copies a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - array to copy\n* @returns {Uint8Array} new array\n*/\nfunction uint8array( arr ) {\n\treturn new Uint8Array( arr );\n}\n\n/**\n* Copies a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - array to copy\n* @returns {Uint8ClampedArray} new array\n*/\nfunction uint8clampedarray( arr ) {\n\treturn new Uint8ClampedArray( arr );\n}\n\n/**\n* Copies an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - array to copy\n* @returns {Int16Array} new array\n*/\nfunction int16array( arr ) {\n\treturn new Int16Array( arr );\n}\n\n/**\n* Copies a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - array to copy\n* @returns {Uint16Array} new array\n*/\nfunction uint16array( arr ) {\n\treturn new Uint16Array( arr );\n}\n\n/**\n* Copies an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - array to copy\n* @returns {Int32Array} new array\n*/\nfunction int32array( arr ) {\n\treturn new Int32Array( arr );\n}\n\n/**\n* Copies a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - array to copy\n* @returns {Uint32Array} new array\n*/\nfunction uint32array( arr ) {\n\treturn new Uint32Array( arr );\n}\n\n/**\n* Copies a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - array to copy\n* @returns {Float32Array} new array\n*/\nfunction float32array( arr ) {\n\treturn new Float32Array( arr );\n}\n\n/**\n* Copies a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - array to copy\n* @returns {Float64Array} new array\n*/\nfunction float64array( arr ) {\n\treturn new Float64Array( arr );\n}\n\n/**\n* Returns a hash of functions for copying typed arrays.\n*\n* @private\n* @returns {Object} function hash\n*/\nfunction typedarrays() {\n\tvar out = {\n\t\t'int8array': int8array,\n\t\t'uint8array': uint8array,\n\t\t'uint8clampedarray': uint8clampedarray,\n\t\t'int16array': int16array,\n\t\t'uint16array': uint16array,\n\t\t'int32array': int32array,\n\t\t'uint32array': uint32array,\n\t\t'float32array': float32array,\n\t\t'float64array': float64array\n\t};\n\treturn out;\n}\n\n\n// MAIN //\n\nhash = typedarrays();\n\n\n// EXPORTS //\n\nmodule.exports = hash;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar typeOf = require( './../../type-of' );\nvar regexp = require( './../../regexp-from-string' );\nvar indexOf = require( './../../index-of' );\nvar objectKeys = require( './../../keys' );\nvar propertyNames = require( './../../property-names' );\nvar propertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar defineProperty = require( './../../define-property' );\nvar copyBuffer = require( '@stdlib/buffer/from-buffer' );\nvar typedArrays = require( './typed_arrays.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Clones a class instance.\n*\n* ## Notes\n*\n* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.\n* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.\n*\n* @private\n* @param {Object} val - class instance\n* @returns {Object} new instance\n*/\nfunction cloneInstance( val ) {\n\tvar cache;\n\tvar names;\n\tvar name;\n\tvar refs;\n\tvar desc;\n\tvar tmp;\n\tvar ref;\n\tvar i;\n\n\tcache = [];\n\trefs = [];\n\n\tref = Object.create( getPrototypeOf( val ) );\n\tcache.push( val );\n\trefs.push( ref );\n\n\tnames = propertyNames( val );\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tname = names[ i ];\n\t\tdesc = propertyDescriptor( val, name );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( val[name] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( val[name], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( ref, name, desc );\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( ref );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( ref );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( ref );\n\t}\n\treturn ref;\n}\n\n/**\n* Copies an error object.\n*\n* @private\n* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy\n* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy\n*\n* @example\n* var err1 = new TypeError( 'beep' );\n*\n* var err2 = copyError( err1 );\n* // returns \n*/\nfunction copyError( error ) {\n\tvar cache = [];\n\tvar refs = [];\n\tvar keys;\n\tvar desc;\n\tvar tmp;\n\tvar key;\n\tvar err;\n\tvar i;\n\n\t// Create a new error...\n\terr = new error.constructor( error.message );\n\n\tcache.push( error );\n\trefs.push( err );\n\n\t// If a `stack` property is present, copy it over...\n\tif ( error.stack ) {\n\t\terr.stack = error.stack;\n\t}\n\t// Node.js specific (system errors)...\n\tif ( error.code ) {\n\t\terr.code = error.code;\n\t}\n\tif ( error.errno ) {\n\t\terr.errno = error.errno;\n\t}\n\tif ( error.syscall ) {\n\t\terr.syscall = error.syscall;\n\t}\n\t// Any enumerable properties...\n\tkeys = objectKeys( error );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tdesc = propertyDescriptor( error, key );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( error[ key ] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( err, key, desc );\n\t}\n\treturn err;\n}\n\n\n// MAIN //\n\n/**\n* Recursively performs a deep copy of an input object.\n*\n* @private\n* @param {*} val - value to copy\n* @param {(Array|Object)} copy - copy\n* @param {Array} cache - an array of visited objects\n* @param {Array} refs - an array of object references\n* @param {NonNegativeInteger} level - copy depth\n* @returns {*} deep copy\n*/\nfunction deepCopy( val, copy, cache, refs, level ) {\n\tvar parent;\n\tvar keys;\n\tvar name;\n\tvar desc;\n\tvar ctor;\n\tvar key;\n\tvar ref;\n\tvar x;\n\tvar i;\n\tvar j;\n\n\tlevel -= 1;\n\n\t// Primitives and functions...\n\tif (\n\t\ttypeof val !== 'object' ||\n\t\tval === null\n\t) {\n\t\treturn val;\n\t}\n\tif ( isBuffer( val ) ) {\n\t\treturn copyBuffer( val );\n\t}\n\tif ( isError( val ) ) {\n\t\treturn copyError( val );\n\t}\n\t// Objects...\n\tname = typeOf( val );\n\n\tif ( name === 'date' ) {\n\t\treturn new Date( +val );\n\t}\n\tif ( name === 'regexp' ) {\n\t\treturn regexp( val.toString() );\n\t}\n\tif ( name === 'set' ) {\n\t\treturn new Set( val );\n\t}\n\tif ( name === 'map' ) {\n\t\treturn new Map( val );\n\t}\n\tif (\n\t\tname === 'string' ||\n\t\tname === 'boolean' ||\n\t\tname === 'number'\n\t) {\n\t\t// If provided an `Object`, return an equivalent primitive!\n\t\treturn val.valueOf();\n\t}\n\tctor = typedArrays[ name ];\n\tif ( ctor ) {\n\t\treturn ctor( val );\n\t}\n\t// Class instances...\n\tif (\n\t\tname !== 'array' &&\n\t\tname !== 'object'\n\t) {\n\t\t// Cloning requires ES5 or higher...\n\t\tif ( typeof Object.freeze === 'function' ) {\n\t\t\treturn cloneInstance( val );\n\t\t}\n\t\treturn {};\n\t}\n\t// Arrays and plain objects...\n\tkeys = objectKeys( val );\n\tif ( level > 0 ) {\n\t\tparent = name;\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tx = val[ key ];\n\n\t\t\t// Primitive, Buffer, special class instance...\n\t\t\tname = typeOf( x );\n\t\t\tif (\n\t\t\t\ttypeof x !== 'object' ||\n\t\t\t\tx === null ||\n\t\t\t\t(\n\t\t\t\t\tname !== 'array' &&\n\t\t\t\t\tname !== 'object'\n\t\t\t\t) ||\n\t\t\t\tisBuffer( x )\n\t\t\t) {\n\t\t\t\tif ( parent === 'object' ) {\n\t\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\t\tdesc.value = deepCopy( x );\n\t\t\t\t\t}\n\t\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t\t} else {\n\t\t\t\t\tcopy[ key ] = deepCopy( x );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Circular reference...\n\t\t\ti = indexOf( cache, x );\n\t\t\tif ( i !== -1 ) {\n\t\t\t\tcopy[ key ] = refs[ i ];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Plain array or object...\n\t\t\tref = ( isArray( x ) ) ? new Array( x.length ) : {};\n\t\t\tcache.push( x );\n\t\t\trefs.push( ref );\n\t\t\tif ( parent === 'array' ) {\n\t\t\t\tcopy[ key ] = deepCopy( x, ref, cache, refs, level );\n\t\t\t} else {\n\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\tdesc.value = deepCopy( x, ref, cache, refs, level );\n\t\t\t\t}\n\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t}\n\t\t}\n\t} else if ( name === 'array' ) {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tcopy[ key ] = val[ key ];\n\t\t}\n\t} else {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\tdefineProperty( copy, key, desc );\n\t\t}\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( copy );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( copy );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( copy );\n\t}\n\treturn copy;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepCopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar deepCopy = require( './deep_copy.js' );\n\n\n// MAIN //\n\n/**\n* Copies or deep clones a value to an arbitrary depth.\n*\n* @param {*} value - value to copy\n* @param {NonNegativeInteger} [level=+infinity] - copy depth\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {*} value copy\n*\n* @example\n* var out = copy( 'beep' );\n* // returns 'beep'\n*\n* @example\n* var value = [\n* {\n* 'a': 1,\n* 'b': true,\n* 'c': [ 1, 2, 3 ]\n* }\n* ];\n* var out = copy( value );\n* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n*\n* var bool = ( value[0].c === out[0].c );\n* // returns false\n*/\nfunction copy( value, level ) {\n\tvar out;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isNonNegativeInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', level ) );\n\t\t}\n\t\tif ( level === 0 ) {\n\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tlevel = PINF;\n\t}\n\tout = ( isArray( value ) ) ? new Array( value.length ) : {};\n\treturn deepCopy( value, out, [value], [out], level );\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Copy or deep clone a value to an arbitrary depth.\n*\n* @module @stdlib/utils/copy\n*\n* @example\n* var copy = require( '@stdlib/utils/copy' );\n*\n* var out = copy( 'beep' );\n* // returns 'beep'\n*\n* @example\n* var copy = require( '@stdlib/utils/copy' );\n*\n* var value = [\n* {\n* 'a': 1,\n* 'b': true,\n* 'c': [ 1, 2, 3 ]\n* }\n* ];\n* var out = copy( value );\n* // returns [ {'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n*\n* var bool = ( value[0].c === out[0].c );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and returns group counts.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} counts\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = countBy( arr, indicator );\n* // returns { 'b': 3, 'f': 1 }\n*/\nfunction countBy( collection, options, indicator ) {\n\tvar thisArg;\n\tvar opts;\n\tvar err;\n\tvar out;\n\tvar len;\n\tvar cb;\n\tvar g;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tg = cb.call( thisArg, collection[ i ], i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ] += 1;\n\t\t} else {\n\t\t\tout[ g ] = 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function and return group counts.\n*\n* @module @stdlib/utils/count-by\n*\n* @example\n* var countBy = require( '@stdlib/utils/count-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = countBy( arr, indicator );\n* // returns { 'b': 3, 'f': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a function into a sequence of functions each accepting a single argument.\n*\n* @param {Function} fcn - function to curry\n* @param {PositiveInteger} [arity=fcn.length] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must be a function having at least one parameter\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} curry function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curry( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\nfunction curry( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t} else {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t\tcontext = arity;\n\t}\n\treturn createCurried( [] );\n\n\t/**\n\t* Returns a curry function.\n\t*\n\t* @private\n\t* @param {Array} args - arguments\n\t* @returns {Function} curry function\n\t*/\n\tfunction createCurried( args ) {\n\t\treturn curried;\n\n\t\t/**\n\t\t* Curry function.\n\t\t*\n\t\t* @private\n\t\t* @param {*} v - curried function parameter\n\t\t* @returns {(Function|*)} partially applied curry function or curried function result\n\t\t*/\n\t\tfunction curried( v ) {\n\t\t\tvar cargs = args.slice();\n\t\t\tcargs.push( v );\n\t\t\tif ( cargs.length < len ) {\n\t\t\t\treturn createCurried( cargs );\n\t\t\t}\n\t\t\treturn fcn.apply( context, cargs );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = curry;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a function into a sequence of functions each accepting a single argument.\n*\n* @module @stdlib/utils/curry\n*\n* @example\n* var curry = require( '@stdlib/utils/curry' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curry( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a function into a sequence of functions each accepting a single argument.\n*\n* @param {Function} fcn - function to curry\n* @param {PositiveInteger} [arity=fcn.length] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must be a function having at least one parameter\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} curry function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curryRight( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\nfunction curryRight( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t} else {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t\tcontext = arity;\n\t}\n\treturn createCurried( [] );\n\n\t/**\n\t* Returns a curry function.\n\t*\n\t* @private\n\t* @param {Array} args - arguments\n\t* @returns {Function} curry function\n\t*/\n\tfunction createCurried( args ) {\n\t\treturn curried;\n\n\t\t/**\n\t\t* Curry function.\n\t\t*\n\t\t* @private\n\t\t* @param {*} v - curried function parameter\n\t\t* @returns {(Function|*)} partially applied curry function or curried function result\n\t\t*/\n\t\tfunction curried( v ) {\n\t\t\tvar cargs = args.slice();\n\t\t\tcargs.unshift( v );\n\t\t\tif ( cargs.length < len ) {\n\t\t\t\treturn createCurried( cargs );\n\t\t\t}\n\t\t\treturn fcn.apply( context, cargs );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = curryRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a function into a sequence of functions each accepting a single argument.\n*\n* @module @stdlib/utils/curry-right\n*\n* @example\n* var curryRight = require( '@stdlib/utils/curry-right' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curryRight( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Applies provided arguments to a function and passes the result to another function.\n*\n* @private\n* @param {Function} fcn - function\n* @param {Array} args - function arguments\n* @param {Function} after - function to invoke with the result of `fcn`\n* @param {*} thisArg - evaluation context for `after`\n* @returns {*} result\n*/\nfunction apply( fcn, args, after, thisArg ) {\n\tvar r1 = fcn.apply( null, args );\n\tvar r2 = after.call( thisArg, r1 );\n\treturn ( r2 === void 0 ) ? r1 : r2;\n}\n\n\n// MAIN //\n\n/**\n* Decorates a provided function such that the function's return value is provided as an argument to another function.\n*\n* @param {Function} fcn - function to decorate\n* @param {NonNegativeInteger} arity - number of parameters\n* @param {Function} after - function to invoke with the result of the decorated function\n* @param {*} [thisArg] - evaluation context for `after`\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a function\n* @returns {Function} decorator\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter( abs, 1, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, 1, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, 1, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*/\nfunction decorateAfter( fcn, arity, after, thisArg ) {\n\tvar fcns;\n\tvar f;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( after ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', after ) );\n\t}\n\t// NOTE: we select a specific signature so that `fcn.length` is preserved, thus matching the definition of a \"decorator\" where the decorator function should be transparent to external clients (i.e., have a matching signature). While more recent JavaScript environments allow `Function.prototype.length` to be configurable, older environments do not and error when attempting to manually specify the value for a function's length. We cap support for matching signature length as signatures with many parameters are likely to be exceedingly rare, especially when used in conjunction with this API...\n\tfcns = [ fN, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 ];\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tif ( arity < fcns.length ) {\n\t\tf = fcns[ arity ];\n\t} else {\n\t\tf = fN;\n\t}\n\treturn f;\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {...*} [args] - arguments\n\t* @returns {*} result\n\t*/\n\tfunction fN() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @returns {*} result\n\t*/\n\tfunction f1( x0 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\t// NOTE: the use of a `for` loop is intentional (both here and below), as JavaScript does not require that only a fixed number of arguments be provided; the number of provided arguments may be more or less than the signature specifies.\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @returns {*} result\n\t*/\n\tfunction f2( x0, x1 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @returns {*} result\n\t*/\n\tfunction f3( x0, x1, x2 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @returns {*} result\n\t*/\n\tfunction f4( x0, x1, x2, x3 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @returns {*} result\n\t*/\n\tfunction f5( x0, x1, x2, x3, x4 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @returns {*} result\n\t*/\n\tfunction f6( x0, x1, x2, x3, x4, x5 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @returns {*} result\n\t*/\n\tfunction f7( x0, x1, x2, x3, x4, x5, x6 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @returns {*} result\n\t*/\n\tfunction f8( x0, x1, x2, x3, x4, x5, x6, x7 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @param {*} x8 - ninth argument\n\t* @returns {*} result\n\t*/\n\tfunction f9( x0, x1, x2, x3, x4, x5, x6, x7, x8 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @param {*} x8 - ninth argument\n\t* @param {*} x9 - tenth argument\n\t* @returns {*} result\n\t*/\n\tfunction f10( x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = decorateAfter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar reNativeFunction = require( '@stdlib/regexp/native-function' ).REGEXP;\nvar function2string = require( '@stdlib/function/to-string' );\nvar Fcn = require( '@stdlib/function/ctor' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\n/**\n* Captures everything that is not a right parenthesis immediately after the first left parenthesis.\n*\n* Regular expression: `/^\\s*function[^(]*\\(([^)]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `\\(`\n* - Match a left parenthesis `(`\n*\n* - `()`\n* - Capture\n*\n* - `[^)]*`\n* - Match anything except a right parenthesis `)` zero or more times\n*\n* - `)`\n* - Match a right parenthesis `)`\n*\n* - `/i`\n* - Ignore case\n*\n* @private\n* @constant\n* @type {RegExp}\n* @default /^\\s*function[^(]*\\(([^)]*)/i\n*/\nvar RE_PARAMETERS = /^\\s*function[^(]*\\(([^)]*)/i;\n\n\n// MAIN //\n\n/**\n* Decorates a provided function such that the function's return value is provided as an argument to another function.\n*\n* @param {Function} fcn - function to decorate\n* @param {NonNegativeInteger} arity - number of parameters\n* @param {Function} after - function to invoke with the result of the decorated function\n* @param {*} [thisArg] - evaluation context for `after`\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a function\n* @returns {Function} decorator\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter( abs, abs.length, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, abs.length, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, abs.length, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*/\nfunction decorateAfter( fcn, arity, after, thisArg ) {\n\tvar params;\n\tvar str;\n\tvar len;\n\tvar f;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tif ( !isFunction( after ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', after ) );\n\t}\n\tstr = function2string( fcn );\n\n\t// Code generation. Start with the function definition for creating the decorator:\n\tf = 'return function make(__$$fcn$$__,__$$after$$__,__$$thisArg$$__){';\n\n\t// Include the \"use strict\" directive:\n\tf += '\"use strict\";';\n\n\t// Generate a list of function parameters:\n\tif ( reNativeFunction.test( str ) ) {\n\t\tparams = [];\n\t\tfor ( i = 0; i < arity; i++ ) {\n\t\t\tparams.push( 'x'+i );\n\t\t}\n\t} else {\n\t\tparams = str.match( RE_PARAMETERS )[ 1 ];\n\t\tif ( params ) {\n\t\t\tparams = params.split( ',' );\n\t\t} else {\n\t\t\tparams = [];\n\t\t}\n\t\tlen = params.length;\n\t\tif ( len < arity ) {\n\t\t\tfor ( i = len; i < arity; i++ ) {\n\t\t\t\tparams.push( '__$$x'+i+'$$__' );\n\t\t\t}\n\t\t} else if ( len > arity ) {\n\t\t\tparams.length = arity;\n\t\t}\n\t}\n\tparams = params.join( ',' );\n\n\t// Create the decorator definition:\n\tf += 'return function decorator(' + params + '){';\n\n\t// Initialize an array for storing provided arguments:\n\tf += 'var __$$args$$__=[];';\n\n\t// Gather provided arguments:\n\tf += 'for (var __$$i$$__=0;__$$i$$__\n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, 1, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, 1, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter.factory( abs, 1, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'sep': '/'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns a nested property value.\n*\n* @private\n* @param {ObjectLike} obj - input object\n* @param {Array} props - list of properties defining a key path\n* @returns {*} nested property value\n*/\nfunction deepGet( obj, props ) {\n\tvar len = props.length;\n\tvar v = obj;\n\tvar i;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif (\n\t\t\tisObjectLike( v ) &&\n\t\t\thasOwnProp( v, props[ i ] )\n\t\t) {\n\t\t\tv = v[ props[ i ] ];\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepGet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dget = require( './dget.js' );\n\n\n// MAIN //\n\n/**\n* Returns a nested property value.\n*\n* @param {ObjectLike} obj - input object\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} second argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {*} nested property value\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, 'a.b.c' );\n* // returns 'd'\n*\n* @example\n* var arr = [\n* { 'a': [ {'x': 5} ] },\n* { 'a': [ {'x': 10} ] }\n* ];\n* var val = deepGet( arr, '1.a.0.x' );\n* // returns 10\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, ['a','b','c'] );\n* // returns 'd'\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, 'a/b/c', {\n* 'sep': '/'\n* });\n* // returns 'd'\n*/\nfunction deepGet( obj, path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\treturn;\n\t}\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn dget( obj, props );\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepGet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dget = require( './dget.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for retrieving a nested property value.\n*\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} first argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} deep get function\n*\n* @example\n* var dget = factory( 'a/b/c', {\n* 'sep': '/'\n* });\n*/\nfunction factory( path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn deepGet;\n\n\t/**\n\t* Returns a nested property value.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - input object\n\t* @returns {*} nested property value\n\t*\n\t* @example\n\t* var obj = { 'a': { 'b': { 'c': 'd' } } };\n\t* var val = deepGet( obj );\n\t*/\n\tfunction deepGet( obj ) {\n\t\tif ( isObjectLike( obj ) ) {\n\t\t\treturn dget( obj, props );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Get a nested property value.\n*\n* @module @stdlib/utils/deep-get\n*\n* @example\n* var deepGet = require( '@stdlib/utils/deep-get' );\n*\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* var val = deepGet( obj, 'a.b.c' );\n* // returns 'd'\n*\n* var dget = factory( 'a/b/c', {\n* 'sep': '/'\n* });\n*\n* obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* val = dget( obj );\n* // returns 'd'\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'copy': true,\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {boolean} [options.copy] - boolean indicating whether to return a new data structure\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': true,\n* 'sep': '-',\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar deepGet = require( './../../deep-get' ).factory;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Extracts a nested property value from each element of an object array.\n*\n* @param {Array} arr - source array\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=true] - boolean indicating whether to return a new data structure\n* @param {string} [options.sep=\".\"] - key path separator\n* @throws {TypeError} first argument must be an array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} destination array\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c' );\n* // returns [ 1, 2 ]\n*\n* @example\n* var arr = [\n* {'a':[0,1,2]},\n* {'a':[3,4,5]}\n* ];\n*\n* var out = deepPluck( arr, ['a',1] );\n* // returns [ 1, 4 ]\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c', {'copy':false} );\n* // returns [ 1, 2 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a|b|c', {'sep':'|'} );\n* // returns [ 1, 2 ]\n*/\nfunction deepPluck( arr, path, options ) {\n\tvar dget;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar i;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array. Value: `%s`.', arr ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.copy ) {\n\t\tout = new Array( arr.length );\n\t} else {\n\t\tout = arr;\n\t}\n\tdget = deepGet( path, {\n\t\t'sep': opts.sep\n\t});\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tout[ i ] = dget( arr[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepPluck;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Extract a nested property value from each element of an object array.\n*\n* @module @stdlib/utils/deep-pluck\n*\n* @example\n* var pluck = require( '@stdlib/utils/deep-pluck' );\n*\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c' );\n* // returns [ 1, 2 ]\n*\n* arr = [\n* {'a':[0,1,2]},\n* {'a':[3,4,5]}\n* ];\n*\n* out = deepPluck( arr, ['a',1] );\n* // returns [ 1, 4 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {boolean} [options.create] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'sep': '/'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'create' ) ) {\n\t\topts.create = options.create;\n\t\tif ( !isBoolean( opts.create ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'create', opts.create ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'create': false,\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isFunction = require( '@stdlib/assert/is-function' );\n\n\n// MAIN //\n\n/**\n* Sets a nested property.\n*\n* @private\n* @param {ObjectLike} obj - input object\n* @param {Array} props - list of properties defining a key path\n* @param {boolean} create - boolean indicating whether to create a path if the key path does not already exist\n* @param {*} val - value to set\n* @returns {boolean} boolean indicating if the property was successfully set\n*/\nfunction deepSet( obj, props, create, val ) {\n\tvar bool;\n\tvar len;\n\tvar v;\n\tvar p;\n\tvar i;\n\n\tlen = props.length;\n\tbool = false;\n\tv = obj;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tp = props[ i ];\n\t\tif ( isObjectLike( v ) ) {\n\t\t\tif ( !hasOwnProp( v, p ) ) {\n\t\t\t\tif ( create ) {\n\t\t\t\t\tv[ p ] = {};\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i === len-1 ) {\n\t\t\t\tif ( isFunction( val ) ) {\n\t\t\t\t\tv[ p ] = val( v[ p ] );\n\t\t\t\t} else {\n\t\t\t\t\tv[ p ] = val;\n\t\t\t\t}\n\t\t\t\tbool = true;\n\t\t\t} else {\n\t\t\t\tv = v[ p ];\n\t\t\t}\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dset = require( './dset.js' );\n\n\n// MAIN //\n\n/**\n* Sets a nested property value.\n*\n* @param {ObjectLike} obj - input object\n* @param {(string|Array)} path - key path\n* @param {*} value - value to set\n* @param {Options} [options] - function options\n* @param {boolean} [options.create=false] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} second argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {boolean} boolean indicating if the property was successfully set\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.b.c', 'woot' );\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( null, 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* bool = deepSet( 'bap', 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var arr = [\n* { 'a': [ {'x': 5} ] },\n* { 'a': [ {'x': 10} ] }\n* ];\n* var bool = deepSet( arr, '1.a.0.x', 25 );\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a/b/c', 'beep', {\n* 'sep': '/'\n* });\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.e.c', 'boop', {\n* 'create': true\n* });\n* // returns true\n*/\nfunction deepSet( obj, path, value, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\treturn false;\n\t}\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn dset( obj, props, opts.create, value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dset = require( './dset.js' );\n\n\n// MAIN //\n\n/**\n* Creates a reusable deep set function.\n*\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {boolean} [options.create=false] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} first argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} deep set function\n*\n* @example\n* var dset = factory( 'a/b/c', {\n* 'create': true,\n* 'sep': '/'\n* });\n*/\nfunction factory( path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn deepSet;\n\n\t/**\n\t* Sets a nested property.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - input object\n\t* @param {*} value - value to set\n\t* @returns {boolean} boolean indicating if the property was successfully set\n\t*\n\t* @example\n\t* var obj = { 'a': { 'b': { 'c': 'd' } } };\n\t* var bool = dset( obj, 'beep' );\n\t*/\n\tfunction deepSet( obj, value ) {\n\t\tif ( isObjectLike( obj ) ) {\n\t\t\treturn dset( obj, props, opts.create, value );\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Set a nested property value.\n*\n* @module @stdlib/utils/deep-set\n*\n* @example\n* var deepSet = require( '@stdlib/utils/deep-set' );\n*\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.b.c', 'beep' );\n* // returns true\n*\n* var dset = deepSet.factory( 'a/b/c', {\n* 'create': true,\n* 'sep': '/'\n* });\n*\n* obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* bool = dset( obj, 'beep' );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setConfigurableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setConfigurableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-only accessor.\n*\n* @module @stdlib/utils/define-configurable-read-only-accessor\n*\n* @example\n* var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setConfigurableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setConfigurableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setConfigurableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-only property.\n*\n* @module @stdlib/utils/define-configurable-read-only-property\n*\n* @example\n* var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' );\n*\n* var obj = {};\n*\n* setConfigurableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* var name = 'bar';\n* var obj = {};\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* setConfigurableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setConfigurableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-write accessor.\n*\n* @module @stdlib/utils/define-configurable-read-write-accessor\n*\n* @example\n* var setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' );\n*\n* var name = 'bar';\n* var obj = {};\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* setConfigurableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setConfigurableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setConfigurableWriteOnlyAccessor( obj, prop, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable write-only accessor.\n*\n* @module @stdlib/utils/define-configurable-write-only-accessor\n*\n* @example\n* var setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setConfigurableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a memoized object property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} desc - property descriptor\n* @param {boolean} [desc.configurable=false] - boolean indicating if the property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [desc.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [desc.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {Function} desc.value - function whose return value will be memoized\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {TypeError} property descriptor `value` property must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* defineMemoizedProperty( obj, 'foo', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': foo\n* });\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction defineMemoizedProperty( obj, prop, desc ) {\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isObject( desc ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', desc ) );\n\t}\n\tif ( !isFunction( desc.value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. The `value` property of the property descriptor must be a function. Value: `%s`.', desc.value ) );\n\t}\n\t// Copy descriptor properties to a new data descriptor object:\n\tdesc = {\n\t\t'configurable': ( desc.configurable === void 0 ) ? false : desc.configurable,\n\t\t'enumerable': ( desc.enumerable === void 0 ) ? false : desc.enumerable,\n\t\t'writable': ( desc.writable === void 0 ) ? false : desc.writable,\n\t\t'value': desc.value\n\t};\n\n\t// Define a configurable (at least temporarily) accessor property:\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': desc.enumerable,\n\t\t'get': getter,\n\t\t'set': ( desc.writable ) ? memoize : void 0\n\t});\n\n\t/**\n\t* Temporary get accessor.\n\t*\n\t* @private\n\t* @returns {*} property value\n\t*/\n\tfunction getter() {\n\t\tvar value = desc.value.call( obj );\n\t\tmemoize( value );\n\t\treturn value;\n\t}\n\n\t/**\n\t* Defines a memoized object property.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t*/\n\tfunction memoize( value ) {\n\t\tdesc.value = value;\n\t\tdefineProperty( obj, prop, desc );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineMemoizedProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a memoized object property.\n*\n* @module @stdlib/utils/define-memoized-property\n*\n* @example\n* var defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* defineMemoizedProperty( obj, 'foo', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': foo\n* });\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineMemoizedProperty = require( './../../define-memoized-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable memoized read-only object property.\n*\n* ## Notes\n*\n* - Configurable read-only properties are **enumerable**.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} fcn - function whose return value will be memoized and set as the property value\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedConfigurableReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction setMemoizedConfigurableReadOnly( obj, prop, fcn ) { // eslint-disable-line id-length\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tdefineMemoizedProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': fcn\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setMemoizedConfigurableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable memoized read-only object property.\n*\n* @module @stdlib/utils/define-memoized-configurable-read-only-property\n*\n* @example\n* var setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedConfigurableReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineMemoizedProperty = require( './../../define-memoized-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a memoized read-only object property.\n*\n* ## Notes\n*\n* - Read-only properties are **enumerable** and **non-configurable**.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} fcn - function whose return value will be memoized and set as the property value\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction setMemoizedReadOnly( obj, prop, fcn ) {\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tdefineMemoizedProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': fcn\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setMemoizedReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a memoized read-only object property.\n*\n* @module @stdlib/utils/define-memoized-read-only-property\n*\n* @example\n* var setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var objectKeys = require( '@stdlib/utils/keys' );\n*\n* var obj = {};\n*\n* setNonEnumerableProperty( obj, 'foo', 'bar' );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*\n* var keys = objectKeys( obj );\n* // returns []\n*/\nfunction setNonEnumerableProperty( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable property.\n*\n* @module @stdlib/utils/define-nonenumerable-property\n*\n* @example\n* var objectKeys = require( '@stdlib/utils/keys' );\n* var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' );\n*\n* var obj = {};\n*\n* setNonEnumerableProperty( obj, 'foo', 'bar' );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*\n* var keys = objectKeys( obj );\n* // returns []\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-write accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-read-write-accessor\n*\n* @example\n* var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setNonEnumerableWriteOnlyAccessor( obj, prop, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable write-only accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-write-only-accessor\n*\n* @example\n* var setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (and/or modifies) object properties.\n*\n* @name defineProperties\n* @type {Function}\n* @param {Object} obj - object on which to define the properties\n* @param {Object} props - object with property descriptors\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be an object\n* @returns {Object} object with added and/or modified properties\n*\n* @example\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar'\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* var val = obj.foo;\n* // returns 'bar'\n*\n* val = obj.baz;\n* // returns 13\n*/\nvar defineProperties = Object.defineProperties;\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines (and/or modifies) properties.\n*\n* @param {Object} obj - object on which to define the properties\n* @param {Object} props - object with property descriptors\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be an object\n* @returns {Object} object with added and/or modified properties\n*\n* @example\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar'\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* var val = obj.foo;\n* // returns 'bar'\n*\n* val = obj.baz;\n* // returns 13\n*/\nfunction defineProperties( obj, props ) {\n\tvar keys;\n\tvar name;\n\tvar i;\n\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isObject( props ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an object containing property descriptors. Value: `%s`.', props ) );\n\t}\n\tkeys = objectKeys( props );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tname = keys[ i ];\n\t\tdefineProperty( obj, name, props[ name ] );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (and/or modify) properties.\n*\n* @module @stdlib/utils/define-properties\n*\n* @example\n* var defineProperties = require( '@stdlib/utils/define-properties' );\n*\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': true\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.log( err.message );\n* }\n*/\n\n// MODULES //\n\nvar hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); // eslint-disable-line id-length\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar defineProperties;\nif ( hasDefinePropertiesSupport() ) {\n\tdefineProperties = builtin;\n} else {\n\tdefineProperties = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnlyAccessor( obj, prop, getter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-only accessor.\n*\n* @module @stdlib/utils/define-read-only-accessor\n*\n* @example\n* var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setReadWriteAccessor( obj, prop, getter, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-write accessor.\n*\n* @module @stdlib/utils/define-read-write-accessor\n*\n* @example\n* var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setWriteOnlyAccessor( obj, prop, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a write-only accessor.\n*\n* @module @stdlib/utils/define-write-only-accessor\n*\n* @example\n* var setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar RE_DIRNAME = require( '@stdlib/regexp/dirname' ).REGEXP;\n\n\n// MAIN //\n\n/**\n* Returns a path dirname.\n*\n* @param {string} path - path\n* @throws {TypeError} must provide a string primitive\n* @returns {string} directory name\n*\n* @example\n* var dir = dirname( './foo/bar/index.js' );\n* // returns './foo/bar'\n*/\nfunction dirname( path ) {\n\tif ( !isString( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Path must be a string. Value: `%s`.', path ) );\n\t}\n\treturn RE_DIRNAME.exec( path )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = dirname;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a directory name.\n*\n* @module @stdlib/utils/dirname\n*\n* @example\n* var dirname = require( '@stdlib/utils/dirname' );\n*\n* var dir = dirname( './foo/bar/index.js' );\n* // returns './foo/bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop invoking a function\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i <= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* doUntil( beep, predicate );\n*/\nfunction doUntil( fcn, predicate, thisArg ) {\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t} while ( !predicate( i ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntil;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/do-until\n*\n* @example\n* var doUntil = require( '@stdlib/utils/do-until' );\n*\n* function predicate( i ) {\n* return ( i <= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* doUntil( beep, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doUntilEach( arr, log, predicate );\n*/\nfunction doUntilEach( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t} while (\n\t\ti < len &&\n\t\t!predicate( collection[ i-1 ], i-1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/do-until-each\n*\n* @example\n* var doUntilEach = require( '@stdlib/utils/do-until-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doUntilEach( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `doUntilEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `doUntilEach()`, `[].push()` behavior is consistent with `doUntilEachRight()` `[].unshift()` behavior.\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doUntilEachRight( arr, log, predicate );\n*/\nfunction doUntilEachRight( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = len - 1;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t} while (\n\t\ti >= 0 &&\n\t\t!predicate( collection[ i+1 ], i+1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/do-until-each-right\n*\n* @example\n* var doUntilEachRight = require( '@stdlib/utils/do-until-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doUntilEachRight( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* doWhile( beep, predicate );\n*/\nfunction doWhile( fcn, predicate, thisArg ) {\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t} while ( predicate( i ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhile;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/do-while\n*\n* @example\n* var doWhile = require( '@stdlib/utils/do-while' );\n*\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* doWhile( beep, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doWhileEach( arr, log, predicate );\n*/\nfunction doWhileEach( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t} while (\n\t\ti < len &&\n\t\tpredicate( collection[ i-1 ], i-1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/do-while-each\n*\n* @example\n* var doWhileEach = require( '@stdlib/utils/do-while-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doWhileEach( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `doWhileEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `doWhileEach()`, `[].push()` behavior is consistent with `doWhileEachRight()` `[].unshift()` behavior.\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doWhileEachRight( arr, log, predicate );\n*/\nfunction doWhileEachRight( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = len - 1;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t} while (\n\t\ti >= 0 &&\n\t\tpredicate( collection[ i+1 ], i+1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/do-while-each-right\n*\n* @example\n* var doWhileEachRight = require( '@stdlib/utils/do-while-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doWhileEachRight( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* List node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\t// Why getters? Because some of the list APIs will return the list \"node\", not the value. In which case, the node API is no longer private and we have to guard against users mucking about (deleting, updating, etc) with property values (in particular, the `next` and `prev` properties).\n\tdefineProperty( this, 'next', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._next;\n\t\t}\n\t});\n\tdefineProperty( this, 'prev', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._prev;\n\t\t}\n\t});\n\tthis.value = value;\n\n\tdefineProperty( this, '_next', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\tdefineProperty( this, '_prev', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Doubly linked list constructor.\n*\n* @constructor\n* @returns {DoublyLinkedList} linked list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'foo'\n*/\nfunction DoublyLinkedList() {\n\tif ( !(this instanceof DoublyLinkedList) ) {\n\t\treturn new DoublyLinkedList();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the list.\n*\n* @name clear\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*\n* // Examine the list length:\n* var len = list.length;\n* // returns 2\n*\n* // Clear all list items:\n* list.clear();\n*\n* // Peek at the first value:\n* v = list.first();\n* // returns undefined\n*\n* // Examine the list length:\n* len = list.length;\n* // returns 0\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the first list node.\n*\n* @name first\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first;\n\t}\n});\n\n/**\n* Inserts a value into the list either before or after a provided list node.\n*\n* @name insert\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {Node} node - node after which to insert the value\n* @param {*} value - value to insert\n* @param {string} [location='after'] - location\n* @throws {Error} must provide a node belonging to the list\n* @throws {Error} must provide a recognized location\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Insert a value after the second node:\n* list.insert( node, 'boop' );\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 4\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'insert', function insert( node, value, location ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar loc;\n\tvar n;\n\tif ( arguments.length > 2 ) {\n\t\tloc = location;\n\t\tif ( loc !== 'before' && loc !== 'after' ) {\n\t\t\tthrow new Error( format( 'invalid argument. Third argument must be a recognized location. Value: `%s`.', loc ) );\n\t\t}\n\t} else {\n\t\tloc = 'after';\n\t}\n\t// Case: insert after last node (equivalent to `push()`)\n\tif ( loc === 'after' && node === this._last ) {\n\t\treturn this.push( value );\n\t}\n\t// Case: insert before first node (equivalent to `unshift()`)\n\tif ( loc === 'before' && node === this._first ) {\n\t\treturn this.unshift( value );\n\t}\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously increment the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last && n !== node ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Create a new list node:\n\tn = new Node( value );\n\n\t// Update pointers...\n\tif ( loc === 'after' ) {\n\t\tnode._next._prev = n;\n\t\tn._next = node._next;\n\n\t\tnode._next = n;\n\t\tn._prev = node;\n\t} else {\n\t\tnode._prev._next = n;\n\t\tn._prev = node._prev;\n\n\t\tnode._prev = n;\n\t\tn._next = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an iterator for iterating over a list.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from list mutation during iteration, a returned iterator **always** iterates over a list \"snapshot\", which is defined as the list of elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {string} [direction=\"forward\"] - iteration direction\n* @throws {Error} must provide a recognized iteration direction\n* @returns {Iterator} iterator\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = list.iterator();\n*\n* // Iterate over the list...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'iterator', function iterator( direction ) {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar dir;\n\tvar inc;\n\tvar i;\n\tif ( arguments.length ) {\n\t\tdir = direction;\n\t\tif ( dir !== 'forward' && dir !== 'reverse' ) {\n\t\t\tthrow new Error( format( 'invalid argument. Must provide a recognized iteration direction. Value: `%s`.', dir ) );\n\t\t}\n\t} else {\n\t\tdir = 'forward';\n\t}\n\tself = this;\n\n\t// Initialize the iteration index:\n\tif ( dir === 'forward' ) {\n\t\ti = -1;\n\t\tinc = 1;\n\t} else {\n\t\ti = this._length;\n\t\tinc = -1;\n\t}\n\t// Create a copy of list values (necessary in order to \"snapshot\" the list; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += inc;\n\t\tif ( FLG || i < 0 || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the last node.\n*\n* @name last\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = list.last().value;\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last;\n\t}\n});\n\n/**\n* List length.\n*\n* @name length\n* @memberof DoublyLinkedList.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Examine the initial list length:\n* var len = list.length;\n* // returns 0\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( DoublyLinkedList.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the end of the list.\n*\n* @name pop\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'pop', function pop() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the last value:\n\t\tvalue = this._last.value;\n\n\t\t// Check whether we have a new \"tail\" or whether we have emptied the list...\n\t\tif ( this._last._prev ) {\n\t\t\tthis._last = this._last._prev;\n\t\t\tthis._last._next = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Adds a value to the end of the list.\n*\n* @name push\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous last node:\n\t\tnode._prev = this._last; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous last node to the new node:\n\t\tthis._last._next = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the last node:\n\t\tthis._last = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Removes a list node from the list.\n*\n* @name remove\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {Node} node - node to remove\n* @throws {Error} must provide a node belonging to the list\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Remove the second node:\n* var v = list.remove( node );\n* // returns 'bar'\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'remove', function remove( node ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tvar n;\n\n\t// Case: first node (equivalent to `shift()`)\n\tif ( node === this._first ) {\n\t\treturn this.shift();\n\t}\n\t// Case: last node (equivalent to `pop()`)\n\tif ( node === this._last ) {\n\t\treturn this.pop();\n\t}\n\t// Retrieve the node value:\n\tvalue = node.value;\n\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously decrement the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Update pointers:\n\tnode._prev._next = node._next;\n\tnode._next._prev = node._prev;\n\n\t// Decrement the list length:\n\tthis._length -= 1;\n\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Removes a value from the beginning of the list.\n*\n* @name shift\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = list.shift();\n* // returns 'foo'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'shift', function shift() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the first value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"head\" or whether we have emptied the list...\n\t\tif ( this._first._next ) {\n\t\t\tthis._first = this._first._next;\n\t\t\tthis._first._prev = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an array of list values.\n*\n* @name toArray\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {Array} list values\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of list values:\n* var vals = list.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a list as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `DoublyLinkedList` instance.\n*\n* @name toJSON\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {Object} serialized list\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = list.toJSON();\n* // returns { 'type': 'doubly-linked-list', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'doubly-linked-list';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n/**\n* Adds a value to the beginning of the list.\n*\n* @name unshift\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the beginning of the list:\n* list.unshift( 'foo' ).unshift( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'foo'\n*\n* // Add a new value to the beginning of the list:\n* list.unshift( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'unshift', function unshift( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous first node:\n\t\tnode._next = this._first; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous first node to the new node:\n\t\tthis._first._prev = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the first node:\n\t\tthis._first = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n\n// EXPORTS //\n\nmodule.exports = DoublyLinkedList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Doubly linked list.\n*\n* @module @stdlib/utils/doubly-linked-list\n*\n* @example\n* var doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' );\n*\n* var list = doublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first list value:\n* v = list.shift();\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RE_CHARS = /[-\\/\\\\^$*+?.()|[\\]{}]/g; // eslint-disable-line no-useless-escape\n\n\n// MAIN //\n\n/**\n* Escapes a regular expression string.\n*\n* @param {string} str - regular expression string\n* @throws {TypeError} first argument must be a string\n* @returns {string} escaped string\n*\n* @example\n* var str = rescape( '[A-Z]*' );\n* // returns '\\\\[A\\\\-Z\\\\]\\\\*'\n*/\nfunction rescape( str ) {\n\tvar len;\n\tvar s;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a regular expression string. Value: `%s`.', str ) );\n\t}\n\t// Check if the string starts with a forward slash...\n\tif ( str[ 0 ] === '/' ) {\n\t\t// Find the last forward slash...\n\t\tlen = str.length;\n\t\tfor ( i = len-1; i >= 0; i-- ) {\n\t\t\tif ( str[ i ] === '/' ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:\n\tif ( i === void 0 || i <= 0 ) {\n\t\treturn str.replace( RE_CHARS, '\\\\$&' );\n\t}\n\t// We need to de-construct the string...\n\ts = str.substring( 1, i );\n\n\t// Only escape the characters between the `/`:\n\ts = s.replace( RE_CHARS, '\\\\$&' );\n\n\t// Reassemble:\n\tstr = str[ 0 ] + s + str.substring( i );\n\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = rescape;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Escape a regular expression string or pattern.\n*\n* @module @stdlib/utils/escape-regexp-string\n*\n* @example\n* var rescape = require( '@stdlib/utils/escape-regexp-string' );\n*\n* var str = rescape( '[A-Z]*' );\n* // returns '\\\\[A\\\\-Z\\\\]\\\\*'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar noop = require( './../../../../noop' );\n\n\n// FUNCTIONS //\n\n/**\n* Throws a provided exception.\n*\n* @private\n* @param {Error} err - error object\n* @throws {Error} exception\n*/\nfunction throwError( err ) {\n\tthrow err;\n}\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Character sequence appearing at the beginning of a row which demarcates that the row content should be parsed as a commented line. A commented line ends upon encountering the first newline character sequence, regardless of whether that newline character sequence is preceded by an escape character sequence.\n\t\t'comment': '',\n\n\t\t// Character sequence separating record fields (e.g., use `','` for CSV and use `'\\t'` for TSV).\n\t\t'delimiter': ',',\n\n\t\t// Flag indicating how quote sequences should be escaped within a quoted field. When `true`, a quote sequence must be escaped by another quote sequence. When `false`, a quote sequence must be escaped by the escape sequence.\n\t\t'doublequote': true,\n\n\t\t// Character sequence for escaping character sequences having special meaning (i.e., delimiter, newline, escape, and comment outside of quoted fields, and the quote sequence within quoted fields when `doublequote` is `false`).\n\t\t'escape': '',\n\n\t\t// Flag indicating whether to trim leading whitespace from field values. If `false`, leading whitespace is not trimmed (e.g., `a, b, c` parses as `[ 'a', ' b', ' c' ]`). If `true`, leading whitespace is trimmed (e.g., `a, b, c` parses as `[ 'a', 'b', 'c' ]`).\n\t\t'ltrim': false,\n\n\t\t// Maximum number of records to process.\n\t\t'maxRows': 1e308,\n\n\t\t// Character sequence separating rows.\n\t\t'newline': '\\r\\n',\n\n\t\t// Callback to be invoked upon closing the parser.\n\t\t'onClose': noop,\n\n\t\t// Callback to be invoked upon processing a field.\n\t\t'onColumn': noop,\n\n\t\t// Callback to be invoked upon processing a commented line.\n\t\t'onComment': null,\n\n\t\t// Callback to be invoked upon encountering an unrecoverable parse error.\n\t\t'onError': throwError,\n\n\t\t// Callback to be invoked upon processing a record.\n\t\t'onRow': noop,\n\n\t\t// Callback to be invoked upon skipping a line.\n\t\t'onSkip': null,\n\n\t\t// When `strict` is `false`, a callback to be invoked upon encountering invalid DSV.\n\t\t'onWarn': null,\n\n\t\t// Character sequence demarcating the beginning and ending of a quoted field.\n\t\t'quote': '\"',\n\n\t\t// Flag indicating whether to enable special processing of quote character sequences (i.e., whether a quote sequence should demarcate a quoted field).\n\t\t'quoting': true,\n\n\t\t// Array-like object for storing the field values of the most recently processed record. This allows reusing memory and avoiding copies upon invocation of the `onRow` callback.\n\t\t'rowBuffer': [],\n\n\t\t// Flag indicating whether to trim trailing whitespace from field values. If `false`, trailing whitespace is not trimmed (e.g., `a ,b , c` parses as `[ 'a ', 'b ', ' c' ]`). If `true`, trailing whitespace is trimmed (e.g., `a ,b ,c` parses as `[ 'a', 'b', 'c' ]`).\n\t\t'rtrim': false,\n\n\t\t// Character sequence appearing at the beginning of a row which demarcates that the row content should be skipped.\n\t\t'skip': '',\n\n\t\t// Flag indicating whether to skip over rows which are either empty or containing only whitespace.\n\t\t'skipBlankRows': false,\n\n\t\t// Callback whose return value indicates whether to skip over a row.\n\t\t'skipRow': null,\n\n\t\t// Flag indicating whether to raise an exception upon encountering invalid DSV.\n\t\t'strict': true,\n\n\t\t// Flag indicating whether to trim leading whitespace in commented lines.\n\t\t'trimComment': true,\n\n\t\t// List of characters to be treated as whitespace.\n\t\t'whitespace': [ ' ' ]\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "[\n \"closed\",\n \"comment\",\n \"escape\",\n \"error\",\n \"field\",\n \"init\",\n \"invalid_quote_end\",\n \"quote_end\",\n \"quoted_escape\",\n \"quoted_field\",\n \"skip\",\n \"skipped_comment\",\n \"skipped_escape\",\n \"skipped_field\",\n \"skipped_invalid_quote_end\",\n \"skipped_quote_end\",\n \"skipped_quoted_escape\",\n \"skipped_quoted_field\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar enum2state = require( './enum2state.json' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a table mapping state names to enumeration constants.\n*\n* @private\n* @returns {Object} mapping table\n*/\nfunction table() {\n\tvar out;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < enum2state.length; i++ ) {\n\t\tout[ enum2state[ i ] ] = i;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Table mapping state names to enumeration constants.\n*\n* @private\n* @name state2enum\n* @type {Object}\n*/\nvar state2enum = table(); // eslint-disable-line vars-on-top\n\n\n// EXPORTS //\n\nmodule.exports = state2enum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\n// Possible transition states...\nvar CLOSED = state2enum[ 'closed' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for closing a parser.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next() {\n\t\tparser._changeState( CLOSED );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:comment' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a commented line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar newlineLastIndex;\n\tvar newline;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t// Check for the end of the commented line...\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for a parser error state.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next() {\n\t\tparser._changeState( ERROR );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the maximum value.\n*\n* @private\n* @param {NonNegativeInteger} x - first value\n* @param {NonNegativeInteger} y - second value\n* @returns {NonNegativeInteger} maximum value\n*\n* @example\n* var v = max( 2, 3 );\n* // returns 3\n*\n* @example\n* var v = max( 3, 2 );\n* // returns 3\n*\n* @example\n* var v = max( 2, 2 );\n* // returns 2\n*/\nfunction max( x, y ) {\n\treturn ( x < y ) ? y : x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = max;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:escape' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence.\n*\n* ## Notes\n*\n* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar skipLastIndex;\n\tvar escapeLength;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar escape;\n\tvar strict;\n\tvar skip;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescapeLength = parser._escapeLength;\n\tescape = parser._escape;\n\n\tstrict = parser._strict;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), escapeLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\td === delimiterLastIndex &&\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, delimiterLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\td === newlineLastIndex &&\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, newlineLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape sequence.\n\t\t*/\n\t\tif (\n\t\t\td === escapeLastIndex &&\n\t\t\tch === escape[ escapeLastIndex ] &&\n\t\t\tparser._scan( escape, escapeLastIndex )\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, escapeLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a comment sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Comment sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tcursor-commentLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._copyWithin( idx-commentLastIndex, idx+1, commentLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a skip sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Skip sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for a skipped line\n\t\t\tcursor-skipLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._copyWithin( idx-skipLastIndex, idx+1, skipLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In strict mode, field separators, row separators, and escaped sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the escape sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding escape sequence supposed to be escaped? was the preceding escape sequence a mistake and should be ignored? are we missing a delimiter or newline sequence? etc.).\n\t\t* - In non-strict mode, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= max ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_ESCAPE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a special character sequence.' );\n\t\t\tparser._raiseWarning( 'INVALID_ESCAPE' )._push( ch )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:field' );\n\n// Possible transition states...\nvar ESCAPE = state2enum[ 'escape' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a field.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor - parser._cidx + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n\t\t* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( parser._cidx, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\t// Rewind the cursor to point to the last character of the preceding field:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._raiseWarning( 'INVALID_OPENING_QUOTE' )\n\t\t\t\t\t._rewind( idx )\n\t\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:init' );\n\n// Possible transition states...\nvar COMMENT = state2enum[ 'comment' ];\nvar FIELD = state2enum[ 'field' ];\nvar ESCAPE = state2enum[ 'escape' ];\nvar INIT = state2enum[ 'init' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\nvar SKIP = state2enum[ 'skip' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing the initial characters of a row.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\tvar skip;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for the start of a commented line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a commented line, the comment sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tidx-commentLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential comment match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the comment character sequence:\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._rewind( commentLastIndex )._changeState( COMMENT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for the start of a skipped line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a skipped line, the skip sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for skipped lines\n\t\t\tidx-skipLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the skip character sequence:\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._rewind( skipLastIndex )._changeState( SKIP );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n\t\t* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( 0, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\t// Rewind the cursor to the beginning of the buffer:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._raiseWarning( 'INVALID_OPENING_QUOTE' )\n\t\t\t\t\t._rewind( idx )\n\t\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:invalid_quote_end' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\n\n\n// FUNCTIONS //\n\n/**\n* Removes whitespace following a closing quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @param {NonNegativeInteger} state - next state\n* @returns {void}\n*/\nfunction removeWhitespace( parser, state ) {\n\t// Check whether the character sequence consists only of whitespace:\n\tif ( parser._isWhitespace( parser._qidx+1, parser._cursor ) ) {\n\t\t// Rewind the cursor and resume normal processing:\n\t\tparser._raiseWarning( 'INVALID_CLOSING_QUOTE' )\n\t\t\t._rewind( parser._cursor-parser._qidx )\n\t\t\t._changeState( state );\n\t\treturn;\n\t}\n\t// Non-whitespace characters came after a closing quote, leaving us in an ambiguous state: was the closing quote intended and we're missing a delimiter/newline, or was the closing quote a mistake and should have been escaped? We don't know, and so we must raise an exception:\n\tdebug( 'Error.' );\n\tparser._setErrorState( 'INVALID_CLOSING_QUOTE' )._changeState( ERROR );\n}\n\n\n// MAIN //\n\n/**\n* Returns a function for processing field characters after an ending quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar delimiter;\n\tvar newline;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex );\n\n\t\t\t// Remove whitespace and resume processing:\n\t\t\tremoveWhitespace( parser, FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex );\n\n\t\t\t// Remove whitespace and resume processing:\n\t\t\tremoveWhitespace( parser, INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quote_end' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar INVALID_QUOTE_END = state2enum[ 'invalid_quote_end' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an ending quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar delimiter;\n\tvar newline;\n\tvar strict;\n\tvar quote;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\tstrict = parser._strict;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), quoteLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `doublequote` is `true`, quote character sequences are escaped by a preceding quote character sequence.\n\t\t* - When `doublequote` is `false`, quote character sequences must be explicitly escaped using an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\t// Keep the escaped quote character sequence and transition back to a quoted field state:\n\t\t\tdebug( 'Double quote.' );\n\t\t\tparser._push( ch )._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped quote sequences must immediately follow a potential closing quote sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the quote sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding quote supposed to be escaped? was the preceding quote a mistake and should be ignored? are we missing a delimiter or newline sequence? etc.). In strict mode, we raise an exception. In non-strict mode, we only raise an exception if non-whitespace characters follow the potential closing quote sequence.\n\t\t*/\n\t\tif ( parser._cursor-parser._qidx >= max ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_CLOSING_QUOTE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebug( 'Invalid closing quote.' );\n\t\t\tparser._push( ch )._changeState( INVALID_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quoted_escape' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a quoted field.\n*\n* ## Notes\n*\n* - Within a quoted field, an escape sequence (only) escapes the quote sequence.\n* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar escapeLength;\n\tvar strict;\n\tvar quote;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescapeLength = parser._escapeLength;\n\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote sequence.\n\t\t*/\n\t\tif (\n\t\t\td === quoteLastIndex &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, quoteLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In strict mode, quote sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in a quote sequence, meaning that a quote sequence does not immediately follow the escape sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding escape sequence a mistake and should be ignored? are we missing a quote sequence? etc.).\n\t\t* - In non-strict mode, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= quoteLastIndex ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_QUOTED_ESCAPE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a quote sequence.' );\n\t\t\tparser._raiseWarning( 'INVALID_QUOTED_ESCAPE' )._push( ch )._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quoted_field' );\n\n// Possible transition states...\nvar QUOTE_END = state2enum[ 'quote_end' ];\nvar QUOTED_ESCAPE = state2enum[ 'quoted_escape' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a quoted field.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar escape;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote === false && // double quoting is disabled\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( QUOTED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an ending quote character sequence.\n\t\t*/\n\t\tif (\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skip' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIP = state2enum[ 'skip' ];\nvar SKIPPED_COMMENT = state2enum[ 'skipped_comment' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\tvar skip;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for the start of a commented line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a commented line, the comment sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tidx-commentLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential comment match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_COMMENT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for the start of a skipped line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a skipped line, the skip sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for skipped lines\n\t\t\tidx-skipLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._push( ch )._changeState( SKIP );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( 0, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_comment' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a skipped commented line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar newlineLastIndex;\n\tvar newline;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t// Check for the end of the commented line...\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_escape' );\n\n// Possible transition states...\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a skipped line.\n*\n* ## Notes\n*\n* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar escape;\n\tvar skip;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), escapeLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\td === delimiterLastIndex &&\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\td === newlineLastIndex &&\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape sequence.\n\t\t*/\n\t\tif (\n\t\t\td === escapeLastIndex &&\n\t\t\tch === escape[ escapeLastIndex ] &&\n\t\t\tparser._scan( escape, escapeLastIndex )\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a comment sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Comment sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tcursor-commentLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a skip sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Skip sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for a skipped line\n\t\t\tcursor-skipLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the escape sequence which led to the current state. Once this happens, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= max ) {\n\t\t\tdebug( 'Normal character sequence.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_field' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a field within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor - parser._cidx + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tparser._push( ch );\n\t\t\tif ( quoting ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tparser._push( ch );\n\t\t\tif ( quoting && parser._isWhitespace( parser._cidx, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_invalid_quote_end' );\n\n// Possible transition states...\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing field characters after an ending quote sequence within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar delimiter;\n\tvar newline;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quote_end' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_INVALID_QUOTE_END = state2enum[ 'skipped_invalid_quote_end' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an ending quote sequence within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar delimiter;\n\tvar newline;\n\tvar quote;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), quoteLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `doublequote` is `true`, quote character sequences are escaped by a preceding quote character sequence.\n\t\t* - When `doublequote` is `false`, quote character sequences must be explicitly escaped using an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Double quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped quote sequences must immediately follow a potential closing quote sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the quote sequence which led to the current state. Once this happens, we in an invalid state.\n\t\t*/\n\t\tif ( parser._cursor-parser._qidx >= max ) {\n\t\t\tdebug( 'Invalid closing quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_INVALID_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quoted_escape' );\n\n// Possible transition states...\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a quoted field within a skipped line.\n*\n* ## Notes\n*\n* - Within a quoted field, an escape sequence (only) escapes the quote sequence.\n* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar quoteLastIndex;\n\tvar quote;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote sequence.\n\t\t*/\n\t\tif (\n\t\t\td === quoteLastIndex &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Quote sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in a quote sequence, meaning that a quote sequence does not immediately follow the escape sequence which led to the current state. Once this happens, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= quoteLastIndex ) {\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a quote sequence.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quoted_field' );\n\n// Possible transition states...\nvar SKIPPED_QUOTE_END = state2enum[ 'skipped_quote_end' ];\nvar SKIPPED_QUOTED_ESCAPE = state2enum[ 'skipped_quoted_escape' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a quoted field within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar escape;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote === false && // double quoting is disabled\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an ending quote character sequence.\n\t\t*/\n\t\tif (\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar enum2state = require( './enum2state.json' );\nvar closed = require( './closed.js' ); // eslint-disable-line stdlib/no-redeclare\nvar comment = require( './comment.js' );\nvar error = require( './error.js' );\nvar escape = require( './escape.js' ); // eslint-disable-line stdlib/no-redeclare\nvar field = require( './field.js' );\nvar init = require( './init.js' );\nvar invalidQuoteEnd = require( './invalid_quote_end.js' );\nvar quoteEnd = require( './quote_end.js' );\nvar quotedEscape = require( './quoted_escape.js' );\nvar quotedField = require( './quoted_field.js' );\nvar skip = require( './skip.js' );\nvar skippedComment = require( './skipped_comment.js' );\nvar skippedEscape = require( './skipped_escape.js' );\nvar skippedField = require( './skipped_field.js' );\nvar skippedInvalidQuoteEnd = require( './skipped_invalid_quote_end.js' );\nvar skippedQuoteEnd = require( './skipped_quote_end.js' );\nvar skippedQuotedEscape = require( './skipped_quoted_escape.js' );\nvar skippedQuotedField = require( './skipped_quoted_field.js' );\n\n\n// VARIABLES //\n\nvar table = {\n\t'closed': closed,\n\t'comment': comment,\n\t'escape': escape,\n\t'error': error,\n\t'field': field,\n\t'init': init,\n\t'invalid_quote_end': invalidQuoteEnd,\n\t'quote_end': quoteEnd,\n\t'quoted_escape': quotedEscape,\n\t'quoted_field': quotedField,\n\t'skip': skip,\n\t'skipped_comment': skippedComment,\n\t'skipped_escape': skippedEscape,\n\t'skipped_field': skippedField,\n\t'skipped_invalid_quote_end': skippedInvalidQuoteEnd,\n\t'skipped_quote_end': skippedQuoteEnd,\n\t'skipped_quoted_escape': skippedQuotedEscape,\n\t'skipped_quoted_field': skippedQuotedField\n};\n\n\n// MAIN //\n\n/**\n* Returns an object mapping state enumeration constants to state functions.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Array} table\n*/\nfunction states( parser ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < enum2state.length; i++ ) {\n\t\tout.push( table[ enum2state[ i ] ]( parser ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = states;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this, max-len, no-underscore-dangle, max-lines */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar setReadOnly = require( './../../../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../../../define-nonenumerable-read-only-accessor' );\nvar Boolean = require( '@stdlib/boolean/ctor' );\nvar format = require( '@stdlib/string/format' );\nvar rescape = require( './../../../../escape-regexp-string' );\nvar replace = require( '@stdlib/string/base/replace' );\nvar defaults = require( './defaults.js' );\nvar state2enum = require( './states/state2enum.js' );\nvar enum2state = require( './states/enum2state.json' );\nvar states = require( './states' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'parser' );\n\n// Parser states:\nvar CLOSED = state2enum[ 'closed' ];\nvar COMMENT = state2enum[ 'comment' ];\nvar ERROR = state2enum[ 'error' ];\nvar ESCAPE = state2enum[ 'escape' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar INVALID_QUOTE_END = state2enum[ 'invalid_quote_end' ];\nvar QUOTE_END = state2enum[ 'quote_end' ];\nvar QUOTED_ESCAPE = state2enum[ 'quoted_escape' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\nvar SKIP = state2enum[ 'skip' ];\nvar SKIPPED_COMMENT = state2enum[ 'skipped_comment' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_INVALID_QUOTE_END = state2enum[ 'skipped_invalid_quote_end' ];\nvar SKIPPED_QUOTE_END = state2enum[ 'skipped_quote_end' ];\nvar SKIPPED_QUOTED_ESCAPE = state2enum[ 'skipped_quoted_escape' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// FUNCTIONS //\n\n/**\n* Returns a regular expression pattern which matches a list of strings.\n*\n* @private\n* @param {StringArray} list - list of strings to match\n* @returns {string} regular expression pattern\n*/\nfunction array2pattern( list ) {\n\tvar pattern;\n\tvar i;\n\n\tpattern = '(?:';\n\tfor ( i = 0; i < list.length-1; i++ ) {\n\t\tpattern += rescape( list[ i ] ) + '|';\n\t}\n\treturn pattern + rescape( list[ i ] ) + ')';\n}\n\n\n// MAIN //\n\n/**\n* Returns an incremental parser for delimiter-separated values.\n*\n* @constructor\n* @param {Options} options - options object\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\nfunction Parser( options ) {\n\tvar opts;\n\n\tif ( !( this instanceof Parser ) ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn new Parser( options );\n\t\t}\n\t\treturn new Parser();\n\t}\n\t// TODO: option validation; enforce quote, comment, skip, delimiter, escape, and newline all being different and none can be a substring of the other (i.e., no escape equal to `,,` and delimiter equal to `,`, and no delimiter equal to `,` and newline being `,,` and vice versa; is `,,` an escape or simply an empty field?); should probably require that \"whitespace\" does not conflict with any of the special character sequences; require at least one whitespace character\n\toptions = options || {};\n\topts = defaults();\n\n\t// Buffer for tracking internal state:\n\tthis._buffer = [];\n\n\t// Index of the most recently processed character:\n\tthis._cursor = -1;\n\n\t// Index marking the beginning of the current field:\n\tthis._cidx = 0;\n\n\t// Indices marking the most recent unescaped quote sequence:\n\tthis._qidx = -1;\n\n\t// Indices marking the most recent escape sequence:\n\tthis._eidx = -1;\n\n\t// Buffer for storing the field values for the current row:\n\tthis._rowBufferFLG = Boolean( options.rowBuffer );\n\tthis._rowBuffer = options.rowBuffer || opts.rowBuffer;\n\n\t// Column, row, and line counters:\n\tthis._col = 0;\n\tthis._row = 0;\n\tthis._line = 0;\n\n\t// Initialize flags indicating whether we're processing a commented/skipped line:\n\tthis._commented = false;\n\tthis._skipped = false;\n\n\t// Initialize the error state:\n\tthis._errname = '';\n\n\t// Extract various options:\n\tthis._comment = options.comment || opts.comment;\n\tthis._delimiter = options.delimiter || opts.delimiter;\n\tthis._doublequote = ( options.doublequote === void 0 ) ? opts.doublequote : options.doublequote;\n\tthis._escape = options.escape || opts.escape;\n\tthis._ltrim = ( options.ltrim === void 0 ) ? opts.ltrim : options.ltrim;\n\tthis._maxRows = ( options.maxRows === void 0 ) ? opts.maxRows : options.maxRows;\n\tthis._newline = options.newline || opts.newline;\n\tthis._quote = options.quote || opts.quote;\n\tthis._quoting = ( options.quoting === void 0 ) ? opts.quoting : options.quoting;\n\tthis._rtrim = ( options.rtrim === void 0 ) ? opts.rtrim : options.rtrim;\n\tthis._skip = options.skip || opts.skip;\n\tthis._skipBlankRows = ( options.skipBlankRows === void 0 ) ? opts.skipBlankRows : options.skipBlankRows;\n\tthis._skipRow = options.skipRow || opts.skipRow;\n\tthis._strict = ( options.strict === void 0 ) ? opts.strict : options.strict;\n\tthis._trimComment = ( options.trimComment === void 0 ) ? opts.trimComment : options.trimComment;\n\tthis._whitespace = array2pattern( options.whitespace || opts.whitespace );\n\n\tthis._reWhitespace = new RegExp( '^'+this._whitespace+'*([\\\\S\\\\s]*?)'+this._whitespace+'*$' );\n\tthis._reWhitespaceLeft = new RegExp( '^'+this._whitespace+'*' );\n\tthis._reWhitespaceRight = new RegExp( this._whitespace+'*$' );\n\n\tthis._onClose = options.onClose || opts.onClose;\n\tthis._onColumn = options.onColumn || opts.onColumn;\n\tthis._onComment = options.onComment || opts.onComment;\n\tthis._onRow = options.onRow || opts.onRow;\n\tthis._onSkip = options.onSkip || opts.onSkip;\n\n\tthis._onError = options.onError || opts.onError;\n\tthis._onWarn = options.onWarn || opts.onWarn;\n\n\tthis._commentLength = this._comment.length;\n\tthis._commentLastIndex = this._commentLength - 1;\n\n\tthis._delimiterLength = this._delimiter.length;\n\tthis._delimiterLastIndex = this._delimiterLength - 1;\n\n\tthis._escapeLength = this._escape.length;\n\tthis._escapeLastIndex = this._escapeLength - 1;\n\n\tthis._newlineLength = this._newline.length;\n\tthis._newlineLastIndex = this._newlineLength - 1;\n\n\tthis._quoteLength = this._quote.length;\n\tthis._quoteLastIndex = this._quoteLength - 1;\n\n\tthis._skipLength = this._skip.length;\n\tthis._skipLastIndex = this._skipLength - 1;\n\n\t// Initialize the state flag:\n\tif ( this._skipRow && this._skipRow( 0, 0 ) ) {\n\t\tthis._state = SKIP;\n\t\tthis._skipped = true;\n\t} else {\n\t\tthis._state = INIT;\n\t}\n\t// Initialize state processors...\n\tthis._states = states( this ); // NOTE: this should come after all other initialization!\n\n\treturn this;\n}\n\n/**\n* Updates state by adding a processed character to an internal buffer.\n*\n* @private\n* @name _push\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} ch - character\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_push', function push( ch ) {\n\tvar buf = this._buffer;\n\n\t// Increment the internal buffer pointer:\n\tthis._cursor += 1;\n\n\t// Only expand the internal buffer if we've run out of previously allocated memory...\n\tif ( this._cursor >= buf.length ) {\n\t\tbuf.push( ch );\n\t\tdebug( 'Internal buffer size increased. Length: %d.', buf.length );\n\t} else {\n\t\t// Reuse existing memory:\n\t\tbuf[ this._cursor ] = ch;\n\t}\n\tdebug( 'Cursor: %d. Push: %s', this._cursor, ch );\n\treturn this;\n});\n\n/**\n* Rewinds the internal buffer cursor by a specified amount.\n*\n* @private\n* @name _rewind\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} N - number of elements to rewind\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_rewind', function rewind( N ) {\n\tthis._cursor -= N;\n\n\tdebug( 'Rewind: %d. Cursor: %d.', N, this._cursor );\n\treturn this;\n});\n\n/**\n* Copies a sequence of internal buffer elements to an earlier position in the buffer.\n*\n* @private\n* @name _copyWithin\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} target - starting position to which to copy elements\n* @param {NonNegativeInteger} start - staring index of the elements to copy (inclusive)\n* @param {NonNegativeInteger} N - number of elements to copy\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_copyWithin', function copyWithin( target, start, N ) {\n\tvar buf;\n\tvar i;\n\n\tbuf = this._buffer;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tbuf[ target+i ] = buf[ start+i ];\n\t}\n\treturn this;\n});\n\n/**\n* Returns the contents of a buffer slice.\n*\n* @private\n* @name _slice\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {string} buffer contents\n*/\nsetReadOnly( Parser.prototype, '_slice', function slice( start, end ) {\n\treturn this._buffer.slice( start, end+1 ).join( '' );\n});\n\n/**\n* Checks whether the contents of a buffer slice consists of only whitespace.\n*\n* @private\n* @name _isWhitespace\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {boolean} boolean indicating whether a buffer slice consists of only whitespace\n*/\nsetReadOnly( Parser.prototype, '_isWhitespace', function isWhitespace( start, end ) {\n\treturn ( replace( this._slice( start, end ), this._reWhitespaceLeft, '' ) === '' );\n});\n\n/**\n* Resets the parser.\n*\n* @private\n* @name _reset\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_reset', function reset() {\n\t// Reset counters and indices:\n\tthis._col = 0;\n\tthis._cidx = 0;\n\tthis._qidx = -1;\n\tthis._eidx = -1;\n\n\t// Reset the parser state...\n\tif ( this._skipRow && this._skipRow( this._row, this._line ) ) {\n\t\tthis._state = SKIP;\n\t\tthis._skipped = true;\n\t} else {\n\t\tthis._state = INIT;\n\t\tthis._skipped = false;\n\t}\n\tthis._commented = false;\n\n\t// Reset the buffer:\n\tthis._cursor = -1;\n\n\tdebug( 'Parser reset.' );\n\treturn this;\n});\n\n/**\n* Sets a field value in an internal row buffer.\n*\n* @private\n* @name _set\n* @memberof Parser.prototype\n* @type {Function}\n* @param {*} value - field value\n* @param {NonNegativeInteger} idx - field index\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_setField', function set( value, idx ) {\n\tvar buf = this._rowBuffer;\n\n\t// FIXME: as buffer may be provided from userland, use `set` accessor and consider using `@stdlib/utils/push` to allow support of dynamically resizing fixed length buffers\n\n\t// Only expand the row buffer if we've run out of previously allocated memory...\n\tif ( idx >= buf.length ) {\n\t\tbuf.push( value );\n\t\tdebug( 'Row buffer size increased. Length: %d.', buf.length );\n\t} else {\n\t\t// Reuse existing memory:\n\t\tbuf[ idx ] = value;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a field value.\n*\n* @private\n* @name _getField\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {string} field value\n*/\nsetReadOnly( Parser.prototype, '_getField', function get( start, end ) {\n\tvar v = this._slice( start, end );\n\tif ( this._ltrim ) {\n\t\tif ( this._rtrim ) {\n\t\t\treturn replace( v, this._reWhitespace, '$1' );\n\t\t}\n\t\treturn replace( v, this._reWhitespaceLeft, '' );\n\t}\n\tif ( this._rtrim ) {\n\t\treturn replace( v, this._reWhitespaceRight, '' );\n\t}\n\treturn v;\n});\n\n/**\n* Returns the current row of values.\n*\n* @private\n* @name _getRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {ArrayLikeObject} row of values\n*/\nsetReadOnly( Parser.prototype, '_getRow', function get() {\n\tif ( this._rowBufferFLG ) {\n\t\treturn this._rowBuffer;\n\t}\n\t// Return a shallow copy to avoid mutating internal state:\n\treturn this._rowBuffer.slice( 0, this._col );\n});\n\n/**\n* Scans the internal buffer for a specified character sequence.\n*\n* ## Notes\n*\n* - Given an internal buffer\n*\n* ```text\n* | ... | a | b |\n* ```\n*\n* search character sequence\n*\n* ```text\n* | a | b | c |\n* ```\n*\n* and `N` equal to `2`, the method will begin scanning from the position of `a` in the internal buffer above and compare to each element of the first `N` characters of the search character sequence.\n*\n* This method is intended to be used in scenarios where we already know that an incoming character matches the last character of the search sequence, and we want to know whether the rest of the search sequence matches the most recently added elements in the internal buffer.\n*\n* @private\n* @name _scan\n* @memberof Parser.prototype\n* @type {Function}\n* @param {StringArray} search - character sequence\n* @param {NonNegativeInteger} N - number of characters to search\n* @returns {boolean} boolean indicating whether a match was found\n*/\nsetReadOnly( Parser.prototype, '_scan', function scan( search, N ) {\n\tvar buf;\n\tvar idx;\n\tvar i;\n\n\tbuf = this._buffer;\n\tidx = this._cursor - N + 1;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( buf[ idx+i ] !== search[ i ] ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ( i === N );\n});\n\n/**\n* Processes a field.\n*\n* @private\n* @name _onField\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onField', function onField() {\n\t// Extract the field value:\n\tvar v = this._getField( this._cidx, this._cursor );\n\n\t// Insert the field value into the row buffer:\n\tthis._setField( v, this._col );\n\n\t// Invoke a callback for receiving field values:\n\tthis._onColumn( v, this._row, this._col, this._line );\n\tdebug( 'Field. Line: %d. Row: %d. Column: %d. Value: %s', this._line, this._row, this._col, v );\n\n\t// Increment the field counter to record that we've moved on to the next field:\n\tthis._col += 1;\n\n\t// Increment the index marking the beginning of the next field:\n\tthis._cidx = this._cursor + 1; // +1 as the cursor currently points to the last character in the current field, and, thus, the next field should start at the next index\n\n\t// Reset indices:\n\tthis._qidx = -1;\n\tthis._eidx = -1;\n\n\treturn this;\n});\n\n/**\n* Processes a record.\n*\n* @private\n* @name _onRecord\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onRecord', function onRecord() {\n\tvar v;\n\n\t// Extract the field value:\n\tv = this._getField( this._cidx, this._cursor );\n\n\t// Check for a blank row (i.e., a row consisting only of whitespace):\n\tif ( this._skipBlankRows && this._col === 0 ) {\n\t\tif ( v === '' || replace( v, this._reWhitespaceLeft, '' ) === '' ) {\n\t\t\treturn this._onSkippedRow();\n\t\t}\n\t}\n\t// Insert the field value into the row buffer:\n\tthis._setField( v, this._col );\n\n\t// Invoke a callback for receiving field values:\n\tthis._onColumn( v, this._row, this._col, this._line );\n\tthis._col += 1;\n\n\t// Invoke a callback for receiving rows:\n\tthis._onRow( this._getRow(), this._row, this._col, this._line );\n\tdebug( 'Record. Line: %d. Fields: %d.', this._line, this._col );\n\n\t// Increment row and line counters to indicate that we've moved on to the next row/line:\n\tthis._row += 1;\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\t// Check whether we have processed a desired number of rows...\n\tif ( this._row >= this._maxRows ) {\n\t\tthis._changeState( CLOSED );\n\t}\n\treturn this;\n});\n\n/**\n* Processes a commented row.\n*\n* @private\n* @name _onCommentedRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onCommentedRow', function onCommentedRow() {\n\tvar v;\n\n\t// Invoke a callback for receiving commented lines:\n\tif ( this._onComment ) {\n\t\tv = this._slice( 0, this._cursor );\n\t\tif ( this._trimComment ) {\n\t\t\tv = replace( v, this._reWhitespaceLeft, '' );\n\t\t}\n\t\tthis._onComment( v, this._line );\n\t\tdebug( 'Comment. Line: %d. Value: %s', this._line, v );\n\t} else {\n\t\tdebug( 'Comment. Line: %d.', this._line );\n\t}\n\t// Increment the counter for how many lines have been processed:\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\treturn this;\n});\n\n/**\n* Processes a skipped row.\n*\n* @private\n* @name _onSkippedRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onSkippedRow', function onSkippedRow() {\n\tvar v;\n\n\t// Invoke a callback for receiving skipped lines:\n\tif ( this._onSkip ) {\n\t\tv = this._slice( 0, this._cursor );\n\t\tthis._onSkip( v, this._line );\n\t\tdebug( 'Skipped row. Line: %d. Value: %s', this._line, v );\n\t} else {\n\t\tdebug( 'Skipped row. Line: %d.', this._line );\n\t}\n\t// Increment the counter for how many lines have been processed:\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\treturn this;\n});\n\n/**\n* Processes a closing quote sequence.\n*\n* @private\n* @name _onClosingQuote\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onClosingQuote', function onClosingQuote() {\n\t// Cache the cursor position marking the end of the closing quote sequence:\n\tthis._qidx = this._cursor;\n\treturn this;\n});\n\n/**\n* Processes an escape sequence.\n*\n* @private\n* @name _onEscape\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onEscape', function onEscape() {\n\t// Cache the cursor position marking the end of the escape sequence:\n\tthis._eidx = this._cursor;\n\treturn this;\n});\n\n/**\n* Creates a parser exception.\n*\n* @private\n* @name _createException\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - exception name\n* @returns {Error} parser exception\n*/\nsetReadOnly( Parser.prototype, '_createException', function createException( name ) {\n\tvar err;\n\n\tswitch ( name ) {\n\tcase 'INVALID_CLOSING_QUOTE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains a closing quote which is not immediately followed by a delimiter or newline.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_OPENING_QUOTE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an opening quote which does not immediately follow a delimiter or newline.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_ESCAPE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence which is not immediately followed by a special character sequence.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_QUOTED_ESCAPE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence within a quoted field which is not immediately followed by a quote sequence.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'CLOSED':\n\t\terr = new Error( 'invalid operation. Parser is unable to parse new chunks, as the parser has been closed. To parse new chunks, create a new parser instance.' );\n\t\tbreak;\n\tdefault:\n\t\terr = new Error( 'invalid operation. Parser is in an unrecoverable error state. To parse new chunks, create a new parser instance.' );\n\t\tbreak;\n\t}\n\treturn err;\n});\n\n/**\n* Raises a parser warning.\n*\n* @private\n* @name _raiseWarning\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - exception name\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_raiseWarning', function raiseWarning( name ) {\n\tvar err;\n\n\tif ( this._onWarn ) {\n\t\terr = this._createException( name );\n\n\t\tdebug( 'Warning: %s', err.message );\n\t\tthis._onWarn( err );\n\t}\n\treturn this;\n});\n\n/**\n* Raises a parser exception.\n*\n* @private\n* @name _raiseException\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_raiseException', function raiseException() {\n\tvar err = this._createException( this._errname );\n\n\tdebug( 'Error: %s', err.message );\n\tthis._onError( err );\n\n\treturn this;\n});\n\n/**\n* Updates the parser state.\n*\n* @private\n* @name _changeState\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} state - state enumeration constant\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_changeState', function changeState( state ) {\n\tdebug( 'State transition: %s -> %s.', enum2state[ this._state ], enum2state[ state ] );\n\n\tswitch ( state ) { // eslint-disable-line default-case\n\tcase CLOSED:\n\t\tthis._close();\n\t\tbreak;\n\tcase COMMENT:\n\t\tthis._commented = true;\n\t\tbreak;\n\tcase ERROR:\n\t\tthis._raiseException();\n\t\tbreak;\n\tcase ESCAPE:\n\t\tthis._onEscape();\n\t\tbreak;\n\tcase FIELD:\n\t\tif ( this._state !== ESCAPE ) {\n\t\t\tthis._onField();\n\t\t}\n\t\tbreak;\n\tcase INIT:\n\t\tif ( this._commented ) {\n\t\t\tthis._onCommentedRow();\n\t\t} else if ( this._skipped ) {\n\t\t\tthis._onSkippedRow();\n\t\t} else {\n\t\t\tthis._onRecord();\n\t\t}\n\t\tbreak;\n\tcase INVALID_QUOTE_END:\n\t\tbreak;\n\tcase QUOTE_END:\n\t\tthis._onClosingQuote();\n\t\tbreak;\n\tcase QUOTED_ESCAPE:\n\t\tthis._onEscape();\n\t\tbreak;\n\tcase QUOTED_FIELD:\n\t\tbreak;\n\tcase SKIP:\n\t\tthis._skipped = true;\n\t\tbreak;\n\tcase SKIPPED_COMMENT:\n\tcase SKIPPED_ESCAPE:\n\tcase SKIPPED_FIELD:\n\tcase SKIPPED_INVALID_QUOTE_END:\n\tcase SKIPPED_QUOTE_END:\n\tcase SKIPPED_QUOTED_ESCAPE:\n\tcase SKIPPED_QUOTED_FIELD:\n\t\tbreak;\n\t}\n\tthis._state = state;\n\treturn this;\n});\n\n/**\n* Sets the parser's error state.\n*\n* @private\n* @name _setErrorState\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - error name\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_setErrorState', function setErrorState( name ) {\n\tif ( name ) {\n\t\tdebug( 'Error: %s.', name );\n\t} else {\n\t\tdebug( 'Reset error state.' );\n\t}\n\tthis._errname = name;\n\treturn this;\n});\n\n/**\n* Closes the parser.\n*\n* @private\n* @name _close\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_close', function close() {\n\tvar state;\n\tvar v;\n\n\tif ( this.done ) {\n\t\tthis._setErrorState( CLOSED )._changeState( ERROR );\n\t\treturn this;\n\t}\n\tif ( this._cursor >= 0 ) {\n\t\tstate = this._state;\n\t\tif ( state === INIT || state === FIELD || state === QUOTE_END ) {\n\t\t\t// If the current state is \"field\" or \"quote end\", we're in a valid state and can simply transition to our initial state to indicate that we've processed a record:\n\t\t\tthis._changeState( INIT )._onClose();\n\t\t} else {\n\t\t\t// Check if we were able to process part of a row...\n\t\t\tif ( this._col ) {\n\t\t\t\t// This may be an incomplete row!!!\n\t\t\t\tthis._onRow( this._getRow(), this._row, this._col );\n\t\t\t}\n\t\t\t// Extract however much of the current field we were able to process:\n\t\t\tv = this._slice( this._cidx, this._cursor );\n\n\t\t\t// Return the unfinished field to the client (although this may not be equal to the original character sequence, as escape sequences may have already been stripped!):\n\t\t\tdebug( 'Flush: %s', v );\n\t\t\tthis._onClose( v );\n\t\t}\n\t} else {\n\t\tthis._onClose();\n\t}\n\tdebug( 'Closed.' );\n\treturn this;\n});\n\n/**\n* Parses the next chunk.\n*\n* @name next\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} chunk - chunk\n* @throws {Error} unable to parse new chunks\n* @throws {Error} invalid field\n* @throws {Error} invalid record\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*/\nsetReadOnly( Parser.prototype, 'next', function next( chunk ) {\n\tvar states;\n\tvar i;\n\n\tdebug( 'Chunk: %s', chunk );\n\n\tif ( this.done ) {\n\t\tthis._setErrorState( CLOSED )._changeState( ERROR );\n\t\treturn this;\n\t}\n\tstates = this._states;\n\tfor ( i = 0; i < chunk.length; i++ ) {\n\t\tstates[ this._state ]( chunk[ i ] );\n\t\tif ( this._state === CLOSED || this._state === ERROR ) {\n\t\t\treturn this;\n\t\t}\n\t}\n\treturn this;\n});\n\n/**\n* Closes the parser.\n*\n* @name close\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*/\nsetReadOnly( Parser.prototype, 'close', function close() {\n\tif ( this.done ) {\n\t\treturn this;\n\t}\n\tthis._changeState( CLOSED );\n\treturn this;\n});\n\n/**\n* Boolean indicating whether a parser is able to process new chunks.\n*\n* @name done\n* @memberof Parser.prototype\n* @readonly\n* @type {boolean}\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\nsetReadOnlyAccessor( Parser.prototype, 'done', function get() {\n\treturn ( this._state === CLOSED ) || ( this._state === ERROR );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Parser;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Incremental parser for delimiter-separated values.\n*\n* @module @stdlib/utils/dsv/base/parse\n*\n* @example\n* var Parser = require( '@stdlib/utils/dsv/base/parse' );\n*\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name parse\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/dsv/base/parse}\n*/\nsetReadOnly( ns, 'parse', require( './../../../dsv/base/parse' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/dsv/base}\n*/\nsetReadOnly( ns, 'base', require( './../../dsv/base' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property `[key, value]` pairs.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} array containing key-value pairs\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var entries = objectEntries( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\nfunction objectEntries( obj ) {\n\tvar keys;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( [ keys[i], obj[ keys[i] ] ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectEntries;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property `[key, value]` pairs.\n*\n* @module @stdlib/utils/entries\n*\n* @example\n* var objectEntries = require( '@stdlib/utils/entries' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var entries = objectEntries( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property `[key, value]` pairs.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} array containing key-value pairs\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var entries = objectEntriesIn( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\nfunction objectEntriesIn( obj ) {\n\tvar key;\n\tvar out;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( [ key, obj[ key ] ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectEntriesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property `[key, value]` pairs.\n*\n* @module @stdlib/utils/entries-in\n*\n* @example\n* var objectEntriesIn = require( '@stdlib/utils/entries-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var entries = objectEntriesIn( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertySymbols !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertySymbols = Object.getOwnPropertySymbols;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own symbol properties\n*\n* @example\n* var symbols = getOwnPropertySymbols( {} );\n*/\nfunction getOwnPropertySymbols( value ) {\n\treturn propertySymbols( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {EmptyArray} a list of own symbol properties\n*\n* @example\n* var symbols = getOwnPropertySymbols( {} );\n* // returns []\n*/\nfunction getOwnPropertySymbols() {\n\treturn [];\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own symbol properties.\n*\n* @module @stdlib/utils/property-symbols\n*\n* @example\n* var getOwnPropertySymbols = require( '@stdlib/utils/property-symbols' );\n*\n* var symbols = getOwnPropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keys = require( './../../keys' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property enumerable names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = enumerableProperties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction enumerableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tout = keys( value );\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isEnumerable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names and symbols.\n*\n* @module @stdlib/utils/enumerable-properties\n*\n* @example\n* var enumerableProperties = require( '@stdlib/utils/enumerable-properties' );\n*\n* var props = enumerableProperties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited enumerable property names and symbols\n*\n* @example\n* var props = enumerablePropertiesIn( [] );\n* // returns []\n*/\nfunction enumerablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting enumerable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property names and symbols.\n*\n* @module @stdlib/utils/enumerable-properties-in\n*\n* @example\n* var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' );\n*\n* var props = enumerablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable symbol properties\n*\n* @example\n* var symbols = enumerablePropertySymbols( {} );\n*/\nfunction enumerablePropertySymbols( value ) {\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isEnumerableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable symbol properties.\n*\n* @module @stdlib/utils/enumerable-property-symbols\n*\n* @example\n* var enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' );\n*\n* var symbols = enumerablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited enumerable symbol properties\n*\n* @example\n* var symbols = enumerablePropertySymbolsIn( {} );\n*/\nfunction enumerablePropertySymbolsIn( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting enumerable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable symbol properties.\n*\n* @module @stdlib/utils/enumerable-property-symbols-in\n*\n* @example\n* var enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' );\n*\n* var symbols = enumerablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Alias for `eval` global.\n*\n* @module @stdlib/utils/eval\n*\n* @example\n* var evil = require( '@stdlib/utils/eval' );\n*\n* var v = evil( '5*4*3*2*1' );\n* // returns 120\n*/\n\n// MODULES //\n\nvar evil = eval; // eslint-disable-line no-eval\n\n\n// EXPORTS //\n\nmodule.exports = evil;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection are truthy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether all elements are truthy\n*\n* @example\n* var arr = [ 1, 1, 1, 1, 1 ];\n*\n* var bool = every( arr );\n* // returns true\n*/\nfunction every( collection ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( !collection[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection are truthy.\n*\n* @module @stdlib/utils/every\n*\n* @example\n* var every = require( '@stdlib/utils/every' );\n*\n* var arr = [ 1, 1, 1, 1, 1 ];\n*\n* var bool = every( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyBy( arr, isPositive );\n* // returns true\n*/\nfunction everyBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( !out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/every-by\n*\n* @example\n* var every = require( '@stdlib/utils/every-by' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyBy( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `every` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `every()`, `[].push()` behavior is consistent with `everyByRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyByRight( arr, isPositive );\n* // returns true\n*/\nfunction everyByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( !out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/every-by-right\n*\n* @example\n* var everyByRight = require( '@stdlib/utils/every-by-right' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyByRight( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar RE_EXTNAME = require( '@stdlib/regexp/extname' ).REGEXP;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a filename extension.\n*\n* @param {string} filename - filename\n* @throws {TypeError} must provide a string primitive\n* @returns {string} filename extension\n*\n* @example\n* var ext = extname( 'index.js' );\n* // returns '.js'\n*/\nfunction extname( filename ) {\n\tif ( !isString( filename ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Filename must be a string. Value: `%s`.', filename ) );\n\t}\n\treturn RE_EXTNAME.exec( filename )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = extname;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a filename extension.\n*\n* @module @stdlib/utils/extname\n*\n* @example\n* var extname = require( '@stdlib/utils/extname' );\n*\n* var ext = extname( 'index.js' );\n* // returns '.js'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Queue node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\tthis.next = null;\n\tthis.prev = null;\n\tthis.value = value;\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* First-in-first-out queue constructor.\n*\n* @constructor\n* @returns {FIFO} FIFO queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nfunction FIFO() {\n\tif ( !(this instanceof FIFO) ) {\n\t\treturn new FIFO();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the queue.\n*\n* @name clear\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {FIFO} queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = queue.first();\n* // returns 'foo'\n*\n* // Examine the queue length:\n* var len = queue.length;\n* // returns 2\n*\n* // Clear all queue items:\n* queue.clear();\n*\n* // Peek at the first value:\n* v = queue.first();\n* // returns undefined\n*\n* // Examine the queue length:\n* len = queue.length;\n* // returns 0\n*/\nsetReadOnly( FIFO.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the \"oldest\" queue value (i.e., the value which is \"first-out\").\n*\n* @name first\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} \"oldest\" queue value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = queue.first();\n* // returns 'foo'\n*/\nsetReadOnly( FIFO.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first.value;\n\t}\n});\n\n/**\n* Returns an iterator for iterating over a queue.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from queue mutation during iteration, a returned iterator **always** iterates over a queue \"snapshot\", which is defined as the list of queue elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = queue.iterator();\n*\n* // Iterate over the queue...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( FIFO.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = -1;\n\n\t// Create a copy of queue values (necessary in order to \"snapshot\" the queue; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the \"newest\" queue value (i.e., the value which is currently \"last-out\").\n*\n* @name last\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} \"newest\" queue value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = queue.last();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last.value;\n\t}\n});\n\n/**\n* Queue length.\n*\n* @name length\n* @memberof FIFO.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var queue = new FIFO();\n*\n* // Examine the initial queue length:\n* var len = queue.length;\n* // returns 0\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current queue length:\n* len = queue.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( FIFO.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the queue.\n*\n* @name pop\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'pop', function pop() {\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the \"first-out\" value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"first-out\" or whether we have drained the queue...\n\t\tif ( this._first.next ) {\n\t\t\tthis._first = this._first.next;\n\t\t\tthis._first.prev = null;\n\t\t} else {\n\t\t\t// Queue is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the queue length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n});\n\n/**\n* Adds a value to the queue.\n*\n* @name push\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {FIFO} queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new queue node:\n\tnode = new Node( value );\n\n\t// Check whether the queue is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only queued node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the node to the previous most \"recent\" node:\n\t\tnode.prev = this._last;\n\n\t\t// Link the previous most \"recent\" node to the new node:\n\t\tthis._last.next = node;\n\n\t\t// Update the queue pointer for the \"last\" node to the new node:\n\t\tthis._last = node;\n\t}\n\t// Increment the queue length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Returns an array of queue values.\n*\n* @name toArray\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Array} queue values\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of queue values:\n* var vals = queue.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( FIFO.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a queue as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `FIFO` instance.\n*\n* @name toJSON\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Object} serialized queue\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = queue.toJSON();\n* // returns { 'type': 'fifo', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( FIFO.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'fifo';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = FIFO;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* First-in-first-out queue.\n*\n* @module @stdlib/utils/fifo\n*\n* @example\n* var fifo = require( '@stdlib/utils/fifo' );\n*\n* var queue = fifo();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a predicate function.\n*\n* ## Notes\n*\n- The predicate function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* - Only those arguments in which the predicate function returns a truthy value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v !== 2 );\n* }\n*\n* var bar = filterArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction filterArguments( fcn, predicate, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function according to a predicate function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar v;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( predicate( v, i ) ) {\n\t\t\t\targs.push( v );\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = filterArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a predicate function.\n*\n* @module @stdlib/utils/filter-arguments\n*\n* @example\n* var filterArguments = require( '@stdlib/utils/filter-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v !== 2 );\n* }\n*\n* var bar = filterArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RETURNS = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Finds elements in an array-like object that satisfy a test condition.\n*\n* @param {(Collection|string)} arr - object from which elements will be tested\n* @param {Options} [options] - function options\n* @param {integer} [options.k=arr.length] - limits the number of returned elements\n* @param {string} [options.returns='indices'] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} clbk - function invoked for each array element. If the return value is truthy, the value is considered to have satisfied the test condition.\n* @throws {TypeError} first argument must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} `options.k` must be an integer\n* @throws {TypeError} `options.returns` must be a string equal to `values`, `indices` or `*`\n* @returns {Array} array of indices, element values, or arrays of index-value pairs\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var vals = find( data, condition );\n* // returns [ 0, 2, 3 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': 2,\n* 'returns': 'values'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ 30, 50 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var vals = find( data, condition );\n* // returns []\n*\n* function condition( val ) {\n* return val > 1000;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': -2,\n* 'returns': 'values'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ 60, 50 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': -2,\n* 'returns': '*'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ [3, 60], [2, 50] ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*/\nfunction find( arr, options, clbk ) { // eslint-disable-line stdlib/no-redeclare\n\tvar count;\n\tvar mode;\n\tvar opts;\n\tvar len;\n\tvar out;\n\tvar ret;\n\tvar cb;\n\tvar i;\n\tvar k;\n\tvar v;\n\n\tmode = 0;\n\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( arguments.length < 3 ) {\n\t\topts = {};\n\t\tcb = options;\n\t} else {\n\t\topts = options;\n\t\tcb = clbk;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( !isObject( opts ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t}\n\tif ( hasOwnProp( opts, 'k' ) ) {\n\t\tk = opts.k;\n\t\tif ( !isInteger( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an integer. Option: `%s`.', 'k', k ) );\n\t\t}\n\t} else {\n\t\tk = len;\n\t}\n\tif ( hasOwnProp( opts, 'returns' ) ) {\n\t\tret = opts.returns;\n\t\tif ( !isString( ret ) || indexOf( RETURNS, ret ) === -1 ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', RETURNS.join( '\", \"' ), ret ) );\n\t\t}\n\t\tif ( ret === 'values' ) {\n\t\t\tmode = 1;\n\t\t} else if ( ret === '*' ) {\n\t\t\tmode = 2;\n\t\t}\n\t}\n\tout = [];\n\tcount = 0;\n\n\tif ( k === 0 ) {\n\t\treturn out;\n\t}\n\tif ( k > 0 ) {\n\t\t// Search moving from begin-to-end [0,1,...]:\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv = arr[ i ];\n\t\t\tif ( cb( v, i, arr ) ) { // eslint-disable-line node/callback-return\n\t\t\t\tif ( mode === 2 ) {\n\t\t\t\t\tout.push( [ i, v ] );\n\t\t\t\t} else if ( mode === 1 ) {\n\t\t\t\t\tout.push( v );\n\t\t\t\t} else {\n\t\t\t\t\tout.push( i );\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t\tif ( count === k ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\t// Search moving from end-to-begin [...,2,1,0]:\n\tk = -k;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tv = arr[ i ];\n\t\tif ( cb( v, i, arr ) ) { // eslint-disable-line node/callback-return\n\t\t\tif ( mode === 2 ) {\n\t\t\t\tout.push( [ i, v ] );\n\t\t\t} else if ( mode === 1 ) {\n\t\t\t\tout.push( v );\n\t\t\t} else {\n\t\t\t\tout.push( i );\n\t\t\t}\n\t\t\tcount += 1;\n\t\t\tif ( count === k ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = find;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Find elements in an array-like object that satisfy a test condition.\n*\n* @module @stdlib/utils/find\n*\n* @example\n* var find = require( '@stdlib/utils/find' );\n*\n* var data = [ 30, 20, 50, 60, 10 ];\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* var vals = find( data, condition );\n* // returns [ 0, 2, 3 ]\n*\n* data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': 2,\n* 'returns': 'values'\n* };\n* vals = find( data, opts, condition );\n* // returns [ 30, 50 ]\n*/\n\n// MODULES //\n\nvar find = require( './find.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// EXPORTS //\n\nmodule.exports = find;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar FLOAT64_MAX = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\nvar defaults = {\n\t'copy': false,\n\t'depth': FLOAT64_MAX\n};\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - depth to flatten\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy array elements\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'depth': 10,\n* 'copy': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'depth' ) ) {\n\t\topts.depth = options.depth;\n\t\tif ( !isNonNegativeInteger( opts.depth ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'depth', opts.depth ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\n\n\n// MAIN //\n\n/**\n* Recursively flattens an array.\n*\n* @private\n* @param {Array} out - output array\n* @param {ArrayLikeObject} arr - input array\n* @param {NonNegativeInteger} depth - recursion depth\n* @returns {Array} output array\n*/\nfunction recurse( out, arr, depth ) {\n\tvar v;\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( depth && isArrayLikeObject( v ) ) {\n\t\t\trecurse( out, v, depth-1 );\n\t\t} else {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = recurse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar copy = require( './../../copy' );\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar recurse = require( './recurse.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an array.\n*\n* @param {ArrayLikeObject} arr - input array\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements\n* @throws {TypeError} first argument must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} flattened array\n*\n* @example\n* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];\n*\n* var out = flattenArray( arr );\n* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n*/\nfunction flattenArray( arr, options ) {\n\tvar opts;\n\tvar err;\n\tvar out;\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\topts = {\n\t\t'copy': defaults.copy,\n\t\t'depth': defaults.depth\n\t};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.depth === 0 ) {\n\t\tout = arr;\n\t} else {\n\t\tout = recurse( [], arr, opts.depth );\n\t}\n\tif ( opts.copy ) {\n\t\treturn copy( out );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Fcn = require( '@stdlib/function/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array containing elements all having the same dimensions.\n*\n* @private\n* @param {PositiveIntegerArray} dims - dimensions\n* @returns {Function} flatten function\n*/\nfunction genFcn( dims ) {\n\tvar len;\n\tvar n;\n\tvar f;\n\tvar i;\n\n\t// Code generation. Start with the function definition:\n\tf = 'return function flattenArray(x){';\n\n\t// Create the function body...\n\tlen = dims.length;\n\tn = len - 1;\n\n\t// Create the variables...\n\tf += 'var o=[];var ';\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += 'i' + i;\n\t\tif ( i < n ) {\n\t\t\tf += ',';\n\t\t} else {\n\t\t\tf += ';';\n\t\t}\n\t}\n\t// Create the nested for loops...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += 'for(i' + i + '=0;i' + i + '<' + dims[ i ] + ';i' + i + '++){';\n\t}\n\t// Create the code which accesses the nested array values and pushes them onto the flattened array.\n\tf += 'o.push(x';\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += '[i' + i + ']';\n\t}\n\tf += ');';\n\n\t// Closing braces...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += '}';\n\t}\n\tf += 'return o;';\n\n\t// Close the function:\n\tf += '}';\n\n\t// Add a source directive for debugging:\n\tf += '//# sourceURL=flatten_array.gen_fcn.js';\n\n\t// Create the function in the global scope:\n\treturn ( new Fcn( f ) )();\n\n\t/*\n\t* e.g.,\n\t*\n\t* function flattenArray( x ) {\n\t* var o = [];\n\t* var i0, i1;\n\t* for ( i0 = 0; i0 < 2; i0++ ) {\n\t* for ( i1 = 0; i1 < 2; i1++ ) {\n\t* o.push( x[i0][i1] );\n\t* }\n\t* }\n\t* return o;\n\t* }\n\t*/\n}\n\n\n// EXPORTS //\n\nmodule.exports = genFcn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array.\n*\n* @private\n* @param {Function} flatten - flatten function\n* @returns {Function} wrapped flatten function\n*/\nfunction wrap( flatten ) {\n\treturn flattenArray;\n\n\t/**\n\t* Flattens an array.\n\t*\n\t* @private\n\t* @param {ArrayLikeObject} arr - array to flatten\n\t* @throws {TypeError} must provide an array-like object\n\t* @returns {Array} flattened array\n\t*/\n\tfunction flattenArray( arr ) {\n\t\tif ( !isArrayLikeObject( arr ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t\t}\n\t\treturn flatten( arr );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\nvar copy = require( './../../copy' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array and deep copy.\n*\n* @private\n* @param {Function} flatten - flatten function\n* @returns {Function} wrapped flatten function\n*/\nfunction wrap( flatten ) {\n\treturn flattenArray;\n\n\t/**\n\t* Flattens an array and deep copies array elements.\n\t*\n\t* @private\n\t* @param {ArrayLikeObject} arr - array to flatten\n\t* @throws {TypeError} must provide an array-like object\n\t* @returns {Array} flattened array\n\t*/\n\tfunction flattenArray( arr ) {\n\t\tif ( !isArrayLikeObject( arr ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t\t}\n\t\treturn copy( flatten( arr ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ).primitives;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar genFcn = require( './gen_fcn.js' );\nvar wrapFlatten = require( './wrap_flatten.js' );\nvar wrapFlattenCopy = require( './wrap_flatten_copy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for flattening arrays having specified dimensions.\n*\n* @param {PositiveIntegerArray} dims - dimensions\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements\n* @throws {TypeError} first argument must be an array of positive integers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} flatten function\n*\n* @example\n* var flatten = factory( [2,2], {\n* 'copy': false\n* });\n*\n* var out = flatten( [[1,2],[3,4]] );\n* // returns [ 1, 2, 3, 4 ]\n*\n* out = flatten( [[5,6],[7,8]] );\n* // returns [ 5, 6, 7, 8 ]\n*/\nfunction factory( dims, options ) {\n\tvar copyFLG;\n\tvar flatten;\n\tif ( !isPositiveIntegerArray( dims ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of positive integers. Value: `%s`.', dims ) );\n\t}\n\tcopyFLG = defaults.copy;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\tcopyFLG = options.copy;\n\t\t\tif ( !isBoolean( copyFLG ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', copyFLG ) );\n\t\t\t}\n\t\t}\n\t}\n\tflatten = genFcn( dims );\n\tif ( copyFLG ) {\n\t\treturn wrapFlattenCopy( flatten );\n\t}\n\treturn wrapFlatten( flatten );\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an array.\n*\n* @module @stdlib/utils/flatten-array\n*\n* @example\n* var flattenArray = require( '@stdlib/utils/flatten-array' );\n*\n* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];\n*\n* var out = flattenArray( arr );\n* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n*\n* @example\n* var flattenArray = require( '@stdlib/utils/flatten-array' );\n*\n* var flatten = flattenArray.factory( [2,2], {\n* 'copy': false\n* });\n*\n* var out = flatten( [[1,2],[3,4]] );\n* // returns [ 1, 2, 3, 4 ]\n*\n* out = flatten( [[5,6],[7,8]] );\n* // returns [ 5, 6, 7, 8 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar FLOAT64_MAX = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'delimiter': '.',\n\t\t'depth': FLOAT64_MAX,\n\t\t'copy': false\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - depth to flatten\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter] - key path delimiter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'depth': 10,\n* 'copy': false,\n* 'delimiter': '|',\n* 'flattenArrays': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'depth' ) ) {\n\t\topts.depth = options.depth;\n\t\tif ( !isNonNegativeInteger( opts.depth ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'depth', opts.depth ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'flattenArrays' ) ) {\n\t\topts.flattenArrays = options.flattenArrays;\n\t\tif ( !isBoolean( opts.flattenArrays ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'flattenArrays', opts.flattenArrays ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'delimiter' ) ) {\n\t\topts.delimiter = options.delimiter;\n\t\tif ( !isString( opts.delimiter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'delimiter', opts.delimiter ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\n\n\n// MAIN //\n\n/**\n* Recursively flattens an object.\n*\n* @private\n* @param {Object} out - output object\n* @param {ObjectLike} obj - input object\n* @param {string} prefix - key prefix\n* @param {NonNegativeInteger} depth - recursion depth\n* @param {Options} opts - options\n* @param {boolean} opts.flattenArrays - boolean indicating whether to flatten arrays\n* @param {string} opts.delimiter - key path delimiter\n* @returns {Object} output object\n*/\nfunction recurse( out, obj, prefix, depth, opts ) {\n\tvar keys;\n\tvar val;\n\tvar key;\n\tvar i;\n\tif ( prefix ) {\n\t\tprefix += opts.delimiter;\n\t}\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tval = obj[ keys[i] ];\n\t\tkey = prefix + keys[ i ];\n\t\tif ( depth ) {\n\t\t\tif (\n\t\t\t\t(isPlainObject( val ) && objectKeys( val ).length) ||\n\t\t\t\t(opts.flattenArrays && isArray( val ))\n\t\t\t) {\n\t\t\t\trecurse( out, val, key, depth-1, opts );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tout[ key ] = val;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = recurse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar copy = require( './../../copy' );\nvar recurse = require( './recurse.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an object.\n*\n* @private\n* @param {ObjectLike} obj - object to flatten\n* @param {Object} opts - options\n* @param {NonNegativeInteger} opts.depth - maximum depth to flatten\n* @param {boolean} opts.copy - boolean indicating whether to deep copy\n* @param {boolean} opts.flattenArrays - boolean indicating whether to flatten arrays\n* @param {string} opts.delimiter - key path delimiter\n* @returns {Object} flattened object\n*/\nfunction flatten( obj, opts ) {\n\tvar out;\n\tif ( opts.depth === 0 ) {\n\t\tout = obj;\n\t} else {\n\t\tout = recurse( {}, obj, '', opts.depth, opts );\n\t}\n\tif ( opts.copy ) {\n\t\treturn copy( out );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar flatten = require( './flatten.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an object.\n*\n* @param {ObjectLike} obj - object to flatten\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays=false] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter='.'] - key path delimiter\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ObjectLike} flattened object\n*\n* @example\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flattenObject( obj );\n* // returns {'a.b.c':'d'}\n*/\nfunction flattenObject( obj, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\treturn flatten( obj, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar flatten = require( './flatten.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an object.\n*\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays=false] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter='.'] - key path delimiter\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} flatten function\n*\n* @example\n* var flatten = factory({\n* 'copy': true,\n* 'delimiter': '|'\n* });\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n* var out = flatten( obj );\n* // throws \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar err;\n\n\topts = defaults();\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\treturn flattenObject;\n\n\t/**\n\t* Flattens an object.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - object to flatten\n\t* @throws {TypeError} first argument must be object-like\n\t* @returns {Object} flattened object\n\t*/\n\tfunction flattenObject( obj ) {\n\t\tif ( !isObjectLike( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t\t}\n\t\treturn flatten( obj, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an object.\n*\n* @module @stdlib/utils/flatten-object\n*\n* @example\n* var flattenObject = require( '@stdlib/utils/flatten-object' );\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flattenObject( obj );\n* // returns {'a.b.c':'d'}\n*\n* @example\n* var flattenObject = require( '@stdlib/utils/flatten-object' );\n*\n* var flatten = flattenObject.factory({\n* 'depth': 2,\n* 'copy': true,\n* 'delimiter': '|'\n* });\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flatten( obj );\n* // returns {'a|b':{'c':'d'}}\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEach( arr, log );\n*/\nfunction forEach( collection, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/for-each\n*\n* @example\n* var forEach = require( '@stdlib/utils/for-each' );\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEach( arr, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `forEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `forEach()`, `[].push()` behavior is consistent with `forEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEachRight( arr, log );\n*/\nfunction forEachRight( collection, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/for-each-right\n*\n* @example\n* var forEachRight = require( '@stdlib/utils/for-each-right' );\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEachRight( arr, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own and inherited enumerable property of an object.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n*\n* @param {Object} obj - input object\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} obj - input object\n*\n* @example\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* function Foo() {\n* this.a = 1;\n* this.b = 2;\n* return this;\n* }\n*\n* Foo.prototype.c = 3;\n* Foo.prototype.d = 4;\n*\n* var obj = new Foo();\n*\n* forIn( obj, log );\n*/\nfunction forIn( obj, fcn, thisArg ) {\n\tvar bool;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tbool = fcn.call( thisArg, obj[ key ], key, obj );\n\t\tif ( bool === false ) {\n\t\t\treturn obj;\n\t\t}\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each own and inherited enumerable property of an object.\n*\n* @module @stdlib/utils/for-in\n*\n* @example\n* var forIn = require( '@stdlib/utils/for-in' );\n*\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* function Foo() {\n* this.a = 1;\n* this.b = 2;\n* return this;\n* }\n*\n* Foo.prototype.c = 3;\n* Foo.prototype.d = 4;\n*\n* var obj = new Foo();\n*\n* forIn( obj, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own enumerable property of an object.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n*\n* @param {Object} obj - input object\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} obj - input object\n*\n* @example\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3,\n* 'd': 4\n* };\n*\n* forOwn( obj, log );\n*/\nfunction forOwn( obj, fcn, thisArg ) {\n\tvar keys;\n\tvar bool;\n\tvar len;\n\tvar k;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tk = keys[ i ];\n\t\tbool = fcn.call( thisArg, obj[ k ], k, obj );\n\t\tif ( bool === false ) {\n\t\t\treturn obj;\n\t\t}\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each own enumerable property of an object.\n*\n* @module @stdlib/utils/for-own\n*\n* @example\n* var forOwn = require( '@stdlib/utils/for-own' );\n*\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3,\n* 'd': 4\n* };\n*\n* forOwn( obj, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayArray = require( '@stdlib/assert/is-array-array' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Creates an object from an array of key-value pairs.\n*\n* @param {ArrayArray} entries - input object\n* @throws {TypeError} must provide an array of arrays\n* @returns {Object} object created from `[key, value]` pairs\n*\n* @example\n* var entries = [ ['beep', 'boop'], ['foo', 'bar'] ];\n*\n* var obj = objectFromEntries( entries );\n* // returns {'beep': 'boop', 'foo': 'bar'}\n*/\nfunction objectFromEntries( entries ) {\n\tvar out;\n\tvar i;\n\tif ( !isArrayArray( entries ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array of arrays. Value: `%s`.', entries ) );\n\t}\n\tout = {};\n\tfor ( i = 0; i < entries.length; i++ ) {\n\t\tout[ entries[i][0] ] = entries[ i ][ 1 ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectFromEntries;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an object from key-value pairs.\n*\n* @module @stdlib/utils/from-entries\n*\n* @example\n* var objectFromEntries = require( '@stdlib/utils/from-entries' );\n*\n* var entries = [ ['beep', 'boop'], ['foo', 'bar'] ];\n*\n* var obj = objectFromEntries( entries );\n* // returns {'beep': 'boop', 'foo': 'bar'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );\nvar format = require( '@stdlib/string/format' );\nvar RE = require( '@stdlib/regexp/function-name' ).REGEXP;\n\n\n// VARIABLES //\n\nvar isFunctionNameSupported = hasFunctionNameSupport();\n\n\n// MAIN //\n\n/**\n* Returns the name of a function.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} function name\n*\n* @example\n* var v = functionName( Math.sqrt );\n* // returns 'sqrt'\n*\n* @example\n* var v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* @example\n* var v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*\n* @example\n* var v = functionName( String );\n* // returns 'String'\n*/\nfunction functionName( fcn ) {\n\t// TODO: add support for generator functions?\n\tif ( isFunction( fcn ) === false ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isFunctionNameSupported ) {\n\t\treturn fcn.name;\n\t}\n\treturn RE.exec( fcn.toString() )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = functionName;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the name of a function.\n*\n* @module @stdlib/utils/function-name\n*\n* @example\n* var functionName = require( '@stdlib/utils/function-name' );\n*\n* var v = functionName( String );\n* // returns 'String'\n*\n* v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function sequence.\n*\n* @param {...Function} f - functions to evaluate in sequential order\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} pipeline function\n*\n* @example\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = funseq( a, b, c );\n*\n* var z = f( 6 );\n* // returns 3\n*/\nfunction funseq() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn pipeline;\n\n\t/**\n\t* Pipeline function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} result\n\t*/\n\tfunction pipeline() {\n\t\tvar args;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\targs = f[ 0 ].apply( null, args );\n\t\tfor ( i = 1; i < nFuncs; i++ ) {\n\t\t\targs = f[ i ]( args );\n\t\t}\n\t\treturn args;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = funseq;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function sequence.\n*\n* @module @stdlib/utils/function-sequence\n*\n* @example\n* var funseq = require( '@stdlib/utils/function-sequence' );\n*\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = funseq( a, b, c );\n*\n* var z = f( 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar returnValues = require( '@stdlib/array/base/group-values' );\nvar returnIndices = require( '@stdlib/array/base/group-indices' );\nvar returnPairs = require( '@stdlib/array/base/group-entries' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Groups values as arrays associated with distinct keys.\n*\n* @param {Collection} collection - collection to group\n* @param {Options} [options] - function options\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Collection} groups - collection defining which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a collection\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} first and last arguments must be the same length\n* @returns {Object} group results\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var out = group( arr, groups );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction group( collection, options, groups ) {\n\tvar opts;\n\tvar err;\n\tvar g;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tg = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tg = groups;\n\t}\n\tif ( !isCollection( g ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a collection. Value: `%s`.', g ) );\n\t}\n\tif ( collection.length !== g.length ) {\n\t\tthrow new RangeError( 'invalid arguments. First and last arguments must be the same length.' );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, g );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, g );\n\t}\n\treturn returnPairs( collection, g );\n}\n\n\n// EXPORTS //\n\nmodule.exports = group;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values as arrays associated with distinct keys.\n*\n* @module @stdlib/utils/group\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var out = group( arr, groups );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tg = indicator.call( thisArg, v, i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( v );\n\t\t} else {\n\t\t\tout[ g ] = [ v ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results according to element indices.\n*\n* ## Notes\n*\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tg = indicator.call( thisArg, collection[ i ], i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( i );\n\t\t} else {\n\t\t\tout[ g ] = [ i ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as index-element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tg = indicator.call( thisArg, v, i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( [ i, v ] );\n\t\t} else {\n\t\t\tout[ g ] = [ [ i, v ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnIndices = require( './return_indices.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function.\n*\n* @param {Collection} collection - collection to group\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction groupBy( collection, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, opts, cb );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, opts, cb );\n\t}\n\treturn returnPairs( collection, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function.\n*\n* @module @stdlib/utils/group-by\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tv = obj[ key ];\n\t\tg = indicator.call( thisArg, v, key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( v );\n\t\t} else {\n\t\t\tout[ g ] = [ v ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tg = indicator.call( thisArg, obj[ key ], key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( key);\n\t\t} else {\n\t\t\tout[ g ] = [ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tv = obj[ key ];\n\t\tg = indicator.call( thisArg, v, key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( [ key, v ] );\n\t\t} else {\n\t\t\tout[ g ] = [ [ key, v ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups an object's own and inherited property values according to an indicator function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupIn( obj, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group an object's own and inherited property values according to an indicator function.\n*\n* @module @stdlib/utils/group-in\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tg = indicator.call( thisArg, v, key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ v ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tg = indicator.call( thisArg, obj[ key ], key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( key);\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tg = indicator.call( thisArg, v, key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( [ key, v ] );\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ [ key, v ] ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups an object's own property values according to an indicator function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupOwn( obj, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group an object's own property values according to an indicator function.\n*\n* @module @stdlib/utils/group-own\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var out = groupOwn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Identity function.\n*\n* @param {*} x - input value\n* @returns {*} input value\n*\n* @example\n* var v = identity( 3.14 );\n* // returns 3.14\n*/\nfunction identity( x ) {\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = identity;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Identity function.\n*\n* @module @stdlib/utils/identity-function\n*\n* @example\n* var identity = require( '@stdlib/utils/identity-function' );\n*\n* var input = [];\n* var output = identity( input );\n*\n* var bool = ( input === output );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, returns `x`; otherwise, returns `y`.\n*\n* @param {boolean} bool - condition\n* @param {*} x - value to return if a condition is truthy\n* @param {*} y - value to return if a condition is falsy\n* @returns {*} either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var z = ifelse( randu() > 0.5, 1.0, -1.0 );\n* // returns \n*/\nfunction ifelse( bool, x, y ) {\n\tif ( bool ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifelse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, return `x`; otherwise, return `y`.\n*\n* @module @stdlib/utils/if-else\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifelse = require( '@stdlib/utils/if-else' );\n*\n* var z = ifelse( randu() > 0.5, 1.0, -1.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a condition is truthy, invokes `x`; otherwise, invokes `y`.\n*\n* @param {boolean} bool - condition\n* @param {Function} x - function to invoke if a condition is truthy\n* @param {Function} y - function to invoke if a condition is falsy\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {*} return value of either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* return randu() * 100.0;\n* }\n*\n* function y() {\n* return -1.0 * randu() * 100.0;\n* }\n*\n* var z = ifthen( randu() > 0.5, x, y );\n* // returns \n*/\nfunction ifthen( bool, x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( bool ) {\n\t\treturn x();\n\t}\n\treturn y();\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifthen;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, invoke `x`; otherwise, invoke `y`.\n*\n* @module @stdlib/utils/if-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifthen = require( '@stdlib/utils/if-then' );\n*\n* function x() {\n* return randu() * 100.0;\n* }\n*\n* function y() {\n* return -1.0 * randu() * 100.0;\n* }\n*\n* var z = ifthen( randu() > 0.5, x, y );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests that a value is a valid constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var ctor = function ctor() {};\n*\n* var err = validate( ctor );\n* // returns null\n*\n* err = validate( null );\n* // returns \n*/\nfunction validate( value ) {\n\tvar type = typeof value;\n\tif (\n\t\tvalue === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\treturn new TypeError( format( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.', value ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nmodule.exports = Object.create;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Ctor() {\n\t// Empty...\n}\n\n\n// MAIN //\n\n/**\n* An `Object.create` shim for older JavaScript engines.\n*\n* @private\n* @param {Object} proto - prototype\n* @returns {Object} created object\n*\n* @example\n* var obj = createObject( Object.prototype );\n* // returns {}\n*/\nfunction createObject( proto ) {\n\tCtor.prototype = proto;\n\treturn new Ctor();\n}\n\n\n// EXPORTS //\n\nmodule.exports = createObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar builtin = require( './native.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar createObject;\nif ( typeof builtin === 'function' ) {\n\tcreateObject = builtin;\n} else {\n\tcreateObject = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar createObject = require( './detect.js' );\n\n\n// MAIN //\n\n/**\n* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.\n*\n* ## Notes\n*\n* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.\n* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).\n*\n* @param {(Object|Function)} ctor - constructor which will inherit\n* @param {(Object|Function)} superCtor - super (parent) constructor\n* @throws {TypeError} first argument must be either an object or a function which can inherit\n* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit\n* @throws {TypeError} second argument must have an inheritable prototype\n* @returns {(Object|Function)} child constructor\n*\n* @example\n* function Foo() {\n* return this;\n* }\n* Foo.prototype.beep = function beep() {\n* return 'boop';\n* };\n*\n* function Bar() {\n* Foo.call( this );\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n* var v = bar.beep();\n* // returns 'boop'\n*/\nfunction inherit( ctor, superCtor ) {\n\tvar err = validate( ctor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\terr = validate( superCtor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( typeof superCtor.prototype === 'undefined' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.', superCtor.prototype ) );\n\t}\n\t// Create a prototype which inherits from the parent prototype:\n\tctor.prototype = createObject( superCtor.prototype );\n\n\t// Set the constructor to refer to the child constructor:\n\tdefineProperty( ctor.prototype, 'constructor', {\n\t\t'configurable': true,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': ctor\n\t});\n\n\treturn ctor;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inherit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.\n*\n* @module @stdlib/utils/inherit\n*\n* @example\n* var inherit = require( '@stdlib/utils/inherit' );\n*\n* function Foo() {\n* return this;\n* }\n* Foo.prototype.beep = function beep() {\n* return 'boop';\n* };\n*\n* function Bar() {\n* Foo.call( this );\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n* var v = bar.beep();\n* // returns 'boop'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable property names and symbols\n*\n* @example\n* var props = inheritedEnumerableProperties( {} );\n*/\nfunction inheritedEnumerableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable property names and symbols.\n*\n* @module @stdlib/utils/inherited-enumerable-properties\n*\n* @example\n* var inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' );\n*\n* var props = inheritedEnumerableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable symbol properties\n*\n* @example\n* var symbols = inheritedEnumerablePropertySymbols( [] );\n*/\nfunction inheritedEnumerablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable symbol properties.\n*\n* @module @stdlib/utils/inherited-enumerable-property-symbols\n*\n* @example\n* var inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' );\n*\n* var symbols = inheritedEnumerablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable property names\n*\n* @example\n* var keys = inheritedKeys( {} );\n*/\nfunction inheritedKeys( value, level ) {\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable property names.\n*\n* @module @stdlib/utils/inherited-keys\n*\n* @example\n* var inheritedKeys = require( '@stdlib/utils/inherited-keys' );\n*\n* var keys = inheritedKeys( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable property names and symbols\n*\n* @example\n* var props = inheritedNonEnumerableProperties( {} );\n*/\nfunction inheritedNonEnumerableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/inherited-nonenumerable-properties\n*\n* @example\n* var inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' );\n*\n* var props = inheritedNonEnumerableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable property names\n*\n* @example\n* var keys = inheritedNonEnumerablePropertyNames( {} );\n*/\nfunction inheritedNonEnumerablePropertyNames( value, level ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable property names.\n*\n* @module @stdlib/utils/inherited-nonenumerable-property-names\n*\n* @example\n* var inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' );\n*\n* var keys = inheritedNonEnumerablePropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable symbol properties\n*\n* @example\n* var symbols = inheritedNonEnumerablePropertySymbols( [] );\n*/\nfunction inheritedNonEnumerablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable symbol properties.\n*\n* @module @stdlib/utils/inherited-nonenumerable-property-symbols\n*\n* @example\n* var inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' );\n*\n* var symbols = inheritedNonEnumerablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertySymbols = require( './../../property-symbols' );\nvar propertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited property names and symbols\n*\n* @example\n* var props = inheritedProperties( [] );\n* // returns [...]\n*/\nfunction inheritedProperties( value, level ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all properties...\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\ttmp = propertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited property names and symbols.\n*\n* @module @stdlib/utils/inherited-properties\n*\n* @example\n* var inheritedProperties = require( '@stdlib/utils/inherited-properties' );\n*\n* var props = inheritedProperties( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's inherited property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have an inherited provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} third argument must be a positive integer\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var desc = inheritedPropertyDescriptor( {}, 'toString' );\n* // returns {...}\n*/\nfunction inheritedPropertyDescriptor( value, property, level ) { // eslint-disable-line id-length\n\tvar desc;\n\tvar obj;\n\tvar N;\n\tvar n;\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain in search of a specified property...\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\tdesc = getOwnPropertyDescriptor( obj, property );\n\t\tif ( desc ) {\n\t\t\treturn desc;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's inherited property.\n*\n* @module @stdlib/utils/inherited-property-descriptor\n*\n* @example\n* var inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' );\n*\n* var desc = inheritedPropertyDescriptor( {}, 'toString' );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyDescriptors !== 'undefined' ); // eslint-disable-line node/no-unsupported-features/es-builtins\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertyDescriptors = Object.getOwnPropertyDescriptors; // eslint-disable-line node/no-unsupported-features/es-builtins\n\n\n// MAIN //\n\n/**\n* Returns an object's own property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Object} property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptors( obj );\n* // returns {...}\n*/\nfunction getOwnPropertyDescriptors( value ) {\n\treturn propertyDescriptors( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar propertyDescriptor = require( './../../property-descriptor' );\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Returns an object's own property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Object} property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptors( obj, 'foo' );\n* // returns {...}\n*/\nfunction getOwnPropertyDescriptors( value ) {\n\tvar symbols;\n\tvar names;\n\tvar desc;\n\tvar out;\n\tvar i;\n\n\tout = {};\n\n\t// Get the value's own enumerable and non-enumerable properties:\n\tnames = propertyNames( value );\n\n\t// For each property name, retrieve the property descriptor...\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tdesc = propertyDescriptor( value, names[ i ] );\n\t\tif ( desc ) {\n\t\t\t// The following is equivalent to `out[ names[i] ] = desc`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\tdefineProperty( out, names[ i ], {\n\t\t\t\t'configurable': true,\n\t\t\t\t'enumerable': true,\n\t\t\t\t'writable': true,\n\t\t\t\t'value': desc\n\t\t\t});\n\t\t}\n\t}\n\n\t// Get the value's symbol properties:\n\tsymbols = propertySymbols( value );\n\n\t// For each symbol property, retrieve the property descriptor...\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tdesc = propertyDescriptor( value, symbols[ i ] );\n\t\tif ( desc ) {\n\t\t\t// The following is equivalent to `out[ symbols[i] ] = desc`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\tdefineProperty( out, symbols[ i ], {\n\t\t\t\t'configurable': true,\n\t\t\t\t'enumerable': true,\n\t\t\t\t'writable': true,\n\t\t\t\t'value': desc\n\t\t\t});\n\t\t}\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's own property descriptors.\n*\n* @module @stdlib/utils/property-descriptors\n*\n* @example\n* var getOwnPropertyDescriptors = require( '@stdlib/utils/property-descriptors' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var keys = getOwnPropertyDescriptors( obj, 'foo' );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyDescriptors = require( './../../property-descriptors' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an object's inherited property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Object} inherited property descriptors\n*\n* @example\n* var desc = inheritedPropertyDescriptors( [] );\n* // returns {...}\n*/\nfunction inheritedPropertyDescriptors( value, level ) { // eslint-disable-line id-length\n\tvar desc;\n\tvar keys;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn {};\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all property descriptors...\n\tdesc = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyDescriptors( obj );\n\t\tkeys = objectKeys( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a property name always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tkeys = getOwnPropertySymbols( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a symbol property always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\treturn desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's inherited property descriptors.\n*\n* @module @stdlib/utils/inherited-property-descriptors\n*\n* @example\n* var inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' );\n*\n* var desc = inheritedPropertyDescriptors( [] );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable and non-enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable and non-enumerable property names\n*\n* @example\n* var keys = inheritedPropertyNames( [] );\n*/\nfunction inheritedPropertyNames( value, level ) {\n\tvar names;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all enumerable and non-enumerable property names...\n\tnames = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( names, tmp[ i ] ) === false ) {\n\t\t\t\tnames.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/inherited-property-names\n*\n* @example\n* var inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' );\n*\n* var keys = inheritedPropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited symbol properties\n*\n* @example\n* var symbols = inheritedPropertySymbols( [] );\n*/\nfunction inheritedPropertySymbols( value, level ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all symbol properties...\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited symbol properties.\n*\n* @module @stdlib/utils/inherited-property-symbols\n*\n* @example\n* var inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' );\n*\n* var symbols = inheritedPropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable property names and symbols\n*\n* @example\n* var props = inheritedWritableProperties( {} );\n*/\nfunction inheritedWritableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable property names and symbols.\n*\n* @module @stdlib/utils/inherited-writable-properties\n*\n* @example\n* var inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' );\n*\n* var props = inheritedWritableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable property names\n*\n* @example\n* var keys = inheritedWritablePropertyNames( {} );\n*/\nfunction inheritedWritablePropertyNames( value, level ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable property names.\n*\n* @module @stdlib/utils/inherited-writable-property-names\n*\n* @example\n* var inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' );\n*\n* var keys = inheritedWritablePropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable symbol properties\n*\n* @example\n* var symbols = inheritedWritablePropertySymbols( [] );\n*/\nfunction inheritedWritablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable symbol properties.\n*\n* @module @stdlib/utils/inherited-writable-property-symbols\n*\n* @example\n* var inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' );\n*\n* var symbols = inheritedWritablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates the collection in-place.\n*\n* ## Notes\n*\n* - The invoked function's return value is cached prior to updating a collection. Before updating the collection, a collection must be inspected to ensure that a collection has not been resized during invocation such that an index no longer has a corresponding element in the collection. Were a return value automatically used to update a collection, an input collection could be converted into a sparse data structure. While some might consider this a feature, here, we take stance that a user should be less clever.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function scale( value, index, collection ) {\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmap( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\nfunction inmap( collection, fcn, thisArg ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = fcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\tlen = collection.length;\n\t\t}\n\t\tif ( i < len ) {\n\t\t\tcollection[ i ] = v;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update the collection in-place.\n*\n* @module @stdlib/utils/inmap\n*\n* @example\n* var inmap = require( '@stdlib/utils/inmap' );\n*\n* function scale( value, index, collection ) {\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmap( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates the collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `inmap` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `inmap()`, `[].push()` behavior is consistent with `inmapRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function scale( value, index, collection ) {\n* console.log( '%s: %d', index, value );\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmapRight( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\nfunction inmapRight( collection, fcn, thisArg ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tv = fcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\tif ( i >= 0 && i < len ) {\n\t\t\tcollection[ i ] = v;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update the collection in-place, iterating from right to left.\n*\n* @module @stdlib/utils/inmap-right\n*\n* @example\n* var inmapRight = require( '@stdlib/utils/inmap-right' );\n*\n* function scale( value, index, collection ) {\n* console.log( '%s: %d', index, value );\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmapRight( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts a collection to an object whose keys are determined by a provided function and whose values are the collection values.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} output object\n*\n* @example\n* function toKey( value, index ) {\n* console.log( '%d: %s', index, JSON.stringify( value ) );\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyBy( collection, toKey );\n* // returns { 'beep': { 'name': 'beep', 'a': 1 }, 'boop': { 'name': 'boop', 'b': 2 } }\n*/\nfunction keyBy( collection, fcn, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar key;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tkey = fcn.call( thisArg, collection[ i ], i );\n\t\tout[ key ] = collection[ i ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a collection to an object whose keys are determined by a provided function and whose values are the collection values.\n*\n* @module @stdlib/utils/key-by\n*\n* @example\n* var keyBy = require( '@stdlib/utils/key-by' );\n*\n* function toKey( value ) {\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyBy( collection, toKey );\n* // returns { 'beep': { 'name': 'beep', 'a': 1 }, 'boop': { 'name': 'boop', 'b': 2 } }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts a collection to an object whose keys are determined by a provided function and whose values are the collection values, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} output object\n*\n* @example\n* function toKey( value, index ) {\n* console.log( '%d: %s', index, JSON.stringify( value ) );\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyByRight( collection, toKey );\n* // returns { 'boop': { 'name': 'boop', 'b': 2 }, 'beep': { 'name': 'beep', 'a': 1 } }\n*/\nfunction keyByRight( collection, fcn, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar key;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tkey = fcn.call( thisArg, collection[ i ], i );\n\t\tout[ key ] = collection[ i ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a collection to an object whose keys are determined by a provided function and whose values are the collection values, iterating from right to left.\n*\n* @module @stdlib/utils/key-by-right\n*\n* @example\n* var keyByRight = require( '@stdlib/utils/key-by-right' );\n*\n* function toKey( value ) {\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyByRight( collection, toKey );\n* // returns { 'boop': { 'name': 'boop', 'b': 2 }, 'beep': { 'name': 'beep', 'a': 1 } }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* List node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\t// Why a getter? Because some of the list APIs will return the list \"node\", not the value. In which case, the node API is no longer private and we have to guard against users mucking about (deleting, updating, etc) with property values (in particular, the `next` property).\n\tdefineProperty( this, 'next', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._next;\n\t\t}\n\t});\n\tthis.value = value;\n\n\tdefineProperty( this, '_next', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\t// NOTE: strictly speaking, we should not be keeping back-references in a singly-linked list; however, doing so allows us to more efficiently add, remove, and insert list values.\n\tdefineProperty( this, '_prev', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Linked list constructor.\n*\n* @constructor\n* @returns {LinkedList} linked list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'foo'\n*/\nfunction LinkedList() {\n\tif ( !(this instanceof LinkedList) ) {\n\t\treturn new LinkedList();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the list.\n*\n* @name clear\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*\n* // Examine the list length:\n* var len = list.length;\n* // returns 2\n*\n* // Clear all list items:\n* list.clear();\n*\n* // Peek at the first value:\n* v = list.first();\n* // returns undefined\n*\n* // Examine the list length:\n* len = list.length;\n* // returns 0\n*/\nsetReadOnly( LinkedList.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the first list node.\n*\n* @name first\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*/\nsetReadOnly( LinkedList.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first;\n\t}\n});\n\n/**\n* Inserts a value into the list **after** a provided list node.\n*\n* @name insert\n* @memberof LinkedList.prototype\n* @type {Function}\n* @param {Node} node - node after which to insert the value\n* @param {*} value - value to insert\n* @throws {Error} must provide a node belonging to the list\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Insert a value after the second node:\n* list.insert( node, 'boop' );\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 4\n*/\nsetReadOnly( LinkedList.prototype, 'insert', function insert( node, value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar n;\n\n\t// Case: last node (equivalent to `push()`)\n\tif ( node === this._last ) {\n\t\treturn this.push( value );\n\t}\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously increment the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Create a new list node:\n\tn = new Node( value );\n\n\t// Update pointers:\n\tnode._next._prev = n;\n\tn._next = node._next;\n\n\tnode._next = n;\n\tn._prev = node;\n\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an iterator for iterating over a list.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from list mutation during iteration, a returned iterator **always** iterates over a list \"snapshot\", which is defined as the list of elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = list.iterator();\n*\n* // Iterate over the list...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( LinkedList.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = -1;\n\n\t// Create a copy of list values (necessary in order to \"snapshot\" the list; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the last node.\n*\n* @name last\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = list.last().value;\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last;\n\t}\n});\n\n/**\n* List length.\n*\n* @name length\n* @memberof LinkedList.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var list = new LinkedList();\n*\n* // Examine the initial list length:\n* var len = list.length;\n* // returns 0\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( LinkedList.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the end of the list.\n*\n* @name pop\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( LinkedList.prototype, 'pop', function pop() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the last value:\n\t\tvalue = this._last.value;\n\n\t\t// Check whether we have a new \"tail\" or whether we have emptied the list...\n\t\tif ( this._last._prev ) {\n\t\t\tthis._last = this._last._prev;\n\t\t\tthis._last._next = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Adds a value to the end of the list.\n*\n* @name push\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( LinkedList.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous last node:\n\t\tnode._prev = this._last; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous last node to the new node:\n\t\tthis._last._next = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the last node:\n\t\tthis._last = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Removes a list node from the list.\n*\n* @name remove\n* @memberof LinkedList.prototype\n* @type {Function}\n* @param {Node} node - node to remove\n* @throws {Error} must provide a node belonging to the list\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Remove the second node:\n* var v = list.remove( node );\n* // returns 'bar'\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnly( LinkedList.prototype, 'remove', function remove( node ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tvar n;\n\n\t// Case: first node (equivalent to `shift()`)\n\tif ( node === this._first ) {\n\t\treturn this.shift();\n\t}\n\t// Case: last node (equivalent to `pop()`)\n\tif ( node === this._last ) {\n\t\treturn this.pop();\n\t}\n\t// Retrieve the node value:\n\tvalue = node.value;\n\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously decrement the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Update pointers:\n\tnode._prev._next = node._next;\n\tnode._next._prev = node._prev;\n\n\t// Decrement the list length:\n\tthis._length -= 1;\n\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Removes a value from the beginning of the list.\n*\n* @name shift\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = list.shift();\n* // returns 'foo'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'shift', function shift() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the first value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"head\" or whether we have emptied the list...\n\t\tif ( this._first._next ) {\n\t\t\tthis._first = this._first._next;\n\t\t\tthis._first._prev = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an array of list values.\n*\n* @name toArray\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Array} list values\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of list values:\n* var vals = list.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( LinkedList.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a list as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `LinkedList` instance.\n*\n* @name toJSON\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Object} serialized list\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = list.toJSON();\n* // returns { 'type': 'linked-list', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( LinkedList.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'linked-list';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n/**\n* Adds a value to the beginning of the list.\n*\n* @name unshift\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the beginning of the list:\n* list.unshift( 'foo' ).unshift( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'foo'\n*\n* // Add a new value to the beginning of the list:\n* list.unshift( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'unshift', function unshift( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous first node:\n\t\tnode._next = this._first; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous first node to the new node:\n\t\tthis._first._prev = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the first node:\n\t\tthis._first = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n\n// EXPORTS //\n\nmodule.exports = LinkedList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Linked list.\n*\n* @module @stdlib/utils/linked-list\n*\n* @example\n* var linkedList = require( '@stdlib/utils/linked-list' );\n*\n* var list = linkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first list value:\n* v = list.shift();\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts each object key to lowercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'A': 1,\n* 'B': 2\n* };\n*\n* var obj2 = lowercaseKeys( obj1 );\n* // returns { 'a': 1, 'b': 2 }\n*/\nfunction lowercaseKeys( obj ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key.toLowerCase() ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lowercaseKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert each object key to lowercase.\n*\n* @module @stdlib/utils/lowercase-keys\n*\n* @example\n* var lowercaseKeys = require( '@stdlib/utils/lowercase-keys' );\n*\n* var obj1 = {\n* 'A': 1,\n* 'B': 2\n* };\n*\n* var obj2 = lowercaseKeys( obj1 );\n* // returns { 'a': 1, 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an ndarray and assigns the result to an element in an output ndarray.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing output ndarray meta data\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the unary function:\n* map( x, y, naryFunction( scale, 1 ) );\n*\n* var v = y.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction map( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar ref;\n\tvar shx;\n\tvar shy;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\tshy = y.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\tset( ybuf, oy, fcn.call( thisArg, get( xbuf, ox ), 0, ref ) );\n\t\treturn;\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), i, ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {Object} y - object containing output array data\n* @param {ArrayLikeObject} y.data - output array data\n* @param {Array} y.accessors - output array accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ -1, -2, -3, -4, -5, -6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map( x, y, naryFunction( abs, 1 ) );\n*\n* var data = y.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element...\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tset( ybuf, i, fcn.call( thisArg, get( xbuf, i ), i, xbuf ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( arr, fcn, thisArg ) {\n\tvar out;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tarr = ndarraylike2object( arr );\n\t\tout = ndzeros( arr.shape, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': arr.order\n\t\t});\n\t\tndarrayFcn( arr, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tout = zeros( arr.length );\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} input and output arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* map( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( arr, out, fcn, thisArg ) {\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\ttmp = ndarraylike2object( broadcast( arr, sh ) );\n\t\ttmp.ref = arr;\n\t\tarr = tmp;\n\n\t\tndarrayFcn( arr, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tif ( !isArrayLikeObject( out ) || isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( arr.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each element in an array and assign the result to an element in an output array.\n*\n* @module @stdlib/utils/map\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* map.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function after transforming arguments according to a callback function.\n*\n* ## Notes\n*\n- The callback function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* @param {Function} fcn - input function\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* function clbk( v ) {\n* return v * 2;\n* }\n*\n* var bar = mapArguments( foo, clbk );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 2, 4, 6 ]\n*/\nfunction mapArguments( fcn, clbk, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function after transforming arguments according to a callback function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( clbk( arguments[ i ], i ) ); // eslint-disable-line node/callback-return\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function after transforming arguments according to a callback function.\n*\n* @module @stdlib/utils/map-arguments\n*\n* @example\n* var mapArguments = require( '@stdlib/utils/map-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* function clbk( v ) {\n* return v * 2;\n* }\n*\n* var bar = mapArguments( foo, clbk );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 2, 4, 6 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times and returns an array of accumulated function return values.\n*\n* @param {Function} fcn - function to invoke\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {Array} accumulated results\n*\n* @example\n* function fcn( i ) {\n* return i;\n* }\n*\n* var arr = mapFun( fcn, 5 );\n* // returns [ 0, 1, 2, 3, 4 ]\n*/\nfunction mapFun( fcn, n, thisArg ) {\n\tvar out;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\t// Note: we explicitly do not preallocate in order to ensure \"fast\" elements for large output arrays.\n\tout = [];\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout.push( fcn.call( thisArg, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapFun;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function `n` times and return an array of accumulated function return values.\n*\n* @module @stdlib/utils/map-function\n*\n* @example\n* var mapFun = require( '@stdlib/utils/map-function' );\n*\n* function fcn( i ) {\n* return i;\n* }\n*\n* var arr = mapFun( fcn, 5 );\n* // returns [ 0, 1, 2, 3, 4 ]\n*/\n\n// MODULES //\n\nvar mapFun = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapFun;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Maps keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - We need to cache an object value to prevent the edge case where, during the invocation of the transform function, the value corresponding to a particular key is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @param {Object} obj - source object\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function transform( key, value ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapKeys( obj1, transform );\n* // returns { 'a1': 1, 'b2': 2 }\n*/\nfunction mapKeys( obj, transform ) {\n\tvar out;\n\tvar key;\n\tvar v;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( transform ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', transform ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tkey = transform( key, v, obj );\n\t\t\tout[ key ] = v;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map keys from one object to a new object having the same values.\n*\n* @module @stdlib/utils/map-keys\n*\n* @example\n* var mapKeys = require( '@stdlib/utils/map-keys' );\n*\n* function transform( key, value ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapKeys( obj1, transform );\n* // returns { 'a1': 1, 'b2': 2 }\n*/\n\n// MODULES //\n\nvar mapKeys = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cceil = require( '@stdlib/math/base/special/cceil' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = mapReduce( x, new Complex64( 0.0, 0.0 ), naryFunction( cceil, 1 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 20.0\n*\n* var im = imagf( v );\n* // returns 24.0\n*/\nfunction mapReduce( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn reducer.call( thisArg, initial, mapper( get( xbuf, ox ), 0, ref ), 0, ref ); // eslint-disable-line max-len\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, ix ), i, ref ), i, ref ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum of squared values:\n* var out = mapReduce( x, 0, square, sum );\n* // returns 30\n*/\nfunction mapReduce( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, i ), i, xbuf ), i, xbuf ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* ## Notes\n*\n* - The mapping function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* - The reducing function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: result of applying the mapping function against the current array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} fourth argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduce( arr, 0, square, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduce( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction mapReduce( arr, initial, mapper, reducer, thisArg ) {\n\tif ( !isFunction( mapper ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', mapper ) );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Perform a map-reduce operation against each element in an array and return the accumulated result.\n*\n* @module @stdlib/utils/map-reduce\n*\n* @example\n* var mapReduce = require( '@stdlib/utils/map-reduce' );\n*\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduce( arr, 0, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapReduce = require( '@stdlib/utils/map-reduce' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduce( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cceil = require( '@stdlib/math/base/special/cceil' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = mapReduceRight( x, new Complex64( 0.0, 0.0 ), naryFunction( cceil, 1 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 20.0\n*\n* var im = imagf( v );\n* // returns 24.0\n*/\nfunction mapReduceRight( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn reducer.call( thisArg, initial, mapper( get( xbuf, ox ), 0, ref ), 0, ref ); // eslint-disable-line max-len\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, ix ), i, ref ), i, ref ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum of squared values:\n* var out = mapReduceRight( x, 0, square, sum );\n* // returns 30\n*/\nfunction mapReduceRight( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, i ), i, xbuf ), i, xbuf ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* ## Notes\n*\n* - The mapping function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* - The reducing function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: result of applying the mapping function against the current array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} fourth argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduceRight( arr, 0, square, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduceRight( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction mapReduceRight( arr, initial, mapper, reducer, thisArg ) {\n\tif ( !isFunction( mapper ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', mapper ) );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Perform a map-reduce operation against each element in an array while iterating from right to left and return the accumulated result.\n*\n* @module @stdlib/utils/map-reduce-right\n*\n* @example\n* var mapReduceRight = require( '@stdlib/utils/map-reduce-right' );\n*\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduceRight( arr, 0, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapReduceRight = require( '@stdlib/utils/map-reduce-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduceRight( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an ndarray and assigns the result to an element in an output ndarray, iterating from right to left.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing output ndarray meta data\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the unary function:\n* mapRight( x, y, naryFunction( scale, 1 ) );\n*\n* var v = y.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction mapRight( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar ref;\n\tvar shx;\n\tvar shy;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\tshy = y.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\tset( ybuf, oy, fcn.call( thisArg, get( xbuf, ox ), 0, ref ) );\n\t\treturn;\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), i, ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array, iterating from right to left.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {Object} y - object containing output array data\n* @param {ArrayLikeObject} y.data - output array data\n* @param {Array} y.accessors - output array accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ -1, -2, -3, -4, -5, -6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* mapRight( x, y, naryFunction( abs, 1 ) );\n*\n* var data = y.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element...\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tset( ybuf, i, fcn.call( thisArg, get( xbuf, i ), i, xbuf ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in a new array, iterating from right to left.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( arr, fcn, thisArg ) {\n\tvar out;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tarr = ndarraylike2object( arr );\n\t\tout = ndzeros( arr.shape, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': arr.order\n\t\t});\n\t\tndarrayFcn( arr, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tout = zeros( arr.length );\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array, iterating from right to left.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} input and output arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must have be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* mapRight( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* mapRight( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( arr, out, fcn, thisArg ) {\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\ttmp = ndarraylike2object( broadcast( arr, sh ) );\n\t\ttmp.ref = arr;\n\t\tarr = tmp;\n\n\t\tndarrayFcn( arr, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tif ( !isArrayLikeObject( out ) || isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( arr.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each element in an array and assign the result to an element in an output array, iterating from right to left.\n*\n* @module @stdlib/utils/map-right\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* mapRight.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* mapRight.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Maps values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function transform( value, key ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapValues( obj1, transform );\n* // returns { 'a': 'a1', 'b': 'b2' }\n*/\nfunction mapValues( obj, transform ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( transform ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', transform ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key ] = transform( obj[ key ], key, obj );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map values from one object to a new object having the same keys.\n*\n* @module @stdlib/utils/map-values\n*\n* @example\n* var mapValues = require( '@stdlib/utils/map-values' );\n*\n* function transform( value, key ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapValues( obj1, transform );\n* // returns { 'a': 'a1', 'b': 'b2' }\n*/\n\n// MODULES //\n\nvar mapValues = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing meta data for the first input ndarray\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing meta data for the second input ndarray\n* @param {string} y.ref - reference to original input ndarray-like object\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Object} z - object containing output ndarray meta data\n* @param {string} z.dtype - data type\n* @param {Collection} z.data - data buffer\n* @param {NonNegativeInteger} z.length - number of elements\n* @param {NonNegativeIntegerArray} z.shape - dimensions\n* @param {IntegerArray} z.strides - stride lengths\n* @param {NonNegativeInteger} z.offset - index offset\n* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} z.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/caddf' );\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var zbuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n* var sz = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n* var oz = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* y.ref = y;\n*\n* var z = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': zbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sz,\n* 'offset': oz,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the function:\n* map2( x, y, z, naryFunction( add, 2 ) );\n*\n* var v = z.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 2.0\n*\n* var im = imagf( v );\n* // returns 3.0\n*/\nfunction map2( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar ordx;\n\tvar ordy;\n\tvar ordz;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar xref;\n\tvar yref;\n\tvar shx;\n\tvar shy;\n\tvar shz;\n\tvar len;\n\tvar sx;\n\tvar sy;\n\tvar sz;\n\tvar ox;\n\tvar oy;\n\tvar oz;\n\tvar ix;\n\tvar iy;\n\tvar iz;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the array shapes:\n\tshx = x.shape;\n\tshy = y.shape;\n\tshz = z.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\tsz = z.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\toz = z.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\tordz = z.order;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Cache references to the original input arrays:\n\txref = x.ref;\n\tyref = y.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 && shy.length === 0 ) {\n\t\tzset( zbuf, oz, fcn.call( thisArg, xget( xbuf, ox ), yget( ybuf, oy ), 0, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t\treturn;\n\t}\n\t// Iterate over the arrays based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tiz = vind2bind( shz, sz, oz, ordz, i, MODE );\n\t\tzset( zbuf, iz, fcn.call( thisArg, xget( xbuf, ix ), yget( ybuf, iy ), i, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing data for the first input array\n* @param {ArrayLikeObject} x.data - array data\n* @param {Array} x.accessors - array element accessors\n* @param {Object} y - object containing data for the second input array\n* @param {ArrayLikeObject} y.data - array data\n* @param {Array} y.accessors - array element accessors\n* @param {Object} z - object containing output array data\n* @param {ArrayLikeObject} z.data - array data\n* @param {Array} z.accessors - array element accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ 1, 2, 3, 4, 5, 6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 1, 1, 1, 1, 1, 1 ],\n* 'accessors': [ getter, setter ]\n* };\n* var z = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map2( x, y, z, naryFunction( add, 2 ) );\n*\n* var data = z.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Iterate over the elements...\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tzset( zbuf, i, fcn.call( thisArg, xget( xbuf, i ), yget( ybuf, i ), i, [ xbuf, ybuf ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} input arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input arrays must have the same length\n* @throws {Error} input ndarrays must be broadcast compatible\n* @throws {TypeError} third argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar out;\n\tvar tmp;\n\tvar sh;\n\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\t// Broadcast `x` and `y` to a common shape:\n\t\tsh = broadcastShapes( [ x.shape, y.shape ] );\n\t\tif ( sh === null ) {\n\t\t\tthrow new Error( 'invalid arguments. Input ndarrays must be broadcast compatible.' );\n\t\t}\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\t// Create an output array:\n\t\tout = ndzeros( sh, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': x.order\n\t\t});\n\n\t\t// Apply the function to the input arrays:\n\t\tndarrayFcn( x, y, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( y.length !== x.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input arrays must have the same length.' );\n\t\t}\n\t\tout = zeros( x.length );\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be an array-like object or an ndarray\n* @throws {TypeError} fourth argument must be a function\n* @throws {TypeError} input and output arrays must be either all array-like objects or all ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, out, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar isznd;\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tisznd = isndarrayLike( out );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( !isznd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\tndarrayFcn( x, y, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( isznd || !isArrayLikeObject( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( x.length !== y.length || y.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to elements in two input arrays and assign the results to an output array.\n*\n* @module @stdlib/utils/map2\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2( x, y. naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing meta data for the first input ndarray\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing meta data for the second input ndarray\n* @param {string} y.ref - reference to original input ndarray-like object\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Object} z - object containing output ndarray meta data\n* @param {string} z.dtype - data type\n* @param {Collection} z.data - data buffer\n* @param {NonNegativeInteger} z.length - number of elements\n* @param {NonNegativeIntegerArray} z.shape - dimensions\n* @param {IntegerArray} z.strides - stride lengths\n* @param {NonNegativeInteger} z.offset - index offset\n* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} z.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/caddf' );\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var zbuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n* var sz = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n* var oz = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* y.ref = y;\n*\n* var z = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': zbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sz,\n* 'offset': oz,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the function:\n* map2Right( x, y, z, naryFunction( add, 2 ) );\n*\n* var v = z.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 2.0\n*\n* var im = imagf( v );\n* // returns 3.0\n*/\nfunction map2Right( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar ordx;\n\tvar ordy;\n\tvar ordz;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar xref;\n\tvar yref;\n\tvar shx;\n\tvar shy;\n\tvar shz;\n\tvar len;\n\tvar sx;\n\tvar sy;\n\tvar sz;\n\tvar ox;\n\tvar oy;\n\tvar oz;\n\tvar ix;\n\tvar iy;\n\tvar iz;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the array shapes:\n\tshx = x.shape;\n\tshy = y.shape;\n\tshz = z.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\tsz = z.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\toz = z.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\tordz = z.order;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Cache references to the original input arrays:\n\txref = x.ref;\n\tyref = y.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 && shy.length === 0 ) {\n\t\tzset( zbuf, oz, fcn.call( thisArg, xget( xbuf, ox ), yget( ybuf, oy ), 0, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t\treturn;\n\t}\n\t// Iterate over the arrays based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tiz = vind2bind( shz, sz, oz, ordz, i, MODE );\n\t\tzset( zbuf, iz, fcn.call( thisArg, xget( xbuf, ix ), yget( ybuf, iy ), i, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing data for the first input array\n* @param {ArrayLikeObject} x.data - array data\n* @param {Array} x.accessors - array element accessors\n* @param {Object} y - object containing data for the second input array\n* @param {ArrayLikeObject} y.data - array data\n* @param {Array} y.accessors - array element accessors\n* @param {Object} z - object containing output array data\n* @param {ArrayLikeObject} z.data - array data\n* @param {Array} z.accessors - array element accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ 1, 2, 3, 4, 5, 6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 1, 1, 1, 1, 1, 1 ],\n* 'accessors': [ getter, setter ]\n* };\n* var z = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map2Right( x, y, z, naryFunction( add, 2 ) );\n*\n* var data = z.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Iterate over the elements...\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tzset( zbuf, i, fcn.call( thisArg, xget( xbuf, i ), yget( ybuf, i ), i, [ xbuf, ybuf ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} input arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input arrays must have the same length\n* @throws {Error} input ndarrays must be broadcast compatible\n* @throws {TypeError} third argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar out;\n\tvar tmp;\n\tvar sh;\n\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\t// Broadcast `x` and `y` to a common shape:\n\t\tsh = broadcastShapes( [ x.shape, y.shape ] );\n\t\tif ( sh === null ) {\n\t\t\tthrow new Error( 'invalid arguments. Input ndarrays must be broadcast compatible.' );\n\t\t}\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\t// Create an output array:\n\t\tout = ndzeros( sh, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': x.order\n\t\t});\n\n\t\t// Apply the function to the input arrays:\n\t\tndarrayFcn( x, y, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( y.length !== x.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input arrays must have the same length.' );\n\t\t}\n\t\tout = zeros( x.length );\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be an array-like object or an ndarray\n* @throws {TypeError} fourth argument must be a function\n* @throws {TypeError} input and output arrays must be either all array-like objects or all ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2Right( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2Right( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, out, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar isznd;\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tisznd = isndarrayLike( out );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( !isznd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\tndarrayFcn( x, y, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( isznd || !isArrayLikeObject( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( x.length !== y.length || y.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to elements in two input arrays while iterating from right to left and assign the results to an output array.\n*\n* @module @stdlib/utils/map2-right\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2Right( x, y. naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2Right.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2Right.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in an array of arrays and assigns the result to a nested element in a new array of arrays.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - array of arrays\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array of arrays\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} array of arrays\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ -1, -2, -3 ],\n* [ -4, -5, -6 ]\n* ];\n*\n* var out = map2d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n*/\nfunction map2d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar tmp;\n\tvar M;\n\tvar N;\n\tvar a;\n\tvar i;\n\tvar j;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tM = arr.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\ta = arr[ i ];\n\t\tif ( !isArrayLikeObject( a ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object containing array-like objects. Index: `%u`. Value: `%s`.', i, a ) );\n\t\t}\n\t\tN = a.length;\n\t\ttmp = [];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\ttmp.push( fcn.call( thisArg, a[ j ], [ i, j ], arr ) );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in an array of arrays and assign the result to a nested element in a new array of arrays.\n*\n* @module @stdlib/utils/map2d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map2d = require( '@stdlib/utils/map2d' );\n*\n* var arr = [\n* [ -1, -2, -3 ],\n* [ -4, -5, -6 ]\n* ];\n*\n* var out = map2d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a three-dimensional nested array and assigns the result to a nested element in a new three-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - three-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a three-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} three-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ -1, -2, -3 ] ],\n* [ [ -4, -5, -6 ] ]\n* ];\n*\n* var out = map3d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ]\n*/\nfunction map3d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a three-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a three-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tt2.push( fcn.call( thisArg, a2[ i2 ], [ i0, i1, i2 ], arr ) );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a three-dimensional nested array and assign the result to a nested element in a new three-dimensional nested array.\n*\n* @module @stdlib/utils/map3d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map3d = require( '@stdlib/utils/map3d' );\n*\n* var arr = [\n* [ [ -1, -2, -3 ] ],\n* [ [ -4, -5, -6 ] ]\n* ];\n*\n* var out = map3d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a four-dimensional nested array and assigns the result to a nested element in a new four-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - four-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a four-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} four-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ [ -1, -2, -3 ] ] ],\n* [ [ [ -4, -5, -6 ] ] ]\n* ];\n*\n* var out = map4d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ]\n*/\nfunction map4d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Indices: (%u, %u). Value: `%s`.', i0, i1, a2 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta3 = a2[ i2 ];\n\t\t\t\tif ( !isArrayLikeObject( a3 ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Indices: (%u, %u, %u). Value: `%s`.', i0, i1, i2, a3 ) );\n\t\t\t\t}\n\t\t\t\tS3 = a3.length;\n\t\t\t\tt3 = [];\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tt3.push( fcn.call( thisArg, a3[ i3 ], [ i0, i1, i2, i3 ], arr ) ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tt2.push( t3 );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a four-dimensional nested array and assign the result to a nested element in a new four-dimensional nested array.\n*\n* @module @stdlib/utils/map4d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map4d = require( '@stdlib/utils/map4d' );\n*\n* var arr = [\n* [ [ [ -1, -2, -3 ] ] ],\n* [ [ [ -4, -5, -6 ] ] ]\n* ];\n*\n* var out = map4d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a five-dimensional nested array and assigns the result to a nested element in a new five-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - five-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a five-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} five-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ [ [ -1, -2, -3 ] ] ] ],\n* [ [ [ [ -4, -5, -6 ] ] ] ]\n* ];\n*\n* var out = map5d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ [ 1, 2, 3 ] ] ] ], [ [ [ [ 4, 5, 6 ] ] ] ] ]\n*/\nfunction map5d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar t4;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar a4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u). Value: `%s`.', i0, i1, a2 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta3 = a2[ i2 ];\n\t\t\t\tif ( !isArrayLikeObject( a3 ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u, %u). Value: `%s`.', i0, i1, i2, a3 ) );\n\t\t\t\t}\n\t\t\t\tS3 = a3.length;\n\t\t\t\tt3 = [];\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\ta4 = a3[ i3 ];\n\t\t\t\t\tif ( !isArrayLikeObject( a4 ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u, %u, %u). Value: `%s`.', i0, i1, i2, i3, a4 ) );\n\t\t\t\t\t}\n\t\t\t\t\tS4 = a4.length;\n\t\t\t\t\tt4 = [];\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tt4.push( fcn.call( thisArg, a4[ i4 ], [ i0, i1, i2, i3, i4 ], arr ) ); // eslint-disable-line max-len\n\t\t\t\t\t}\n\t\t\t\t\tt3.push( t4 );\n\t\t\t\t}\n\t\t\t\tt2.push( t3 );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a five-dimensional nested array and assign the result to a nested element in a new five-dimensional nested array.\n*\n* @module @stdlib/utils/map5d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map5d = require( '@stdlib/utils/map5d' );\n*\n* var arr = [\n* [ [ [ [ -1, -2, -3 ] ] ] ],\n* [ [ [ [ -4, -5, -6 ] ] ] ]\n* ];\n*\n* var out = map5d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ [ 1, 2, 3 ] ] ] ], [ [ [ [ 4, 5, 6 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a specified mask.\n*\n* ## Notes\n*\n* - Only those arguments having a truthy mask value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Collection} mask - argument mask\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a collection\n* @returns {Function} masked function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = maskArguments( foo, [ 1, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction maskArguments( fcn, mask, thisArg ) {\n\tvar fcns;\n\tvar idx;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isCollection( mask ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', mask ) );\n\t}\n\tidx = [];\n\tfor ( i = 0; i < mask.length; i++ ) {\n\t\tif ( mask[ i ] ) {\n\t\t\tidx.push( i );\n\t\t}\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( idx.length < fcns.length ) ? fcns[ idx.length ] : nary;\n\n\t/**\n\t* Invokes a nullary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ] );\n\t}\n\n\t/**\n\t* Invokes a binary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ] );\n\t}\n\n\t/**\n\t* Invokes a ternary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quaternary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quinary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ], arguments[ idx[4] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ idx[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = maskArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a specified mask.\n*\n* @module @stdlib/utils/mask-arguments\n*\n* @example\n* var maskArguments = require( '@stdlib/utils/mask-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = maskArguments( foo, [ 1, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar identity = require( './../../identity-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a memoized function.\n*\n* @param {Function} fcn - function to memoize\n* @param {Function} [hashFunction] - function to map a set of arguments to a single value identifying that set\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} memoized function\n*\n* @example\n* function factorial( n ) {\n* var prod;\n* var i;\n* prod = 1;\n* for ( i = n; i > 1; i-- ) {\n* prod *= i;\n* }\n* return prod;\n* }\n*\n* var memoized = memoize( factorial );\n*\n* var v = memoized( 5 );\n* // returns 120\n*\n* v = memoized( 5 );\n* // returns 120\n*/\nfunction memoize( fcn, hashFunction ) {\n\tvar toKey;\n\tvar cache;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\ttoKey = identity;\n\t} else {\n\t\ttoKey = hashFunction;\n\t\tif ( !isFunction( toKey ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Hash function argument must be a function. Value: `%s`.', toKey ) );\n\t\t}\n\t}\n\tcache = {};\n\tsetReadOnly( memoized, 'cache', cache );\n\treturn memoized;\n\n\t/**\n\t* Memoized function.\n\t*\n\t* @private\n\t* @param {...*} args - function arguments\n\t* @returns {*} memoized function result\n\t*/\n\tfunction memoized() {\n\t\tvar args;\n\t\tvar out;\n\t\tvar key;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\tkey = toKey( args ).toString();\n\t\tif ( hasOwnProp( cache, key ) ) {\n\t\t\treturn cache[ key ];\n\t\t}\n\t\tout = fcn.apply( null, args );\n\t\tcache[ key ] = out;\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = memoize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Memoize a function.\n*\n* @module @stdlib/utils/memoize\n*\n* @example\n* var memoize = require( '@stdlib/utils/memoize' );\n*\n* function factorial( n ) {\n* var prod;\n* var i;\n* prod = 1;\n* for ( i = n; i > 1; i-- ) {\n* prod *= i;\n* }\n* return prod;\n* }\n*\n* var memoized = memoize( factorial );\n*\n* var v = memoized( 5 );\n* // returns 120\n*\n* v = memoized( 5 );\n* // returns 120\n*/\n\n// MODULES //\n\nvar memoize = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = memoize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'level': PINF,\n\t\t'override': true,\n\t\t'extend': true,\n\t\t'copy': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar typeOf = require( './../../type-of' );\nvar deepCopy = require( './../../copy' );\n\n\n// MAIN //\n\n/**\n* Merges a source object into a target object.\n*\n* @private\n* @param {Object} target - target object\n* @param {Object} source - source object\n* @param {number} level - merge level\n* @param {boolean} copy - indicates whether to perform a deep copy of merged values\n* @param {(boolean|Function)} override - defines the merge strategy\n* @param {boolean} extend - indicates whether new properties can be added to the target object\n*/\nfunction deepMerge( target, source, level, copy, override, extend ) {\n\tvar hasProp;\n\tvar isFunc;\n\tvar name;\n\tvar keys;\n\tvar curr;\n\tvar key;\n\tvar val;\n\tvar tmp;\n\tvar i;\n\n\t// Determine if we were provided a custom override strategy:\n\tisFunc = isFunction( override );\n\n\t// Decrement the level:\n\tlevel -= 1;\n\n\t// Loop through the source keys and implement the merge strategy...\n\tkeys = objectKeys( source );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\thasProp = hasOwnProp( target, key );\n\n\t\t// Can we add new properties to the target?\n\t\tif ( !hasProp && !extend ) {\n\t\t\tcontinue;\n\t\t}\n\t\tval = source[ key ];\n\n\t\tif ( hasProp ) {\n\t\t\tcurr = target[ key ];\n\t\t\tname = typeOf( curr );\n\n\t\t\t// Should we recurse to perform a deep(er) merge? (only if both the current value and the proposed value are objects and the level is > 0)\n\t\t\tif (\n\t\t\t\t!isBuffer( curr ) &&\n\t\t\t\tname === 'object' &&\n\t\t\t\tisObject( val ) &&\n\t\t\t\tlevel\n\t\t\t) {\n\t\t\t\tdeepMerge( curr, val, level, copy, override, extend );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Should we apply a custom merge (override) strategy?\n\t\t\tif ( isFunc ) {\n\t\t\t\ttmp = override( curr, val, key );\n\n\t\t\t\t// WARNING: the following check does NOT prevent shared (leaky) nested references. We only check for top-level reference equality. We will assume that the user knows best, given their having provided a custom override strategy.\n\t\t\t\tif ( copy && tmp !== curr && tmp === val ) {\n\t\t\t\t\ttmp = deepCopy( tmp );\n\t\t\t\t}\n\t\t\t\ttarget[ key ] = tmp;\n\t\t\t}\n\t\t\t// Are we allowed to override an existing target value?\n\t\t\telse if ( override ) {\n\t\t\t\tif ( copy ) {\n\t\t\t\t\ttarget[ key ] = deepCopy( val );\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// New property to be added to target object. Should we deep copy the source value?\n\t\telse if ( copy ) {\n\t\t\ttarget[ key ] = deepCopy( val );\n\t\t}\n\t\t// Perform a simple assignment...\n\t\telse {\n\t\t\ttarget[ key ] = val;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepMerge;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar format = require( '@stdlib/string/format' );\nvar deepMerge = require( './deepmerge.js' );\n\n\n// MAIN //\n\n/**\n* Returns a merge function based on provided options.\n*\n* @private\n* @param {Options} opts - function options\n* @param {number} options.level - merge level\n* @param {boolean} options.copy - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} options.override - defines the merge strategy\n* @param {boolean} options.extend - boolean indicating whether new properties can be added to the target object\n* @returns {Function} merge function\n*\n* @example\n* var merge = mergefcn({\n* 'level': Number.POSITIVE_INFINITY,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* });\n* // returns \n*/\nfunction mergefcn( opts ) {\n\treturn merge;\n\n\t/**\n\t* Merges objects into a target object. Note that the target object is mutated.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n\t* @throws {Error} must provide a target object and one or more source objects\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} source arguments must be objects\n\t* @returns {Object} merged (target) object\n\t*\n\t* @example\n\t* var target = {\n\t* 'a': 'beep'\n\t* };\n\t* var source = {\n\t* 'a': 'boop',\n\t* 'b': 'bap'\n\t* };\n\t*\n\t* var out = merge( target, source );\n\t* // returns {'a':'boop', 'b':'bap'}\n\t*/\n\tfunction merge( target ) {\n\t\tvar nargs;\n\t\tvar arg;\n\t\tvar src;\n\t\tvar i;\n\n\t\tnargs = arguments.length - 1;\n\t\tif ( nargs < 1 ) {\n\t\t\tthrow new Error( 'insufficient arguments. Must provide both a target object and one or more source objects.' );\n\t\t}\n\t\tif ( !isObject( target ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', target ) );\n\t\t}\n\t\tsrc = new Array( nargs );\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targ = arguments[ i+1 ];\n\n\t\t\t// WARNING: this is a porous check. Buffers, Numbers, Booleans, Strings, Dates, RegExp, custom class instances,... will all pass.\n\t\t\tif ( !isObject( arg ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be objects. Index: `%u`. Value: `%s`.', i, arg ) );\n\t\t\t}\n\t\t\tsrc[ i ] = arg;\n\t\t}\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tdeepMerge( target, src[ i ], opts.level, opts.copy, opts.override, opts.extend ); // eslint-disable-line max-len\n\t\t}\n\t\treturn target;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mergefcn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defaults = require( './defaults.js' );\nvar mergefcn = require( './mergefcn.js' );\n\n\n// MAIN //\n\n/**\n* Merges objects into a target object. Note that the target object is mutated.\n*\n* @name merge\n* @type {Function}\n* @param {Object} target - target object\n* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n* @throws {Error} must provide a target object and one or more source objects\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} source arguments must be objects\n* @returns {Object} merged (target) object\n*\n* @example\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*/\nvar merge = mergefcn( defaults() );\n\n\n// EXPORTS //\n\nmodule.exports = merge;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {number} [options.level] - merge level\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override] - defines the merge strategy\n* @param {boolean} [options.extend] - boolean indicating whether new properties can be added to the target object\n* @returns {(Error|null)} error object or null\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'level' ) ) {\n\t\topts.level = options.level;\n\t\tif ( !isPositiveInteger( opts.level ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'level', opts.level ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'override' ) ) {\n\t\topts.override = options.override;\n\t\tif (\n\t\t\t!isBoolean( opts.override ) &&\n\t\t\t!isFunction( opts.override )\n\t\t) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be either a boolean or a function. Option: `%s`.', 'override', opts.override ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'extend' ) ) {\n\t\topts.extend = options.extend;\n\t\tif ( !isBoolean( opts.extend ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'extend', opts.extend ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar mergefcn = require( './mergefcn.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for merging and extending objects.\n*\n* @param {Options} options - merge options\n* @param {number} [options.level=Infinity] - merge level\n* @param {boolean} [options.copy=true] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override=true] - defines the merge strategy\n* @param {boolean} [options.extend=true] - boolean indicating whether new properties can be added to the target object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function which can be used to merge objects\n*\n* @example\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar err;\n\topts = defaults();\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\treturn mergefcn( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Merge and extend objects.\n*\n* @module @stdlib/utils/merge\n*\n* @example\n* var merge = require( '@stdlib/utils/merge' );\n*\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*\n* @example\n* var factory = require( '@stdlib/utils/merge' ).factory;\n*\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Moves a property from one object to another object.\n*\n* @param {Object} source - source object\n* @param {string} prop - property to move\n* @param {Object} target - target object\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @returns {boolean} boolean indicating whether operation was successful\n*\n* @example\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'a', obj2 );\n* // returns true\n*\n* @example\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'c', obj2 );\n* // returns false\n*/\nfunction moveProperty( source, prop, target ) {\n\tvar desc;\n\tif ( typeof source !== 'object' || source === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Source argument must be an object. Value: `%s`.', source ) );\n\t}\n\tif ( typeof target !== 'object' || target === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Target argument must be an object. Value: `%s`.', target ) );\n\t}\n\t// TODO: handle case where gOPD is not supported\n\tdesc = Object.getOwnPropertyDescriptor( source, prop );\n\tif ( desc === void 0 ) {\n\t\treturn false;\n\t}\n\tdelete source[ prop ];\n\tdefineProperty( target, prop, desc );\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = moveProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Move a property from one object to another object.\n*\n* @module @stdlib/utils/move-property\n*\n* @example\n* var moveProperty = require( '@stdlib/utils/move-property' );\n*\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'a', obj2 );\n* // returns true\n*\n* bool = moveProperty( obj1, 'c', obj2 );\n* // returns false\n*/\n\n// MODULES //\n\nvar moveProperty = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = moveProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited property names and symbols\n*\n* @example\n* var props = propertiesIn( [] );\n* // returns [...]\n*/\nfunction propertiesIn( value ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all properties...\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited property names and symbols.\n*\n* @module @stdlib/utils/properties-in\n*\n* @example\n* var propertiesIn = require( '@stdlib/utils/properties-in' );\n*\n* var props = propertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = contains;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Tests if an array contains distinct elements.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {boolean} boolean indicating if an array contains distinct elements\n*/\nfunction hasDistinctElements( arr ) {\n\tvar obj;\n\tvar i;\n\n\tobj = {};\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( hasOwnProp( obj, arr[ i ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tobj[ arr[i] ] = true;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasDistinctElements;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar dtypes = require( '@stdlib/array/typed-dtypes' );\nvar format = require( '@stdlib/string/format' );\nvar contains = require( './contains.js' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - default data type\n* @param {string} [options.name] - tuple name\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64',\n* 'name': 'Complex128'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !isString( opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'dtype', opts.dtype ) );\n\t\t}\n\t\tif ( !contains( DTYPES, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', opts.dtype ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t\tif ( !isString( opts.name ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'name', opts.name ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Specifies a sort order for ordering numeric values in ascending order.\n*\n* ## Notes\n*\n* - If `a < b`, then function returns a number less than `0`, which specifies to sort `a` to an index lower than `b`.\n* - If `a > b`, then function returns a number greater than `0`, which specifies to sort `a` to an index higher than `b`.\n* - If `a == b`, then function returns `0`, which specifies that the order of `a` and `b` should remain unchanged (not guaranteed).\n*\n* @private\n* @param {number} a - first value\n* @param {number} b - second value\n* @returns {number} difference between `a` and `b`\n*/\nfunction ascending( a, b ) {\n\treturn a - b;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ascending;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( v.value );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {StringArray} fields - tuple fields\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( fields, it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i, fields[ i ] ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/* eslint-disable max-len, max-lines */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar propertiesIn = require( './../../properties-in' );\nvar typedarray = require( '@stdlib/array/typed' );\nvar Int8Array = require( '@stdlib/array/int8' );\nvar getDtype = require( '@stdlib/array/dtype' );\nvar defineProperty = require( './../../define-property' );\nvar setNonEnumerableProperty = require( './../../define-nonenumerable-property' );\nvar setNonEnumerableReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' ); // eslint-disable-line id-length\nvar setNonEnumerableReadWriteAccessor = require( './../../define-nonenumerable-read-write-accessor' ); // eslint-disable-line id-length\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\nvar contains = require( './contains.js' );\nvar hasDistinctElements = require( './has_distinct_elements.js' );\nvar validate = require( './validate.js' );\nvar ascending = require( './ascending.js' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\n\n\n// VARIABLES //\n\nvar RESERVED_PROPS = propertiesIn( new Int8Array( 0 ) );\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// MAIN //\n\n/**\n* Returns a named typed tuple factory.\n*\n* @param {StringArray} names - field (property) names\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @param {string} [options.name=\"tuple\"] - tuple name\n* @throws {TypeError} must provide an array of strings\n* @throws {TypeError} must provide distinct field names\n* @throws {Error} cannot provide a reserved field (property) name\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a recognized data type\n* @returns {Function} factory function\n*\n* @example\n* var point = factory( [ 'x', 'y' ] );\n*\n* var p = point( [ 1.0, -1.0 ] );\n*\n* var x = p[ 0 ];\n* // returns 1.0\n*\n* x = p.x;\n* // returns 1.0\n*\n* var y = p[ 1 ];\n* // returns -1.0\n*\n* y = p.y;\n* // returns -1.0\n*/\nfunction factory( names, options ) { // eslint-disable-line max-lines-per-function, stdlib/jsdoc-require-throws-tags\n\tvar nfields;\n\tvar fields;\n\tvar opts;\n\tvar err;\n\tvar i;\n\tif ( !isStringArray( names ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array of strings. Value: `%s`.', names ) );\n\t}\n\tif ( !hasDistinctElements( names ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Field names must be distinct. Value: `%s`.', names ) );\n\t}\n\tfields = names.slice();\n\tnfields = fields.length;\n\tfor ( i = 0; i < nfields; i++ ) {\n\t\tif ( contains( RESERVED_PROPS, fields[ i ] ) ) {\n\t\t\tthrow new Error( format( 'invalid argument. Provided field name is reserved. Name: `%s`.', fields[ i ] ) );\n\t\t}\n\t}\n\topts = {\n\t\t'dtype': 'float64',\n\t\t'name': 'tuple'\n\t};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/**\n\t* Returns a named typed tuple.\n\t*\n\t* @private\n\t* @param {(TypedArray|ArrayLikeObject|ArrayBuffer|Iterable)} [arg] - a typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {string} [dtype] - data type\n\t* @throws {TypeError} must provide a recognized data type\n\t* @throws {RangeError} arguments must be compatible with tuple length\n\t* @returns {TypedArray} named typed tuple\n\t*/\n\tfunction namedtypedtuple() { // eslint-disable-line max-lines-per-function\n\t\tvar indices;\n\t\tvar dtype;\n\t\tvar nargs;\n\t\tvar tuple;\n\t\tvar i;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs <= 0 ) {\n\t\t\ttuple = typedarray( nfields, opts.dtype );\n\t\t} else if ( nargs === 1 ) {\n\t\t\tif ( isString( arguments[ 0 ] ) ) {\n\t\t\t\t// Arguments: [ dtype ]\n\t\t\t\ttuple = typedarray( nfields, arguments[ 0 ] );\n\t\t\t} else if ( isArrayBuffer( arguments[ 0 ] ) ) {\n\t\t\t\t// Arguments: [ ArrayBuffer ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], 0, nfields, opts.dtype );\n\t\t\t} else {\n\t\t\t\t// Arguments: [ TypedArray|ArrayLikeObject|Iterable ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], opts.dtype );\n\t\t\t}\n\t\t} else if ( nargs === 2 ) {\n\t\t\tif ( isArrayBuffer( arguments[ 0 ] ) ) {\n\t\t\t\tif ( isString( arguments[ 1 ] ) ) {\n\t\t\t\t\t// Arguments: [ ArrayBuffer, dtype ]\n\t\t\t\t\ttuple = typedarray( arguments[ 0 ], 0, nfields, arguments[ 1 ] );\n\t\t\t\t} else {\n\t\t\t\t\t// Arguments: [ ArrayBuffer, byteOffset ]\n\t\t\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ], nfields, opts.dtype );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Arguments: [ TypedArray|ArrayLikeObject|Iterable, dtype ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ] );\n\t\t\t}\n\t\t} else {\n\t\t\t// Arguments: [ ArrayBuffer, byteOffset, dtype ]\n\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ], nfields, arguments[ 2 ] );\n\t\t}\n\t\tif ( tuple.length !== nfields ) {\n\t\t\tthrow new RangeError( format( 'invalid arguments. Arguments are incompatible with the number of tuple fields. Number of fields: `%u`. Number of data elements: `%u`.', nfields, tuple.length ) );\n\t\t}\n\t\tdtype = getDtype( tuple );\n\n\t\tindices = []; // indirect index look-up table\n\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\tindices.push( i );\n\t\t\tsetNonEnumerableReadWriteAccessor( tuple, fields[ i ], getter( i ), setter( i ) );\n\t\t}\n\t\tsetNonEnumerableProperty( tuple, 'name', opts.name );\n\t\tsetNonEnumerableReadOnlyAccessor( tuple, 'fields', getFields );\n\t\tsetNonEnumerableReadOnlyAccessor( tuple, 'orderedFields', orderedFields );\n\n\t\t// Note: keep in alphabetical order\n\t\tsetNonEnumerableProperty( tuple, 'entries', entries );\n\t\tsetNonEnumerableProperty( tuple, 'every', every );\n\t\tsetNonEnumerableProperty( tuple, 'fieldOf', fieldOf );\n\t\tsetNonEnumerableProperty( tuple, 'filter', filter );\n\t\tsetNonEnumerableProperty( tuple, 'find', find );\n\t\tsetNonEnumerableProperty( tuple, 'findIndex', findIndex );\n\t\tsetNonEnumerableProperty( tuple, 'findField', findField );\n\t\tsetNonEnumerableProperty( tuple, 'forEach', forEach );\n\t\tsetNonEnumerableProperty( tuple, 'ind2key', ind2key );\n\t\tsetNonEnumerableProperty( tuple, 'key2ind', key2ind );\n\t\tsetNonEnumerableProperty( tuple, 'keys', keys );\n\t\tsetNonEnumerableProperty( tuple, 'lastFieldOf', lastFieldOf );\n\t\tsetNonEnumerableProperty( tuple, 'map', map );\n\t\tsetNonEnumerableProperty( tuple, 'reduce', reduce );\n\t\tsetNonEnumerableProperty( tuple, 'reduceRight', reduceRight );\n\t\tsetNonEnumerableProperty( tuple, 'reverse', reverse );\n\t\tsetNonEnumerableProperty( tuple, 'slice', slice );\n\t\tsetNonEnumerableProperty( tuple, 'some', some );\n\t\tsetNonEnumerableProperty( tuple, 'sort', sort );\n\t\tsetNonEnumerableProperty( tuple, 'subtuple', subtuple );\n\t\tsetNonEnumerableProperty( tuple, 'toJSON', toJSON );\n\t\tsetNonEnumerableProperty( tuple, 'toString', toString );\n\n\t\treturn tuple;\n\n\t\t/**\n\t\t* Returns an accessor to retrieve a tuple value.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} i - tuple index\n\t\t* @returns {Function} accessor\n\t\t*/\n\t\tfunction getter( i ) {\n\t\t\treturn get;\n\n\t\t\t/**\n\t\t\t* Returns a tuple value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {number} tuple value\n\t\t\t*/\n\t\t\tfunction get() {\n\t\t\t\treturn tuple[ indices[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns an accessor to set a tuple value.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} i - tuple index\n\t\t* @returns {Function} accessor\n\t\t*/\n\t\tfunction setter( i ) {\n\t\t\treturn set;\n\n\t\t\t/**\n\t\t\t* Sets a tuple value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {number} v - value to set\n\t\t\t*/\n\t\t\tfunction set( v ) {\n\t\t\t\ttuple[ indices[ i ] ] = v;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the list of tuple fields.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @returns {StringArray} tuple fields\n\t\t*/\n\t\tfunction getFields() {\n\t\t\treturn fields.slice();\n\t\t}\n\n\t\t/**\n\t\t* Returns the list of tuple fields in index order.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @returns {StringArray} tuple fields\n\t\t*/\n\t\tfunction orderedFields() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tout = fields.slice();\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ i ] = fields[ indices[i] ];\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// Note: keep functions which follow in alphabetical order\n\n\t\t/**\n\t\t* Returns an iterator for iterating over tuple key-value pairs.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {Iterator} iterator\n\t\t*/\n\t\tfunction entries() {\n\t\t\tvar self;\n\t\t\tvar iter;\n\t\t\tvar FLG;\n\t\t\tvar i;\n\n\t\t\tself = this; // eslint-disable-line no-invalid-this\n\t\t\tif ( self !== tuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\n\t\t\t// Initialize the iteration index:\n\t\t\ti = -1;\n\n\t\t\t// Create an iterator protocol-compliant object:\n\t\t\titer = {};\n\t\t\tdefineProperty( iter, 'next', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': next\n\t\t\t});\n\t\t\tdefineProperty( iter, 'return', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': end\n\t\t\t});\n\t\t\tif ( HAS_ITERATOR_SYMBOL ) {\n\t\t\t\tdefineProperty( iter, ITERATOR_SYMBOL, {\n\t\t\t\t\t'configurable': false,\n\t\t\t\t\t'enumerable': false,\n\t\t\t\t\t'writable': false,\n\t\t\t\t\t'value': factory\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn iter;\n\n\t\t\t/**\n\t\t\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction next() {\n\t\t\t\ti += 1;\n\t\t\t\tif ( FLG || i >= nfields ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'value': [ i, fields[ indices[ i ] ], tuple[ i ] ],\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Finishes an iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {*} [value] - value to return\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction end( value ) {\n\t\t\t\tFLG = true;\n\t\t\t\tif ( arguments.length ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'value': value,\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'done': true\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Returns a new iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Iterator} iterator\n\t\t\t*/\n\t\t\tfunction factory() {\n\t\t\t\treturn self.entries();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Tests whether all tuple elements pass a test implemented by a predicate function.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {boolean} boolean indicating if all elements pass\n\t\t*/\n\t\tfunction every( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( !bool ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the first tuple element strictly equal to a search element.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The function does not distinguish between signed and unsigned zero.\n\t\t* - If unable to locate a search element, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {*} searchElement - search element\n\t\t* @param {integer} [fromIndex=0] - tuple index from which to begin searching\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction fieldOf( searchElement ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\ti = arguments[ 0 ];\n\t\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', i ) );\n\t\t\t\t}\n\t\t\t\tif ( i >= nfields ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = nfields + i;\n\t\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\t\ti = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t\tfor ( ; i < nfields; i++ ) {\n\t\t\t\tif ( tuple[ i ] === searchElement ) {\n\t\t\t\t\treturn fields[ indices[ i ] ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Creates a new tuple which includes those elements for which a predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The returned tuple has the same data type as the host tuple.\n\t\t* - If a predicate function does not return a truthy value for any tuple element, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - filter (predicate) function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction filter( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar tmp;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\ttmp = [];\n\t\t\tf = [];\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tf.push( fields[ indices[i] ] );\n\t\t\t\t\ttmp.push( tuple[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( f.length === nfields ) {\n\t\t\t\treturn namedtypedtuple( tmp, dtype );\n\t\t\t}\n\t\t\tif ( f.length ) {\n\t\t\t\treturn factory( f, opts )( tmp );\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t* Returns the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(number|void)} tuple element\n\t\t*/\n\t\tfunction find( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn tuple[ i ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the predicate function never returns a truthy value, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction findField( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tf = fields[ indices[ i ] ];\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, f, tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the index of the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the predicate function never returns a truthy value, the function returns `-1`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {integer} tuple index or `-1`\n\t\t*/\n\t\tfunction findIndex( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t* Invokes a callback for each tuple element.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - function to invoke\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t*/\n\t\tfunction forEach( fcn, thisArg ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tfcn.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Converts a tuple index to a field name.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If provided an out-of-bounds index, the function returns `undefined`.\n\t\t* - If provided a negative tuple index, the function resolves the index relative to the last tuple element.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} ind - tuple index\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} must provide an integer\n\t\t* @returns {(string|void)} field name or undefined\n\t\t*/\n\t\tfunction ind2key( ind ) {\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isInteger( ind ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', ind ) );\n\t\t\t}\n\t\t\tif ( ind < 0 ) {\n\t\t\t\tind = nfields + ind;\n\t\t\t}\n\t\t\tif ( ind < 0 || ind >= nfields ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn fields[ indices[ ind ] ];\n\t\t}\n\n\t\t/**\n\t\t* Converts a field name to a tuple index.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If provided an unknown field name, the function returns `-1`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {string} key - field name\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a string\n\t\t* @returns {integer} tuple index\n\t\t*/\n\t\tfunction key2ind( key ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isString( key ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', key ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tif ( fields[ indices[i] ] === key ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t* Returns an iterator for iterating over tuple keys.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {Iterator} iterator\n\t\t*/\n\t\tfunction keys() {\n\t\t\tvar self;\n\t\t\tvar iter;\n\t\t\tvar FLG;\n\t\t\tvar i;\n\n\t\t\tself = this; // eslint-disable-line no-invalid-this\n\t\t\tif ( self !== tuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\n\t\t\t// Initialize the iteration index:\n\t\t\ti = -1;\n\n\t\t\t// Create an iterator protocol-compliant object:\n\t\t\titer = {};\n\t\t\tdefineProperty( iter, 'next', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': next\n\t\t\t});\n\t\t\tdefineProperty( iter, 'return', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': end\n\t\t\t});\n\t\t\tif ( HAS_ITERATOR_SYMBOL ) {\n\t\t\t\tdefineProperty( iter, ITERATOR_SYMBOL, {\n\t\t\t\t\t'configurable': false,\n\t\t\t\t\t'enumerable': false,\n\t\t\t\t\t'writable': false,\n\t\t\t\t\t'value': factory\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn iter;\n\n\t\t\t/**\n\t\t\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction next() {\n\t\t\t\ti += 1;\n\t\t\t\tif ( FLG || i >= nfields ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'value': [ i, fields[ indices[ i ] ] ],\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Finishes an iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {*} [value] - value to return\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction end( value ) {\n\t\t\t\tFLG = true;\n\t\t\t\tif ( arguments.length ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'value': value,\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'done': true\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Returns a new iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Iterator} iterator\n\t\t\t*/\n\t\t\tfunction factory() {\n\t\t\t\treturn self.keys();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the last tuple element strictly equal to a search element, iterating from right to left.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The function does not distinguish between signed and unsigned zero.\n\t\t* - If unable to locate a search element, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {*} searchElement - search element\n\t\t* @param {integer} [fromIndex=-1] - tuple index from which to begin searching\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction lastFieldOf( searchElement ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\ti = arguments[ 1 ];\n\t\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', i ) );\n\t\t\t\t}\n\t\t\t\tif ( i >= nfields ) {\n\t\t\t\t\ti = nfields - 1;\n\t\t\t\t} else if ( i < 0 ) {\n\t\t\t\t\ti = nfields + i;\n\t\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ti = nfields - 1;\n\t\t\t}\n\t\t\tfor ( ; i >= 0; i-- ) {\n\t\t\t\tif ( tuple[ i ] === searchElement ) {\n\t\t\t\t\treturn fields[ indices[ i ] ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Maps each tuple element to an element in a new tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The returned tuple has the same data type as the host tuple.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - map function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {TypedArray} new tuple\n\t\t*/\n\t\tfunction map( fcn, thisArg ) {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tout = namedtypedtuple( dtype );\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ i ] = fcn.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Applies a function against an accumulator and each element in a tuple and returns the accumulated result.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - reduction function\n\t\t* @param {*} [initial] - initial value\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {*} accumulated result\n\t\t*/\n\t\tfunction reduce( fcn ) {\n\t\t\tvar acc;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\tacc = arguments[ 1 ];\n\t\t\t\ti = 0;\n\t\t\t} else {\n\t\t\t\tacc = tuple[ 0 ];\n\t\t\t\ti = 1;\n\t\t\t}\n\t\t\tfor ( ; i < nfields; i++ ) {\n\t\t\t\tacc = fcn( acc, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\n\t\t/**\n\t\t* Applies a function against an accumulator and each element in a tuple and returns the accumulated result, iterating from right to left.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - reduction function\n\t\t* @param {*} [initial] - initial value\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {*} accumulated result\n\t\t*/\n\t\tfunction reduceRight( fcn ) {\n\t\t\tvar acc;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\tacc = arguments[ 1 ];\n\t\t\t\ti = nfields - 1;\n\t\t\t} else {\n\t\t\t\tacc = tuple[ nfields-1 ];\n\t\t\t\ti = nfields - 2;\n\t\t\t}\n\t\t\tfor ( ; i >= 0; i-- ) {\n\t\t\t\tacc = fcn( acc, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\n\t\t/**\n\t\t* Reverses a tuple **in-place**.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {TypedArray} reversed tuple\n\t\t*/\n\t\tfunction reverse() {\n\t\t\tvar tmp;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < floor( nfields/2 ); i++ ) {\n\t\t\t\tj = nfields - i - 1;\n\t\t\t\ttmp = tuple[ i ];\n\t\t\t\ttuple[ i ] = tuple[ j ];\n\t\t\t\ttuple[ j ] = tmp;\n\t\t\t}\n\t\t\t// Because the indices are bounded [0,nfields), we can use simple arithmetic to \"reverse\" index values in-place...\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tindices[ i ] = nfields - indices[ i ] - 1;\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\n\t\t/**\n\t\t* Copies elements to a new tuple with the same underlying data type as the host tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the function is unable to resolve indices to a non-empty tuple subsequence, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} [begin=0] - start element index (inclusive)\n\t\t* @param {integer} [end=tuple.length] - end element index (exclusive)\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be an integer\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction slice( begin, end ) {\n\t\t\tvar tmp;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tvar j;\n\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length === 0 ) {\n\t\t\t\treturn namedtypedtuple( tuple, dtype );\n\t\t\t}\n\t\t\ti = begin;\n\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t\t}\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = nfields + i;\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\tj = nfields;\n\t\t\t} else {\n\t\t\t\tj = end;\n\t\t\t\tif ( !isInteger( j ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t\t}\n\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\tj = nfields + j;\n\t\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\t\tj = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if ( j > nfields ) {\n\t\t\t\t\tj = nfields;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i >= j ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tf = [];\n\t\t\ttmp = [];\n\t\t\tfor ( ; i < j; i++ ) {\n\t\t\t\tf.push( fields[ indices[i] ] );\n\t\t\t\ttmp.push( tuple[ i ] );\n\t\t\t}\n\t\t\treturn factory( f, opts )( tmp, dtype );\n\t\t}\n\n\t\t/**\n\t\t* Tests whether at least one tuple element passes a test implemented by a predicate function.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {boolean} boolean indicating if at least one element passes\n\t\t*/\n\t\tfunction some( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* Sorts a tuple in-place.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The comparison function is provided two tuple elements, `a` and `b`, per invocation, and its return value determines the sort order as follows:\n\t\t*\n\t\t* - If the comparison function returns a value **less** than zero, then the function sorts `a` to an index lower than `b` (i.e., `a` should come **before** `b`).\n\t\t* - If the comparison function returns a value **greater** than zero, then the function sorts `a` to an index higher than `b` (i.e., `b` should come **before** `a`).\n\t\t* - If the comparison function returns **zero**, then the relative order of `a` and `b` _should_ remain unchanged.\n\t\t*\n\t\t* - Invoking this method does **not** affect tuple field assignments.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} [compareFunction] - function which specifies the sort order\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {TypedArray} sorted tuple\n\t\t*/\n\t\tfunction sort( compareFunction ) {\n\t\t\tvar clbk;\n\t\t\tvar tmp;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tvar k;\n\t\t\tvar v;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length ) {\n\t\t\t\tif ( !isFunction( compareFunction ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFunction ) );\n\t\t\t\t}\n\t\t\t\tclbk = compareFunction;\n\t\t\t} else {\n\t\t\t\tclbk = ascending;\n\t\t\t}\n\t\t\tindices.sort( wrapper );\n\n\t\t\t// Create a temporary indices array which we'll reorder as we rearrange the tuple elements:\n\t\t\ttmp = indices.slice();\n\n\t\t\t// Rearrange tuple elements according to the rearranged indices (note: every \"move\" moves a tuple element to its desired position with runtime complexity O(N))...\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t// Check if we need to move a tuple element:\n\t\t\t\tif ( tmp[ i ] !== i ) {\n\t\t\t\t\tv = tuple[ i ];\n\t\t\t\t\tj = i;\n\t\t\t\t\tk = tmp[ j ];\n\n\t\t\t\t\t// Follow \"cycles\", stopping once we are back at index `i`...\n\t\t\t\t\twhile ( k !== i ) {\n\t\t\t\t\t\ttuple[ j ] = tuple[ k ];\n\t\t\t\t\t\ttmp[ j ] = j;\n\t\t\t\t\t\tj = k;\n\t\t\t\t\t\tk = tmp[ j ];\n\t\t\t\t\t}\n\t\t\t\t\ttuple[ j ] = v;\n\t\t\t\t\ttmp[ j ] = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tuple;\n\n\t\t\t/**\n\t\t\t* Wraps a comparison function to allow sorting the internal indices array rather than the tuple directly.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {NonNegativeInteger} ia - first index\n\t\t\t* @param {NonNegativeInteger} ib - second index\n\t\t\t* @returns {*} value specifying the sort order\n\t\t\t*/\n\t\t\tfunction wrapper( ia, ib ) {\n\t\t\t\tvar a = tuple[ indices[ ia ] ];\n\t\t\t\tvar b = tuple[ indices[ ib ] ];\n\t\t\t\treturn clbk( a, b );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Creates a new tuple over the same underlying `ArrayBuffer` and with the same underlying data type as the host tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the function is unable to resolve indices to a non-empty tuple subsequence, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} [begin=0] - start element index (inclusive)\n\t\t* @param {integer} [end=tuple.length] - end element index (exclusive)\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be an integer\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction subtuple( begin, end ) {\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tvar k;\n\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length === 0 ) {\n\t\t\t\treturn namedtypedtuple( tuple.buffer, tuple.byteOffset, dtype );\n\t\t\t}\n\t\t\ti = begin;\n\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t\t}\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = nfields + i;\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\tj = nfields;\n\t\t\t} else {\n\t\t\t\tj = end;\n\t\t\t\tif ( !isInteger( j ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t\t}\n\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\tj = nfields + j;\n\t\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\t\tj = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if ( j > nfields ) {\n\t\t\t\t\tj = nfields;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i >= j ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tf = [];\n\t\t\tfor ( k = i; k < j; k++ ) {\n\t\t\t\tf.push( fields[ indices[k] ] );\n\t\t\t}\n\t\t\treturn factory( f, opts )( tuple.buffer, tuple.byteOffset+(i*tuple.BYTES_PER_ELEMENT), dtype );\n\t\t}\n\n\t\t/**\n\t\t* Serializes a tuple as JSON.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {JSON} tuple JSON representation\n\t\t*/\n\t\tfunction toJSON() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tout = {};\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ fields[i] ] = tuple[ indices[i] ];\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// TODO: consider adding `toLocaleString()` in a manner similar to `toString()` below\n\n\t\t/**\n\t\t* Serializes a tuple as a string.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {string} tuple string representation\n\t\t*/\n\t\tfunction toString() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tout = opts.name + '(';\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout += fields[ i ];\n\t\t\t\tout += '=';\n\t\t\t\tout += tuple[ indices[ i ] ];\n\t\t\t\tif ( i < nfields-1 ) {\n\t\t\t\t\tout += ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tout += ')';\n\t\t\treturn out;\n\t\t}\n\t}\n\n\t// Note: keep the following methods in alphabetical order...\n\n\t/**\n\t* Creates a new tuple from an array-like object or an iterable.\n\t*\n\t* @private\n\t* @name from\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {(ArrayLikeObject|Iterable)} src - array-like object or iterable\n\t* @param {Function} [clbk] - callback to invoke for each source element\n\t* @param {*} [thisArg] - callback execution context\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {TypeError} first argument must be an array-like object or an iterable\n\t* @throws {RangeError} source must be compatible with tuple length\n\t* @throws {TypeError} second argument must be a function\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'from', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function from( src ) { // eslint-disable-line no-restricted-syntax\n\t\t\tvar thisArg;\n\t\t\tvar nargs;\n\t\t\tvar tuple;\n\t\t\tvar clbk;\n\t\t\tvar tmp;\n\t\t\tvar it;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tnargs = arguments.length;\n\t\t\tif ( nargs > 1 ) {\n\t\t\t\tclbk = arguments[ 1 ];\n\t\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs > 2 ) {\n\t\t\t\t\tthisArg = arguments[ 2 ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isCollection( src ) ) {\n\t\t\t\tif ( src.length !== nfields ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Source is incompatible with the number of tuple fields. Number of fields: `%u`. Source length: `%u`.', nfields, src.length ) );\n\t\t\t\t}\n\t\t\t\ttuple = namedtypedtuple( nfields, opts.dtype );\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\t\ttuple[ i ] = clbk.call( thisArg, src[ i ], i, fields[ i ] );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\t\ttuple[ i ] = src[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tit = src[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( it.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t\t}\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\ttmp = fromIteratorMap( fields, it, clbk, thisArg );\n\t\t\t\t} else {\n\t\t\t\t\ttmp = fromIterator( it );\n\t\t\t\t}\n\t\t\t\ttuple = namedtypedtuple( tmp, opts.dtype );\n\t\t\t} else {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\t});\n\n\t/**\n\t* Creates a new tuple from an object containing tuple fields.\n\t*\n\t* @private\n\t* @name fromObject\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {Object} obj - source object\n\t* @param {Function} [clbk] - callback to invoke for each source object tuple field\n\t* @param {*} [thisArg] - callback execution context\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} second argument must be a function\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'fromObject', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function fromObject( obj ) { // eslint-disable-line no-restricted-syntax\n\t\t\tvar thisArg;\n\t\t\tvar nargs;\n\t\t\tvar tuple;\n\t\t\tvar clbk;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tif ( obj === null || typeof obj !== 'object' ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t\t}\n\t\t\tnargs = arguments.length;\n\t\t\tif ( nargs > 1 ) {\n\t\t\t\tclbk = arguments[ 1 ];\n\t\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs > 2 ) {\n\t\t\t\t\tthisArg = arguments[ 2 ];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttuple = namedtypedtuple( nfields, opts.dtype );\n\t\t\tif ( clbk ) {\n\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\tf = fields[ i ];\n\t\t\t\t\tif ( hasOwnProp( obj, f ) ) {\n\t\t\t\t\t\ttuple[ i ] = clbk.call( thisArg, obj[ f ], f );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\tf = fields[ i ];\n\t\t\t\t\tif ( hasOwnProp( obj, f ) ) {\n\t\t\t\t\t\ttuple[ i ] = obj[ f ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\t});\n\n\t/**\n\t* Creates a new tuple from a variable number of arguments.\n\t*\n\t* @private\n\t* @name of\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {...number} element - tuple elements\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {RangeError} incompatible number of arguments\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'of', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function of() { // eslint-disable-line no-restricted-syntax\n\t\t\tvar args;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tif ( arguments.length !== nfields ) {\n\t\t\t\tthrow new RangeError( format( 'invalid invocation. Number of arguments is incompatible with the number of tuple fields. Number of fields: `%u`. Number of arguments: `%u`.', nfields, arguments.length ) );\n\t\t\t}\n\t\t\targs = [];\n\t\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\t\targs.push( arguments[ i ] );\n\t\t\t}\n\t\t\treturn namedtypedtuple( args );\n\t\t}\n\t});\n\n\treturn namedtypedtuple;\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Named typed tuple.\n*\n* @module @stdlib/utils/named-typed-tuple\n*\n* @example\n* var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' );\n*\n* var point = namedtypedtuple( [ 'x', 'y' ] );\n*\n* var p = point( [ 1.0, -1.0 ] );\n*\n* var x = p[ 0 ];\n* // returns 1.0\n*\n* x = p.x;\n* // returns 1.0\n*\n* var y = p[ 1 ];\n* // returns -1.0\n*\n* y = p.y;\n* // returns -1.0\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies a specified number of arguments to a provided function.\n*\n* ## Notes\n*\n* - The returned function **always** invokes the wrapped function with a specified number of arguments, even when the returned function is provided fewer arguments. The value for the missing arguments is equal to `undefined`.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeInteger} arity - number of arguments\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {Function} function wrapper\n*\n* @example\n* function foo() {\n* var s;\n* var i;\n*\n* s = 0;\n* for ( i = 0; i < arguments.length; i++ ) {\n* s += arguments[ i ];\n* }\n* return s;\n* }\n*\n* var bar = naryFunction( foo, 2 );\n*\n* var out = bar( 1, 2, 3, 4, 5, 6 );\n* // returns 3\n*/\nfunction naryFunction( fcn, arity, thisArg ) {\n\tvar fcns;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( arity < fcns.length ) ? fcns[ arity ] : nary;\n\n\t/**\n\t* Invokes a nullary function.\n\t*\n\t* @private\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary( x ) {\n\t\treturn fcn.call( thisArg, x );\n\t}\n\n\t/**\n\t* Invokes a binary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary( x, y ) {\n\t\treturn fcn.call( thisArg, x, y );\n\t}\n\n\t/**\n\t* Invokes a ternary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary( x, y, z ) {\n\t\treturn fcn.call( thisArg, x, y, z );\n\t}\n\n\t/**\n\t* Invokes a quaternary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary( x, y, z, w ) {\n\t\treturn fcn.call( thisArg, x, y, z, w );\n\t}\n\n\t/**\n\t* Invokes a quinary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {*} v - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary( x, y, z, w, v ) {\n\t\treturn fcn.call( thisArg, x, y, z, w, v );\n\t}\n\n\t/**\n\t* Invokes an n-ary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {*} v - input value\n\t* @param {*} t - input value\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary( x, y, z, w, v, t ) {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [ x, y, z, w, v, t ];\n\t\tfor ( i = 6; i < arity; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = naryFunction;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies a specified number arguments to a provided function.\n*\n* @module @stdlib/utils/nary-function\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function foo() {\n* var s;\n* var i;\n*\n* s = 0;\n* for ( i = 0; i < arguments.length; i++ ) {\n* s += arguments[ i ];\n* }\n* return s;\n* }\n*\n* var bar = naryFunction( foo, 2 );\n*\n* var out = bar( 1, 2, 3, 4, 5, 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\n\n\n// MAIN //\n\n/**\n* Adds a callback to the \"next tick queue\".\n*\n* ## Notes\n*\n* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.\n*\n* @param {Callback} clbk - callback\n* @param {...*} [args] - arguments to provide to the callback upon invocation\n*\n* @example\n* function beep() {\n* console.log( 'boop' );\n* }\n*\n* nextTick( beep );\n*/\nfunction nextTick( clbk ) {\n\tvar args;\n\tvar i;\n\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\tproc.nextTick( wrapper );\n\n\t/**\n\t* Callback wrapper.\n\t*\n\t* ## Notes\n\t*\n\t* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.\n\t*\n\t* @private\n\t*/\n\tfunction wrapper() {\n\t\tclbk.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = nextTick;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a callback to the \"next tick queue\".\n*\n* @module @stdlib/utils/next-tick\n*\n* @example\n* var nextTick = require( '@stdlib/utils/next-tick' );\n*\n* function beep() {\n* console.log( 'boop' );\n* }\n*\n* nextTick( beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection are falsy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether all elements are falsy\n*\n* @example\n* var arr = [ 0, 0, 0, 0, 0 ];\n*\n* var bool = none( arr );\n* // returns true\n*/\nfunction none( collection ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( collection[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = none;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection are falsy.\n*\n* @module @stdlib/utils/none\n*\n* @example\n* var none = require( '@stdlib/utils/none' );\n*\n* var arr = [ 0, 0, 0, 0, 0 ];\n*\n* var bool = none( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\nfunction noneBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils/none-by\n*\n* @example\n* var none = require( '@stdlib/utils/none-by' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `noneBy` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `noneBy()`, `[].push()` behavior is consistent with `noneByRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneByRight( arr, isPositive );\n* // returns true\n*/\nfunction noneByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/none-by-right\n*\n* @example\n* var noneByRight = require( '@stdlib/utils/none-by-right' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneByRight( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isNonEnumerable = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable property names and symbols\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* obj.a = 'a';\n* defineProperty( obj, 'b', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'b'\n* });\n*\n* var props = nonEnumerableProperties( obj );\n* // returns [ 'b' ]\n*/\nfunction nonEnumerableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar n;\n\tvar i;\n\n\tout = propertyNames( value );\n\tn = 0;\n\tfor ( i = 0; i < out.length; i++ ) {\n\t\tif ( isNonEnumerable( value, out[ i ] ) ) {\n\t\t\tout[ n ] = out[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tout.length = n;\n\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isNonEnumerable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/nonenumerable-properties\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' );\n*\n* var obj = {};\n*\n* obj.a = 'a';\n* defineProperty( obj, 'b', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'b'\n* });\n*\n* var props = nonEnumerableProperties( obj );\n* // returns [ 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isNonEnumerable = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable property names and symbols\n*\n* @example\n* var props = nonEnumerablePropertiesIn( [] );\n* // returns [...]\n*/\nfunction nonEnumerablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting non-enumerable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisNonEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisNonEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/nonenumerable-properties-in\n*\n* @example\n* var nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' );\n*\n* var props = nonEnumerablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNames( obj );\n* // returns [ 'beep' ]\n*/\nfunction nonEnumerablePropertyNames( value ) { // eslint-disable-line id-length\n\tvar names;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tnames = getOwnPropertyNames( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tif ( isNonEnumerableProperty( value, names[ i ] ) ) {\n\t\t\tnames[ n ] = names[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tnames.length = n;\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable property names.\n*\n* @module @stdlib/utils/nonenumerable-property-names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNames( obj );\n* // returns [ 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNamesIn( obj );\n* // e.g., returns [ 'beep', ... ]\n*/\nfunction nonEnumerablePropertyNamesIn( value ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting non-enumerable property names...\n\tnames = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable property names.\n*\n* @module @stdlib/utils/nonenumerable-property-names-in\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNamesIn( obj );\n* // e.g., returns [ 'beep', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable symbol properties\n*\n* @example\n* var symbols = nonEnumerablePropertySymbols( {} );\n*/\nfunction nonEnumerablePropertySymbols( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isNonEnumerableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable symbol properties.\n*\n* @module @stdlib/utils/nonenumerable-property-symbols\n*\n* @example\n* var nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' );\n*\n* var symbols = nonEnumerablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable symbol properties\n*\n* @example\n* var symbols = nonEnumerablePropertySymbolsIn( {} );\n*/\nfunction nonEnumerablePropertySymbolsIn( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all non-enumerable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable symbol properties.\n*\n* @module @stdlib/utils/nonenumerable-property-symbols-in\n*\n* @example\n* var nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' );\n*\n* var symbols = nonEnumerablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\n\n\n// VARIABLES //\n\nvar RE_INTEGER_INDEX = /^[0-9]+$/;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names which are not integer indices.\n*\n* @param {ObjectLike} obj - input object\n* @returns {Array} key array\n*\n* @example\n* function Foo() {\n* this[ 0 ] = 3.14;\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = nonIndexKeys( obj );\n* // e.g., returns [ 'beep' ]\n*/\nfunction nonIndexKeys( obj ) {\n\tvar keys;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tN = len;\n\tj = 0;\n\n\t// Compress the list of keys by using a lagging index and moving non-integer indices to earlier positions in the array...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( RE_INTEGER_INDEX.test( keys[ i ] ) ) {\n\t\t\tN -= 1;\n\t\t} else {\n\t\t\tkeys[ j ] = keys[ i ];\n\t\t\tj += 1;\n\t\t}\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonIndexKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names which are not integer indices.\n*\n* @module @stdlib/utils/nonindex-keys\n*\n* @example\n* var nonIndexKeys = require( '@stdlib/utils/nonindex-keys' );\n*\n* function Foo() {\n* this[ 0 ] = 3.14;\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = nonIndexKeys( obj );\n* // e.g., returns [ 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must an an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invert;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invert an object, such that keys become values and values become keys.\n*\n* @module @stdlib/utils/object-inverse\n*\n* @example\n* var invert = require( '@stdlib/utils/object-inverse' );\n*\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys, according to a transform function.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} options argument must an an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* function transform( key, value ) {\n* return key + value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'abeep': 'a', 'bboop': 'b' }\n*\n* @example\n* function transform( key, value ) {\n* return value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'beep'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* function transform( key, value ) {\n* return value;\n* }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var opts = {\n* 'duplicates': false\n* };\n* var out = invertBy( obj, opts, transform );\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invertBy( obj, opts, transform ) {\n\tvar allowDupes;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar cb;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tallowDupes = true;\n\tif ( arguments.length === 2 ) {\n\t\tcb = opts;\n\t} else {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t\tcb = transform;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = cb( key, obj[ key ], obj );\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = cb( key, obj[ key ], obj );\n\t\t\tout[ val ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invertBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invert an object, such that keys become values and values become keys, according to a transform function.\n*\n* @module @stdlib/utils/object-inverse-by\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return key + value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'abeep': 'a', 'bboop': 'b' }\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'beep'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return value;\n* }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var opts = {\n* 'duplicates': false\n* };\n* var out = invertBy( obj, opts, transform );\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy excluding specified keys.\n*\n* @param {Object} obj - source object\n* @param {(string|StringArray)} keys - keys to exclude\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be either a string or an array of strings\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omit( obj1, 'b' );\n* // returns { 'a': 1 }\n*/\nfunction omit( obj, keys ) {\n\tvar ownKeys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\townKeys = objectKeys( obj );\n\tout = {};\n\tif ( isString( keys ) ) {\n\t\tfor ( i = 0; i < ownKeys.length; i++ ) {\n\t\t\tkey = ownKeys[ i ];\n\t\t\tif ( key !== keys ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tif ( isStringArray( keys ) ) {\n\t\tfor ( i = 0; i < ownKeys.length; i++ ) {\n\t\t\tkey = ownKeys[ i ];\n\t\t\tif ( indexOf( keys, key ) === -1 ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be either a string or an array of strings. Value: `%s`.', keys ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = omit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy excluding specified keys.\n*\n* @module @stdlib/utils/omit\n*\n* @example\n* var omit = require( '@stdlib/utils/omit' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omit( obj1, 'b' );\n* // returns { 'a': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy excluding properties for which a predicate returns a truthy value.\n*\n* @param {Object} obj - source object\n* @param {Function} predicate - predicate function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omitBy( obj1, predicate );\n* // returns { 'a': 1 }\n*/\nfunction omitBy( obj, predicate ) {\n\tvar keys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tout = {};\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tif ( !predicate( key, obj[ key ] ) ) {\n\t\t\tout[ key ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = omitBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy excluding properties for which a predicate (function) returns a truthy value.\n*\n* @module @stdlib/utils/omit-by\n*\n* @example\n* var omitBy = require( '@stdlib/utils/omit-by' );\n*\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omitBy( obj1, predicate );\n* // returns { 'a': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar spawn = require( 'child_process' ).spawn;\nvar IS_WINDOWS = require( '@stdlib/assert/is-windows' );\nvar IS_DARWIN = require( '@stdlib/assert/is-darwin' );\nvar format = require( '@stdlib/string/format' );\nvar isURI = require( '@stdlib/assert/is-uri' );\n\n\n// VARIABLES //\n\nvar ARGS;\nvar CMD;\n\n// Mac:\nif ( IS_DARWIN ) {\n\tCMD = 'open';\n\tARGS = [];\n}\n// On Windows, ideally, we would use the `start` command; however, the rules regarding argument spacing and escaping are complex. Instead, we can use `cmd /c` which has built-in logic to address these rules.\nelse if ( IS_WINDOWS ) {\n\tCMD = 'cmd';\n\n\t// `cmd /c` interprets double-quoted first parameters as window titles. To work around this, we explicitly provide an empty string for the window title.\n\tARGS = [ '/c', 'start', '\"\"' ];\n}\n// All other `*nix` flavors:\nelse {\n\tCMD = 'xdg-open';\n\tARGS = [];\n}\n\n\n// MAIN //\n\n/**\n* Opens a URL.\n*\n* @param {string} url - URL to open\n* @throws {TypeError} must provide a valid URI\n* @returns {Process} spawned process (unreferenced)\n*\n* @example\n* var proc = openURL( 'https://google.com' );\n*/\nfunction openURL( url ) {\n\tvar args;\n\tvar proc;\n\tvar i;\n\tif ( !isURI( url ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a valid URI. Value: `%s`.', url ) );\n\t}\n\targs = new Array( ARGS.length );\n\tfor ( i = 0; i < ARGS.length; i++ ) {\n\t\targs[ i ] = ARGS[ i ];\n\t}\n\tif ( IS_WINDOWS ) {\n\t\t// `&` characters must be escaped when passed to `start`:\n\t\turl = url.replace( /&/g, '^&' );\n\t}\n\targs.push( url );\n\n\t// Spawn a child process to open the URL:\n\tproc = spawn( CMD, args, {} );\n\n\t// To prevent the parent process waiting on the child process, we unreference the process to remove it from the parent's reference count:\n\tproc.unref();\n\n\treturn proc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = openURL;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Open a URL.\n*\n* @module @stdlib/utils/open-url\n*\n* @example\n* var openURL = require( '@stdlib/utils/open-url' );\n*\n* var proc = openURL( 'https://google.com' );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function of smaller arity by partially applying arguments.\n*\n* @param {Function} fcn - function to partially apply\n* @param {...*} [args] - arguments to partially apply\n* @throws {TypeError} first argument must be a function\n* @returns {Function} partially applied function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var add2 = papply( add, 2 );\n*\n* var sum = add2( 3 );\n* // returns 5\n*/\nfunction papply( fcn ) {\n\tvar pargs;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tpargs = new Array( arguments.length-1 );\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\tpargs[ i-1 ] = arguments[ i ];\n\t}\n\treturn papplied;\n\n\t/**\n\t* Partially applied function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*} partially applied function result\n\t*/\n\tfunction papplied() {\n\t\tvar args;\n\t\tvar j;\n\t\targs = pargs.slice();\n\t\tfor ( j = 0; j < arguments.length; j++ ) {\n\t\t\targs.push( arguments[ j ] );\n\t\t}\n\t\treturn fcn.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = papply;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Partially apply function arguments.\n*\n* @module @stdlib/utils/papply\n*\n* @example\n* var papply = require( '@stdlib/utils/papply' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var add2 = papply( add, 2 );\n*\n* var sum = add2( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function of smaller arity by partially applying arguments from the right.\n*\n* @param {Function} fcn - function to partially apply\n* @param {...*} [args] - arguments to partially apply\n* @throws {TypeError} first argument must be a function\n* @returns {Function} partially applied function\n*\n* @example\n* function say( text, name ) {\n* return text + ', ' + name + '.';\n* }\n*\n* var toGrace = papplyRight( say, 'Grace Hopper' );\n*\n* var str = toGrace( 'Hello' );\n* // returns 'Hello, Grace Hopper.'\n*\n* str = toGrace( 'Thank you' );\n* // returns 'Thank you, Grace Hopper.'\n*/\nfunction papplyRight( fcn ) {\n\tvar pargs;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = arguments.length - 1;\n\tpargs = new Array( len );\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\tpargs[ i-1 ] = arguments[ i ];\n\t}\n\treturn pappliedRight;\n\n\t/**\n\t* Partially applied function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*} partially applied function result\n\t*/\n\tfunction pappliedRight() {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar j;\n\t\tnargs = arguments.length;\n\t\targs = new Array( len+nargs );\n\t\tfor ( j = 0; j < args.length; j++ ) {\n\t\t\tif ( j >= nargs ) {\n\t\t\t\targs[ j ] = pargs[ j-nargs ];\n\t\t\t} else {\n\t\t\t\targs[ j ] = arguments[ j ];\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = papplyRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Partially apply function arguments from the right.\n*\n* @module @stdlib/utils/papply-right\n*\n* @example\n* var papplyRight = require( '@stdlib/utils/papply-right' );\n*\n* function say( text, name ) {\n* return text + ', ' + name + '.';\n* }\n*\n* var toGrace = papplyRight( say, 'Grace Hopper' );\n*\n* var str = toGrace( 'Hello' );\n* // returns 'Hello, Grace Hopper.'\n*\n* str = toGrace( 'Thank you' );\n* // returns 'Thank you, Grace Hopper.'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numCPUs = require( '@stdlib/os/num-cpus' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Number of workers:\n\t\t'workers': numCPUs - 1,\n\n\t\t// Number of scripts to execute concurrently:\n\t\t'concurrency': numCPUs - 1,\n\n\t\t// Executable file/command:\n\t\t'cmd': 'node',\n\n\t\t// Boolean indicating whether script output can be interleaved or must be ordered:\n\t\t'ordered': false,\n\n\t\t// Process user identity:\n\t\t'uid': null,\n\n\t\t// Process group identity:\n\t\t'gid': null,\n\n\t\t// `stdio` encoding:\n\t\t'encoding': 'buffer',\n\n\t\t// Max child process `stdio` buffer size:\n\t\t'maxBuffer': 200 * 1024 * 1024 // bytes\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {string} [options.cmd] - executable file/command\n* @param {PositiveInteger} [options.concurrency] - number of scripts to execute concurrently\n* @param {PositiveInteger} [options.workers] - number of workers\n* @param {boolean} [options.ordered] - boolean indicating whether to preserve the order of script output\n* @param {NonNegativeInteger} [options.uid] - process user identity\n* @param {NonNegativeInteger} [options.gid] - process group identity\n* @param {NonNegativeInteger} [options.maxBuffer] - max child process `stdio` buffer size\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'concurrency': 4,\n* 'workers': 2\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'concurrency' ) ) {\n\t\topts.concurrency = options.concurrency;\n\t\tif ( !isPositiveInteger( opts.concurrency ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'concurrency', opts.concurrency ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'workers' ) ) {\n\t\topts.workers = options.workers;\n\t\tif ( !isPositiveInteger( opts.workers ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'workers', opts.workers ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'cmd' ) ) {\n\t\topts.cmd = options.cmd;\n\t\tif ( !isString( opts.cmd ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'cmd', opts.cmd ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'ordered' ) ) {\n\t\topts.ordered = options.ordered;\n\t\tif ( !isBoolean( opts.ordered ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'ordered', opts.ordered ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'uid' ) ) {\n\t\topts.uid = options.uid;\n\t\tif ( !isNonNegativeInteger( opts.uid ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'uid', opts.uid ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'gid' ) ) {\n\t\topts.gid = options.gid;\n\t\tif ( !isNonNegativeInteger( opts.gid ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'gid', opts.gid ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'maxBuffer' ) ) {\n\t\topts.maxBuffer = options.maxBuffer;\n\t\tif ( !isNonNegativeInteger( opts.maxBuffer ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'maxBuffer', opts.maxBuffer ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../../keys' );\nvar ENV = require( '@stdlib/process/env' );\n\n\n// FUNCTIONS //\n\n/**\n* Copies `process.env`.\n*\n* ## Notes\n*\n* - This implementation accommodates `process.env` on older Node.js versions (<=v0.10.x), where `process.env` was object-like, but would show unexpected behavior when attempting to get own property descriptors.\n*\n* @private\n* @returns {Object} copy of `process.env`\n*/\nfunction copy() {\n\tvar keys;\n\tvar env;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( ENV );\n\tout = {};\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tenv = keys[ i ];\n\t\tout[ env ] = ENV[ env ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns worker environment variables.\n*\n* @private\n* @param {Options} opts - options\n* @param {string} opts.cmd - executable file/command\n* @param {boolean} opts.ordered - boolean indicating whether to preserve order of script output\n* @param {(NonNegativeInteger|null)} opts.uid - process user identity\n* @param {(NonNegativeInteger|null)} opts.gid - process group identity\n* @param {string} opts.encoding - `stdio` encoding\n* @param {NonNegativeInteger} opts.maxBuffer - max child process `stdio` buffer size\n* @returns {Object} environment variables\n*/\nfunction env( opts ) {\n\tvar out = copy();\n\n\tout.WORKER_CMD = opts.cmd;\n\tout.WORKER_ENCODING = opts.encoding;\n\tout.WORKER_MAX_BUFFER = opts.maxBuffer;\n\n\tif ( opts.ordered ) {\n\t\tout.WORKER_ORDERED = '1';\n\t}\n\tif ( opts.uid ) {\n\t\tout.WORKER_UID = opts.uid;\n\t}\n\tif ( opts.gid ) {\n\t\tout.WORKER_GID = opts.gid;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = env;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cwd = require( '@stdlib/process/cwd' );\nvar env = require( './env.js' );\n\n\n// MAIN //\n\n/**\n* Returns child process options.\n*\n* @private\n* @param {Options} options - worker options\n* @param {(NonNegativeInteger|null)} [options.uid] - process user identity\n* @param {(NonNegativeInteger|null)} [options.gid] - process group identity\n* @returns {Object} child process options\n*/\nfunction getOpts( options ) {\n\tvar opts = {\n\t\t'cwd': cwd(),\n\t\t'env': env( options ),\n\t\t'stdio': 'inherit' // Use stdio of parent process\n\t};\n\tif ( options.uid ) {\n\t\topts.uid = options.uid;\n\t}\n\tif ( options.gid ) {\n\t\topts.gid = options.gid;\n\t}\n\treturn opts;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOpts;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fork = require( 'child_process' ).fork;\nvar path = require( 'path' );\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\nvar format = require( '@stdlib/string/format' );\nvar getOpts = require( './options.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'parallel:exec' );\nvar WORKER_FILEPATH = path.resolve( __dirname, './worker/index.js' );\n\n\n// MAIN //\n\n/**\n* Executes scripts in parallel.\n*\n* @private\n* @param {StringArray} files - script absolute file paths\n* @param {Options} opts - options\n* @param {PositiveInteger} opts.concurrency - number of scripts to execute concurrently\n* @param {PositiveInteger} opts.workers - number of workers\n* @param {string} opts.cmd - executable file/command\n* @param {boolean} opts.ordered - boolean indicating whether to preserve order of script output\n* @param {(NonNegativeInteger|null)} opts.uid - process user identity\n* @param {(NonNegativeInteger|null)} opts.gid - process group identity\n* @param {string} opts.encoding - `stdio` encoding\n* @param {NonNegativeInteger} opts.maxBuffer - max child process `stdio` buffer size\n* @param {Callback} clbk - callback to invoke after executing all scripts\n*/\nfunction exec( files, opts, clbk ) {\n\tvar numClosed;\n\tvar workers;\n\tvar pending;\n\tvar fopts;\n\tvar args;\n\tvar proc;\n\tvar pids;\n\tvar pid;\n\tvar idx;\n\tvar err;\n\tvar i;\n\n\tdebug( 'Options: %s.', JSON.stringify( opts ) );\n\tnumClosed = 0;\n\n\tdebug( 'Creating %d workers...', opts.workers );\n\tworkers = {};\n\targs = [];\n\tfopts = getOpts( opts );\n\tfor ( i = 0; i < opts.workers; i++ ) {\n\t\tdebug( 'Creating child process...' );\n\t\tproc = fork( WORKER_FILEPATH, args, fopts );\n\n\t\tproc.on( 'error', onError( proc ) );\n\t\tproc.on( 'close', onClose( proc ) );\n\t\tproc.on( 'exit', onExit( proc ) );\n\t\tproc.on( 'disconnect', onDisconnect( proc ) );\n\t\tproc.on( 'message', onMessage( proc ) );\n\n\t\tdebug( 'Child process created. pid: %d.', proc.pid );\n\t\tworkers[ proc.pid ] = proc;\n\t}\n\tpids = objectKeys( workers );\n\tdebug( '%d workers created.', pids.length );\n\n\tdebug( 'Running %d scripts concurrently...', opts.concurrency );\n\tpending = {};\n\tidx = -1;\n\tfor ( i = 0; i < opts.concurrency; i++ ) {\n\t\tpid = pids[ i%pids.length ];\n\t\tnext( workers[ pid ] ); // eslint-disable-line node/callback-return\n\t}\n\n\t/**\n\t* Instructs a child process to run the next script.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {void}\n\t*/\n\tfunction next( child ) {\n\t\tvar numPending;\n\t\tidx += 1;\n\t\tif ( idx >= files.length ) {\n\t\t\tnumPending = objectKeys( pending ).length;\n\t\t\tif ( numPending > 0 ) {\n\t\t\t\tdebug( '%d scripts are pending.', numPending );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebug( 'All scripts have finished.' );\n\t\t\treturn close();\n\t\t}\n\t\tdebug( 'Instructing child process to run script: %s. pid: %d.', files[ idx ], child.pid );\n\t\tchild.send( files[ idx ] );\n\t\tpending[ files[ idx ] ] = true;\n\n\t\tdebug( '%d of %d scripts have been processed.', idx, files.length );\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon receiving a message from a child process.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onMessage( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon receiving a message from a child process.\n\t\t*\n\t\t* @private\n\t\t* @param {string} filepath - script filepath\n\t\t*/\n\t\tfunction listener( filepath ) {\n\t\t\tdebug( 'Child process message: %s. pid: %d.', filepath, child.pid );\n\n\t\t\t// Remove the script from the listing of pending scripts:\n\t\t\tdelete pending[ filepath ];\n\n\t\t\t// Indicate that the child process is ready for its next task:\n\t\t\tnext( child );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process close.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onClose( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process close.\n\t\t*\n\t\t* @private\n\t\t* @param {(number|null)} code - exit code\n\t\t* @param {(string|null)} signal - termination signal\n\t\t*/\n\t\tfunction listener( code, signal ) {\n\t\t\tdebug( 'Child process closed. Code: %d. Signal: %s. pid: %d.', code, signal, child.pid );\n\t\t\tprocessExit( code, signal );\n\t\t\tchildClosed();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked if a child closes.\n\t*\n\t* @private\n\t*/\n\tfunction childClosed() {\n\t\tnumClosed += 1;\n\t\tdebug( '%d of %d child processes have closed.', numClosed, opts.workers );\n\t\tif ( numClosed === opts.workers ) {\n\t\t\tdone(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process exit.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onExit( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process exit.\n\t\t*\n\t\t* @private\n\t\t* @param {(number|null)} code - exit code\n\t\t* @param {(string|null)} signal - termination signal\n\t\t*/\n\t\tfunction listener( code, signal ) {\n\t\t\tdebug( 'Child process exited. Code: %d. Signal: %s. pid: %d.', code, signal, child.pid );\n\t\t\tprocessExit( code, signal );\n\t\t}\n\t}\n\n\t/**\n\t* Closes all workers.\n\t*\n\t* @private\n\t* @param {Error} [error] - error object\n\t*/\n\tfunction close( error ) {\n\t\tvar pids;\n\t\tvar pid;\n\t\tvar i;\n\t\tif ( error && !err ) {\n\t\t\terr = error;\n\t\t}\n\t\tdebug( 'Instructing child processes to close...' );\n\t\tpids = objectKeys( workers );\n\t\tfor ( i = 0; i < pids.length; i++ ) {\n\t\t\tpid = pids[ i ];\n\t\t\tdebug( 'Instructing child process (pid: %d) to close...', pid );\n\t\t\tworkers[ pid ].send( 'close' );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process disconnect.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onDisconnect( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process disconnect.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction listener() {\n\t\t\tdebug( 'Child process disconnected. pid: %d.', child.pid );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon encountering a child process error.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onError( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon a child process error.\n\t\t*\n\t\t* @private\n\t\t* @param {Error} error - error object\n\t\t*/\n\t\tfunction listener( error ) {\n\t\t\tdebug( 'Child process error: %s. pid: %d.', error.message, child.pid );\n\t\t\tclose( error );\n\t\t}\n\t}\n\n\t/**\n\t* Processes process exit values. If provided a non-zero exit code or termination signal, instructs the process to close.\n\t*\n\t* @private\n\t* @param {(number|null)} code - exit code\n\t* @param {(string|null)} signal - termination signal\n\t* @returns {void}\n\t*/\n\tfunction processExit( code, signal ) {\n\t\tvar error;\n\t\tif ( err ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( code !== null && code !== 0 ) {\n\t\t\terror = new Error( format( 'unexpected error. Child process failed with exit code: `%u`.', code ) );\n\t\t} else if ( signal !== null ) {\n\t\t\terror = new Error( format( 'unexpected error. Child process failed due to termination signal: `%s`.', signal ) );\n\t\t}\n\t\tif ( error ) {\n\t\t\terror.code = code;\n\t\t\terror.signal = signal;\n\t\t\treturn close( error );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once all tasks are finished.\n\t*\n\t* @private\n\t* @returns {void}\n\t*/\n\tfunction done() {\n\t\tif ( err ) {\n\t\t\treturn clbk( err );\n\t\t}\n\t\tclbk();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = exec;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar exec = require( './exec.js' );\n\n\n// EXPORTS //\n\nmodule.exports = exec;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar path = require( 'path' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar cwd = require( '@stdlib/process/cwd' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar exec = require( './node' );\n\n\n// MAIN //\n\n/**\n* Executes scripts in parallel.\n*\n* @param {StringArray} files - script file paths\n* @param {Options} [options] - function options\n* @param {string} [options.cmd='node'] - executable file/command\n* @param {PositiveInteger} [options.concurrency] - number of scripts to execute concurrently\n* @param {PositiveInteger} [options.workers] - number of workers\n* @param {boolean} [options.ordered=false] - boolean indicating whether to preserve the order of script output\n* @param {NonNegativeInteger} [options.uid] - process user identity\n* @param {NonNegativeInteger} [options.gid] - process group identity\n* @param {NonNegativeInteger} [options.maxBuffer=200*1024*1024] - max child process `stdio` buffer size\n* @param {Callback} clbk - callback to invoke after executing all scripts\n* @throws {TypeError} first argument must be an array of strings\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} callback argument must be a function\n*\n* @example\n* var files = [ './a.js', './b.js ' ];\n*\n* var opts = {\n* 'workers': 3,\n* 'concurrency': 3\n* };\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* parallel( files, opts, done );\n*/\nfunction parallel() {\n\tvar options;\n\tvar files;\n\tvar opts;\n\tvar clbk;\n\tvar err;\n\tvar dir;\n\tvar i;\n\n\tfiles = arguments[ 0 ];\n\tif ( !isStringArray( files ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of strings. Value: `%s`.', files ) );\n\t}\n\tfiles = files.slice();\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\toptions = arguments[ 1 ];\n\t\tclbk = arguments[ 2 ];\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t} else {\n\t\tclbk = arguments[ 1 ];\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\t// Prevent the number of concurrent scripts exceeding the number of actual scripts to run.\n\tif ( opts.concurrency > files.length ) {\n\t\topts.concurrency = files.length;\n\t}\n\t// Prevent the number of workers exceeding the number of concurrent scripts (excess capacity), as some workers would never be allocated scripts to run and always be idle.\n\tif ( opts.workers > opts.concurrency ) {\n\t\topts.workers = opts.concurrency;\n\t}\n\t// Resolve any relative paths to absolute paths...\n\tdir = cwd();\n\tfor ( i = 0; i < files.length; i++ ) {\n\t\tfiles[ i ] = path.resolve( dir, files[ i ] );\n\t}\n\texec( files, opts, done );\n\n\t/**\n\t* Callback invoked after executing all scripts.\n\t*\n\t* @private\n\t* @param {Error} error - error object\n\t* @returns {void}\n\t*/\n\tfunction done( error ) {\n\t\tif ( error ) {\n\t\t\treturn clbk( error );\n\t\t}\n\t\tclbk();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = parallel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Execute scripts in parallel.\n*\n* @module @stdlib/utils/parallel\n*\n* @example\n* var parallel = require( '@stdlib/utils/parallel' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n* var files = [ './a.js', './b.js' ];\n* parallel( files, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Attempts to parse a string as JSON.\n*\n* @param {string} str - string to parse\n* @param {Function} [reviver] - transformation function\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} reviver must be a function\n* @returns {(*|Error)} parsed value or parse error\n*\n* @example\n* var obj = parseJSON( '{\"beep\":\"boop\"}' );\n* // returns {'beep':'boop'}\n*/\nfunction parseJSON( str, reviver ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isFunction( reviver ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Reviver argument must be a function. Value: `%s`.', reviver ) );\n\t\t}\n\t}\n\ttry {\n\t\treturn JSON.parse( str, reviver );\n\t} catch ( error ) {\n\t\treturn error;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = parseJSON;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Parse a string as JSON.\n*\n* @module @stdlib/utils/parse-json\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n*\n* var obj = parseJSON( '{\"beep\":\"boop\"}' );\n* // returns {'beep':'boop'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy containing only specified keys. If a key does not exist as an own property in a source object, the key is ignored.\n*\n* @param {Object} obj - source object\n* @param {(string|StringArray)} keys - keys to copy\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be either a string or an array of strings\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pick( obj1, 'b' );\n* // returns { 'b': 2 }\n*/\nfunction pick( obj, keys ) {\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tif ( isString( keys ) ) {\n\t\tif ( hasOwnProp( obj, keys ) ) {\n\t\t\tout[ keys ] = obj[ keys ];\n\t\t}\n\t\treturn out;\n\t}\n\tif ( isStringArray( keys ) ) {\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be either a string or an array of strings. Value: `%s`.', keys ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pick;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy containing only specified keys.\n*\n* @module @stdlib/utils/pick\n*\n* @example\n* var pick = require( '@stdlib/utils/pick' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pick( obj1, 'b' );\n* // returns { 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies specified arguments to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeIntegerArray} indices - argument indices\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of nonnegative integers\n* @returns {Function} function wrapper\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = pickArguments( foo, [ 0, 2 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction pickArguments( fcn, indices, thisArg ) {\n\tvar fcns;\n\tvar idx;\n\tvar v;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isCollection( indices ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object containing nonnegative integers. Value: `%s`.', indices ) );\n\t}\n\tidx = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tv = indices[ i ];\n\t\tif ( !isNonNegativeInteger( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object containing nonnegative integers. Value: `%s`.', indices ) );\n\t\t}\n\t\tidx.push( v );\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( idx.length < fcns.length ) ? fcns[ idx.length ] : nary;\n\n\t/**\n\t* Invokes a nullary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ] );\n\t}\n\n\t/**\n\t* Invokes a binary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ] );\n\t}\n\n\t/**\n\t* Invokes a ternary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quaternary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quinary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ], arguments[ idx[4] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes an n-ary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ idx[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = pickArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies specified arguments to a provided function.\n*\n* @module @stdlib/utils/pick-arguments\n*\n* @example\n* var pickArguments = require( '@stdlib/utils/pick-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = pickArguments( foo, [ 0, 2 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy containing properties for which a predicate returns a truthy value.\n*\n* @param {Object} obj - source object\n* @param {Function} predicate - predicate function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pickBy( obj1, predicate );\n* // returns { 'b': 2 }\n*/\nfunction pickBy( obj, predicate ) {\n\tvar keys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tout = {};\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tif ( predicate( key, obj[ key ] ) ) {\n\t\t\tout[ key ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pickBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy containing properties for which a predicate (function) returns a truthy value.\n*\n* @module @stdlib/utils/pick-by\n*\n* @example\n* var pickBy = require( '@stdlib/utils/pick-by' );\n*\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pickBy( obj1, predicate );\n* // returns { 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'copy': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {boolean} [options.copy] - boolean indicating whether to return a new data structure\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Extracts a property value from each element of an object array.\n*\n* @param {Array} arr - source array\n* @param {*} prop - property to access\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=true] - boolean indicating whether to return a new data structure\n* @throws {TypeError} first argument must be an object array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} destination array\n*\n* @example\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a' );\n* // returns [ 1, 0.5 ]\n*\n* @example\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a', {'copy':false} );\n* // returns [ 1, 0.5 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*/\nfunction pluck( arr, prop, options ) {\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar v;\n\tvar i;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array. Value: `%s`.', arr ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.copy ) {\n\t\tout = new Array( arr.length );\n\t} else {\n\t\tout = arr;\n\t}\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tv = arr[ i ];\n\t\tif (\n\t\t\tv !== void 0 &&\n\t\t\tv !== null &&\n\t\t\thasOwnProp( v, prop )\n\t\t) {\n\t\t\tout[ i ] = v[ prop ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pluck;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Extract a property value from each element of an object array.\n*\n* @module @stdlib/utils/pluck\n*\n* @example\n* var pluck = require( '@stdlib/utils/pluck' );\n*\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a' );\n* // returns [ 1, 0.5 ]\n*\n* arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* out = pluck( arr, 'a', {'copy':false} );\n* // returns [ 1, 0.5 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the last element of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @returns {Array} input object and the removed element\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* var out = pop( obj );\n* // returns [ { 'length': 1, '0': 1.0 }, 2.0 ]\n*/\nfunction pop( obj ) {\n\tvar len;\n\tvar v;\n\tif ( obj.length === 0 ) {\n\t\treturn [ obj, void 0 ];\n\t}\n\tlen = obj.length - 1;\n\tv = obj[ len ];\n\tdelete obj[ len ];\n\tobj.length = len;\n\treturn [ obj, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the last element of a typed array.\n*\n* @private\n* @param {TypedArray} arr - input array\n* @returns {Array} input array and the removed element\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\nfunction pop( arr ) {\n\tvar view;\n\tvar len;\n\tvar v;\n\tif ( arr.length === 0 ) {\n\t\treturn [ arr, void 0 ];\n\t}\n\tlen = arr.length - 1;\n\tv = arr[ len ];\n\tview = new arr.constructor( arr.buffer, arr.byteOffset, len );\n\treturn [ view, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar popObject = require( './pop_object.js' );\nvar popTypedArray = require( './pop_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Removes and returns the last element of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {Array} updated collection and the removed element\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\nfunction pop( collection ) {\n\tvar v;\n\tif ( isArray( collection ) ) {\n\t\tv = collection.pop();\n\t\treturn [ collection, v ];\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn popTypedArray( collection );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn popObject( collection );\n\t}\n\tthrow new TypeError( format( 'invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Remove and return the last element of a collection.\n*\n* @module @stdlib/utils/pop\n*\n* @example\n* var pop = require( '@stdlib/utils/pop' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* out = pop( arr )\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = prepend( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction prepend( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar prependArray = require( './prepend_array.js' );\nvar prependObject = require( './prepend_object.js' );\nvar prependTypedArray = require( './prepend_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the beginning of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn prependArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn prependTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn prependObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add the elements of one collection to the beginning of another collection.\n*\n* @module @stdlib/utils/prepend\n*\n* @example\n* var prepend = require( '@stdlib/utils/prepend' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = properties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction properties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tout = propertyNames( value );\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tout.push( tmp[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = properties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable and non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/properties\n*\n* @example\n* var properties = require( '@stdlib/utils/properties' );\n*\n* var props = properties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own or inherited property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = propertyDescriptorIn( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction propertyDescriptorIn( value, property ) {\n\tvar desc;\n\tvar obj;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain in search of a specified property...\n\tdo {\n\t\tdesc = getOwnPropertyDescriptor( obj, property );\n\t\tif ( desc ) {\n\t\t\treturn desc;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyDescriptorIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's own or inherited property.\n*\n* @module @stdlib/utils/property-descriptor-in\n*\n* @example\n* var propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var desc = propertyDescriptorIn( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyDescriptors = require( './../../property-descriptors' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an object's own and inherited property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Object} own and inherited property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = propertyDescriptorsIn( obj );\n* // returns { 'beep': {...}, 'foo': {...}, ... }\n*/\nfunction propertyDescriptorsIn( value ) {\n\tvar desc;\n\tvar keys;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn {};\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all property descriptors...\n\tdesc = {};\n\tdo {\n\t\ttmp = getOwnPropertyDescriptors( obj );\n\t\tkeys = objectKeys( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a property name always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tkeys = getOwnPropertySymbols( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a symbol property always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyDescriptorsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's own and inherited property descriptors.\n*\n* @module @stdlib/utils/property-descriptors-in\n*\n* @example\n* var propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' );\n*\n* var desc = propertyDescriptorsIn({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // returns { 'foo': {...}, 'beep': {...}, ... }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = propertyNamesIn( obj );\n* // e.g., returns [ 'beep', 'foo', ... ]\n*/\nfunction propertyNamesIn( value ) {\n\tvar names;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all enumerable and non-enumerable property names...\n\tnames = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( names, tmp[ i ] ) === false ) {\n\t\t\t\tnames.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/property-names-in\n*\n* @example\n* var propertyNamesIn = require( '@stdlib/utils/property-names-in' );\n*\n* var keys = propertyNamesIn({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited symbol properties\n*\n* @example\n* var symbols = propertySymbolsIn( [] );\n*/\nfunction propertySymbolsIn( value ) {\n\tvar symbols;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all symbol properties...\n\tsymbols = [];\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( symbols, tmp[ i ] ) === false ) {\n\t\t\t\tsymbols.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited symbol properties.\n*\n* @module @stdlib/utils/property-symbols-in\n*\n* @example\n* var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' );\n*\n* var symbols = propertySymbolsIn( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {Array} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( arr, items ) {\n\tvar i;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tarr.push( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {Array} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = push( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 1.0, '1': 2.0, '2': 3.0, '3': 4.0 }\n*/\nfunction push( obj, items ) {\n\tvar len;\n\tvar i;\n\tlen = obj.length;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tobj[ len+i ] = items[ i ];\n\t}\n\tobj.length = len + items.length;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is followed by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {Array} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\ttotal = nbytes + ibytes + arr.byteOffset;\n\n\tif ( arr.buffer.byteLength < total ) {\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\tv = new arr.constructor( buf, 0, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i ] = arr[ i ];\n\t\t}\n\t} else {\n\t\tv = new arr.constructor( arr.buffer, arr.byteOffset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ len+i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar pushArray = require( './push_array.js' );\nvar pushObject = require( './push_object.js' );\nvar pushTypedArray = require( './push_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @param {...*} items - items to add\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {(Array|TypedArray|Object)} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( collection ) {\n\tvar items;\n\tvar i;\n\titems = [];\n\tfor ( i = 0; i < arguments.length-1; i++ ) {\n\t\titems.push( arguments[ i+1 ] );\n\t}\n\tif ( isArray( collection ) ) {\n\t\treturn pushArray( collection, items );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn pushTypedArray( collection, items );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn pushObject( collection, items );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add one or more elements to the end of a collection.\n*\n* @module @stdlib/utils/push\n*\n* @example\n* var push = require( '@stdlib/utils/push' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 )\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/max' );\nvar FLOAT32 = require( '@stdlib/constants/float32/max' );\nvar FLOAT64 = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum finite value capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} maximum finite value\n*\n* @example\n* var m = realmax( 'float64' );\n* // returns 1.7976931348623157e+308\n*\n* @example\n* var m = realmax( 'float16' );\n* // returns 65504.0\n*\n* @example\n* var m = realmax( 'float32' );\n* // returns 3.4028234663852886e+38\n*/\nfunction realmax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = realmax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum finite value capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/real-max\n*\n* @example\n* var realmax = require( '@stdlib/utils/real-max' );\n*\n* var m = realmax( 'float64' );\n* // returns 1.7976931348623157e+308\n*\n* m = realmax( 'float16' );\n* // returns 65504.0\n*\n* m = realmax( 'float32' );\n* // returns 3.4028234663852886e+38\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/smallest-normal' );\nvar FLOAT32 = require( '@stdlib/constants/float32/smallest-normal' );\nvar FLOAT64 = require( '@stdlib/constants/float64/smallest-normal' );\n\n\n// MAIN //\n\n/**\n* Returns the smallest positive normal value capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} smallest positive normal value\n*\n* @example\n* var m = realmin( 'float64' );\n* // returns 2.2250738585072014e-308\n*\n* @example\n* var m = realmin( 'float16' );\n* // returns 0.00006103515625\n*\n* @example\n* var m = realmin( 'float32' );\n* // returns 1.1754943508222875e-38\n*/\nfunction realmin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = realmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the smallest positive normal value capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/real-min\n*\n* @example\n* var realmin = require( '@stdlib/utils/real-min' );\n*\n* var m = realmin( 'float64' );\n* // returns 2.2250738585072014e-308\n*\n* m = realmin( 'float16' );\n* // returns 0.00006103515625\n*\n* m = realmin( 'float32' );\n* // returns 1.1754943508222875e-38\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = reduce( x, new Complex64( 0.0, 0.0 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 16.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction reduce( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn fcn.call( thisArg, initial, get( xbuf, ox ), 0, ref );\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, ix ), i, ref );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum:\n* var out = reduce( x, 0, sum );\n* // returns 10\n*/\nfunction reduce( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, i ), i, xbuf );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduce( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduce( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction reduce( arr, initial, reducer, thisArg ) {\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, reducer, thisArg );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in an array and return the accumulated result.\n*\n* @module @stdlib/utils/reduce\n*\n* @example\n* var reduce = require( '@stdlib/utils/reduce' );\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduce( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var reduce = require( '@stdlib/utils/reduce' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduce( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = reduceRight( x, new Complex64( 0.0, 0.0 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 16.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction reduceRight( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn fcn.call( thisArg, initial, get( xbuf, ox ), 0, ref );\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, ix ), i, ref );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum:\n* var out = reduceRight( x, 0, sum );\n* // returns 10\n*/\nfunction reduceRight( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, i ), i, xbuf );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduceRight( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduceRight( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction reduceRight( arr, initial, reducer, thisArg ) {\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, reducer, thisArg );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in an array while iterating from right to left and return the accumulated result.\n*\n* @module @stdlib/utils/reduce-right\n*\n* @example\n* var reduceRight = require( '@stdlib/utils/reduce-right' );\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduceRight( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var reduceRight = require( '@stdlib/utils/reduce-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduceRight( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Reduces the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and returning the accumulation results as a one-dimensional array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - array of arrays\n* @param {ArrayLikeObject} initial - initial values\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array of arrays\n* @throws {TypeError} second argument must be an array-like object\n* @throws {RangeError} second argument must have a length equal to the size of the outermost input array dimension\n* @throws {TypeError} third argument must be a function\n* @returns {Array} results\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var arr = [\n* [ 1, 2, 3 ],\n* [ 4, 5, 6 ]\n* ];\n*\n* var out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) );\n* // returns [ 6, 15 ]\n*/\nfunction reduce2d( arr, initial, reducer, thisArg ) {\n\tvar out;\n\tvar acc;\n\tvar M;\n\tvar N;\n\tvar a;\n\tvar i;\n\tvar j;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isArrayLikeObject( initial ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', initial ) );\n\t}\n\tif ( initial.length !== arr.length ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must have a length equal to the size of the outermost input array dimension.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tM = arr.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\ta = arr[ i ];\n\t\tif ( !isCollection( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object containing array-like objects. Index: `%u`. Value: `%s`.', i, a ) );\n\t\t}\n\t\tN = a.length;\n\t\tacc = initial[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tacc = reducer.call( thisArg, acc, a[ j ], [ i, j ], arr );\n\t\t}\n\t\tout.push( acc );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reduce the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and return the accumulation results as a one-dimensional array.\n*\n* @module @stdlib/utils/reduce2d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var reduce2d = require( '@stdlib/utils/reduce2d' );\n*\n* var arr = [\n* [ 1, 2, 3 ],\n* [ 4, 5, 6 ]\n* ];\n*\n* var out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) );\n* // returns [ 6, 15 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a predicate function.\n*\n* ## Notes\n*\n- The predicate function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* - Only those arguments in which the predicate function returns a falsy value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v === 2 );\n* }\n*\n* var bar = rejectArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction rejectArguments( fcn, predicate, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function according to a predicate function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar v;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( !predicate( v, i ) ) {\n\t\t\t\targs.push( v );\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = rejectArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a predicate function.\n*\n* @module @stdlib/utils/reject-arguments\n*\n* @example\n* var rejectArguments = require( '@stdlib/utils/reject-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v === 2 );\n* }\n*\n* var bar = rejectArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that invokes a provided function with reordered arguments.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeIntegerArray} indices - argument indices\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of nonnegative integers\n* @returns {Function} function with reordered arguments\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 1, 2 ]\n*/\nfunction reorderArguments( fcn, indices, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeIntegerArray( indices ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array containing only nonnegative integers. Value: `%s`.', indices ) );\n\t}\n\treturn reordered;\n\n\t/**\n\t* Invokes a function with reordered arguments.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} must provide expected number of input arguments\n\t* @returns {*} return value\n\t*/\n\tfunction reordered() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\tif ( len !== indices.length ) {\n\t\t\tthrow new Error( format( 'invalid invocation. Unexpected number of input arguments. Expected: `%u`. Actual: `%u`.', indices.length, len ) );\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs.push( arguments[ indices[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = reorderArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function that invokes a provided function with reordered arguments.\n*\n* @module @stdlib/utils/reorder-arguments\n*\n* @example\n* var reorderArguments = require( '@stdlib/utils/reorder-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 1, 2 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that invokes a provided function with arguments in reverse order.\n*\n* @param {Function} fcn - input function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @returns {Function} reverse arguments function\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reverseArguments( foo );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 2, 1 ]\n*/\nfunction reverseArguments( fcn, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\treturn reversed;\n\n\t/**\n\t* Invokes a function with arguments in reverse order.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction reversed() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ len-1-i ] = arguments[ i ];\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = reverseArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function that invokes a provided function with arguments in reverse order.\n*\n* @module @stdlib/utils/reverse-arguments\n*\n* @example\n* var reverseArguments = require( '@stdlib/utils/reverse-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reverseArguments( foo );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 2, 1 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/max-safe-integer' );\nvar FLOAT32 = require( '@stdlib/constants/float32/max-safe-integer' );\nvar FLOAT64 = require( '@stdlib/constants/float64/max-safe-integer' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum safe integer capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} maximum safe integer\n*\n* @example\n* var m = safeintmax( 'float64' );\n* // returns 9007199254740991\n*\n* @example\n* var m = safeintmax( 'float16' );\n* // returns 2047\n*\n* @example\n* var m = safeintmax( 'float32' );\n* // returns 16777215\n*/\nfunction safeintmax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeintmax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum safe integer capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/safe-int-max\n*\n* @example\n* var safeintmax = require( '@stdlib/utils/safe-int-max' );\n*\n* var m = safeintmax( 'float64' );\n* // returns 9007199254740991\n*\n* m = safeintmax( 'float16' );\n* // returns 2047\n*\n* m = safeintmax( 'float32' );\n* // returns 16777215\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/min-safe-integer' );\nvar FLOAT32 = require( '@stdlib/constants/float32/min-safe-integer' );\nvar FLOAT64 = require( '@stdlib/constants/float64/min-safe-integer' );\n\n\n// MAIN //\n\n/**\n* Returns the minimum safe integer capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} minimum safe integer\n*\n* @example\n* var m = safeintmin( 'float64' );\n* // returns -9007199254740991\n*\n* @example\n* var m = safeintmin( 'float16' );\n* // returns -2047\n*\n* @example\n* var m = safeintmin( 'float32' );\n* // returns -16777215\n*/\nfunction safeintmin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeintmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum safe integer capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/safe-int-min\n*\n* @example\n* var safeintmin = require( '@stdlib/utils/safe-int-min' );\n*\n* var m = safeintmin( 'float64' );\n* // returns -9007199254740991\n*\n* m = safeintmin( 'float16' );\n* // returns -2047\n*\n* m = safeintmin( 'float32' );\n* // returns -16777215\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the first element of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @returns {Array} input object and the removed element\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* var out = shift( obj );\n* // returns [ { 'length': 1, '0': 2.0 }, 1.0 ]\n*/\nfunction shift( obj ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( obj.length === 0 ) {\n\t\treturn [ obj, void 0 ];\n\t}\n\tlen = obj.length - 1;\n\tv = obj[ 0 ];\n\n\t// Shift all elements down...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tobj[ i ] = obj[ i+1 ];\n\t}\n\tdelete obj[ len ];\n\tobj.length = len;\n\treturn [ obj, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the first element of a typed array.\n*\n* @private\n* @param {TypedArray} arr - input array\n* @returns {Array} input array and the removed element\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\nfunction shift( arr ) {\n\tvar offset;\n\tvar view;\n\tvar v;\n\tif ( arr.length === 0 ) {\n\t\treturn [ arr, void 0 ];\n\t}\n\tv = arr[ 0 ];\n\toffset = arr.byteOffset + arr.BYTES_PER_ELEMENT;\n\tview = new arr.constructor( arr.buffer, offset, arr.length-1 );\n\treturn [ view, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar shiftObject = require( './shift_object.js' );\nvar shiftTypedArray = require( './shift_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Removes and returns the first element of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {Array} updated collection and the removed element\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\nfunction shift( collection ) {\n\tvar v;\n\tif ( isArray( collection ) ) {\n\t\tv = collection.shift();\n\t\treturn [ collection, v ];\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn shiftTypedArray( collection );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn shiftObject( collection );\n\t}\n\tthrow new TypeError( format( 'invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Remove and return the first element of a collection.\n*\n* @module @stdlib/utils/shift\n*\n* @example\n* var shift = require( '@stdlib/utils/shift' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/num-bytes' );\nvar UINT8 = require( '@stdlib/constants/uint8/num-bytes' );\nvar INT16 = require( '@stdlib/constants/int16/num-bytes' );\nvar UINT16 = require( '@stdlib/constants/uint16/num-bytes' );\nvar INT32 = require( '@stdlib/constants/int32/num-bytes' );\nvar UINT32 = require( '@stdlib/constants/uint32/num-bytes' );\nvar FLOAT16 = require( '@stdlib/constants/float16/num-bytes' );\nvar FLOAT32 = require( '@stdlib/constants/float32/num-bytes' );\nvar FLOAT64 = require( '@stdlib/constants/float64/num-bytes' );\nvar COMPLEX64 = require( '@stdlib/constants/complex64/num-bytes' );\nvar COMPLEX128 = require( '@stdlib/constants/complex128/num-bytes' );\n\n\n// MAIN //\n\n/**\n* Returns the size (in bytes) of the canonical binary representation of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} size in bytes\n*\n* @example\n* var s = sizeOf( 'int8' );\n* // returns 1\n*\n* @example\n* var s = sizeOf( 'uint8' );\n* // returns 1\n*\n* @example\n* var s = sizeOf( 'int16' );\n* // returns 2\n*/\nfunction sizeOf( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'uint32':\n\t\treturn UINT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'uint8':\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn UINT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'uint16':\n\t\treturn UINT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tcase 'complex128':\n\t\treturn COMPLEX128;\n\tcase 'complex64':\n\t\treturn COMPLEX64;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sizeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the size (in bytes) of the canonical binary representation of a specified numeric type.\n*\n* @module @stdlib/utils/size-of\n*\n* @example\n* var sizeOf = require( '@stdlib/utils/size-of' );\n*\n* var s = sizeOf( 'int8' );\n* // returns 1\n*\n* s = sizeOf( 'uint8' );\n* // returns 1\n*\n* s = sizeOf( 'int16' );\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which are truthy.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which are truthy\n*\n* @example\n* var arr = [ 0, 0, 1, 2, 3 ];\n*\n* var bool = some( arr, 3 );\n* // returns true\n*/\nfunction some( collection, n ) {\n\tvar count;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( collection[ i ] ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = some;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which are truthy.\n*\n* @module @stdlib/utils/some\n*\n* @example\n* var some = require( '@stdlib/utils/some' );\n*\n* var arr = [ 0, 0, 1, 2, 3 ];\n*\n* var bool = some( arr, 3 );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} third argument must be a function\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which pass a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, -3, 4, -1 ];\n*\n* var bool = someBy( arr, 2, isNegative );\n* // returns true\n*/\nfunction someBy( collection, n, predicate, thisArg ) {\n\tvar count;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = someBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/some-by\n*\n* @example\n* var someBy = require( '@stdlib/utils/some-by' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, -3, 4, -1 ];\n*\n* var bool = someBy( arr, 2, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} third argument must be a function\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which pass a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, -2, 3, 4 ];\n*\n* var bool = someByRight( arr, 2, isNegative );\n* // returns true\n*/\nfunction someByRight( collection, n, predicate, thisArg ) {\n\tvar count;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/some-by-right\n*\n* @example\n* var someByRight = require( '@stdlib/utils/some-by-right' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, -2, 3, 4 ];\n*\n* var bool = someByRight( arr, 2, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\n\n\n// MAIN //\n\n/**\n* Stack constructor.\n*\n* @constructor\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nfunction Stack() {\n\tif ( !(this instanceof Stack) ) {\n\t\treturn new Stack();\n\t}\n\t// Use a dynamic array as insertion and deletion is O(1) amortized:\n\tthis._buffer = [];\n\treturn this;\n}\n\n/**\n* Clears the stack.\n*\n* @name clear\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the top value:\n* var v = s.first();\n* // returns 'bar'\n*\n* // Examine the stack length:\n* var len = s.length;\n* // returns 2\n*\n* // Clear all stack items:\n* s.clear();\n*\n* // Peek at the top value:\n* v = s.first();\n* // returns undefined\n*\n* // Examine the stack length:\n* len = s.length;\n* // returns 0\n*/\nsetReadOnly( Stack.prototype, 'clear', function clear() {\n\tthis._buffer.length = 0;\n\treturn this;\n});\n\n/**\n* Returns the top value (i.e., the value which is \"first-out\").\n*\n* @name first\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} top value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the top value:\n* var v = s.first();\n* // returns 'bar'\n*/\nsetReadOnly( Stack.prototype, 'first', function first() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer[ this._buffer.length-1 ];\n\t}\n});\n\n/**\n* Returns an iterator for iterating over a stack.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from stack mutation during iteration, a returned iterator **always** iterates over a stack \"snapshot\", which is defined as the list of stack elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = s.iterator();\n*\n* // Iterate over the stack...\n* var v = it.next().value;\n* // returns 'bar'\n*\n* v = it.next().value;\n* // returns 'foo'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Stack.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = this._buffer.length;\n\n\t// Create a copy of stack values (necessary in order to \"snapshot\" the stack; otherwise, values could come and go between calls to `next`):\n\tvalues = this._buffer.slice();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti -= 1;\n\t\tif ( FLG || i < 0 ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the bottom stack value (i.e., the value which is currently \"last-out\").\n*\n* @name last\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} bottom stack value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the bottom value:\n* var v = s.last();\n* // returns 'foo'\n*/\nsetReadOnly( Stack.prototype, 'last', function last() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer[ 0 ];\n\t}\n});\n\n/**\n* Stack length.\n*\n* @name length\n* @memberof Stack.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var s = new Stack();\n*\n* // Examine the initial stack length:\n* var len = s.length;\n* // returns 0\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current stack length:\n* len = s.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( Stack.prototype, 'length', function get() {\n\treturn this._buffer.length;\n});\n\n/**\n* Removes a value from the stack.\n*\n* @name pop\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nsetReadOnly( Stack.prototype, 'pop', function pop() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer.pop();\n\t}\n});\n\n/**\n* Adds a value to the stack.\n*\n* @name push\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nsetReadOnly( Stack.prototype, 'push', function push( value ) {\n\tthis._buffer.push( value );\n\treturn this;\n});\n\n/**\n* Returns an array of stack values.\n*\n* ## Notes\n*\n* - Why reverse insertion order? Pros and cons to either order, but reverse insertion order mirrors iterator order. For example, we can use the ES6/ES2015+ spread operator along with the iterator to return stack values.\n*\n* ```text\n* arr = [...s.iterator()]\n* ```\n*\n* One might (as is the opinion here) consider parity of array serialization and iterator order to be a reasonable design goal.\n*\n* @name toArray\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Array} stack values\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of stack values:\n* var vals = s.toArray();\n* // returns [ 'bar', 'foo' ]\n*/\nsetReadOnly( Stack.prototype, 'toArray', function toArray() {\n\tvar out;\n\tvar i;\n\tout = [];\n\tfor ( i = this._buffer.length-1; i >= 0; i-- ) {\n\t\tout.push( this._buffer[ i ] );\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a stack as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Stack` instance.\n*\n* @name toJSON\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Object} serialized stack\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = s.toJSON();\n* // returns { 'type': 'stack', 'data': [ 'bar', 'foo' ] }\n*/\nsetReadOnly( Stack.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'stack';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Stack;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Stack.\n*\n* @module @stdlib/utils/stack\n*\n* @example\n* var stack = require( '@stdlib/utils/stack' );\n*\n* var s = stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table.\n*\n* ## Notes\n*\n* - The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} first argument must be a collection\n* @returns {(Array|Array)} frequency table\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulate( arr );\n* // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n*/\nfunction tabulate( collection ) {\n\tvar count;\n\tvar tmp;\n\tvar len;\n\tvar out;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tcount = 0;\n\ttmp = [];\n\tout = [];\n\n\t// For each collection element, determine if we've seen the element before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tcount += 1;\n\t\tj = indexOf( tmp, v );\n\t\tif ( j === -1 ) {\n\t\t\ttmp.push( v );\n\t\t\tout.push( [ v, 1, 0 ] );\n\t\t} else {\n\t\t\tout[ j ][ 1 ] += 1;\n\t\t}\n\t}\n\t// Compute percentages...\n\tlen = out.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table.\n*\n* @module @stdlib/utils/tabulate\n*\n* @example\n* var tabulate = require( '@stdlib/utils/tabulate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulate( arr );\n* // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table according to a provided function.\n*\n* ## Notes\n*\n* - The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} frequency table\n*\n* @example\n* function indicator( value ) {\n* return value[ 0 ];\n* }\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulateBy( arr, indicator );\n* // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n*/\nfunction tabulateBy( collection, options, indicator ) {\n\tvar thisArg;\n\tvar count;\n\tvar opts;\n\tvar tmp;\n\tvar len;\n\tvar out;\n\tvar err;\n\tvar cb;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tthisArg = opts.thisArg;\n\tcount = 0;\n\ttmp = [];\n\tout = [];\n\n\t// For each collection element, determine if we've seen the element before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = cb.call( thisArg, collection[ i ], i );\n\t\tcount += 1;\n\t\tj = indexOf( tmp, v );\n\t\tif ( j === -1 ) {\n\t\t\ttmp.push( v );\n\t\t\tout.push( [ v, 1, 0 ] );\n\t\t} else {\n\t\t\tout[ j ][ 1 ] += 1;\n\t\t}\n\t}\n\t// Compute percentages...\n\tlen = out.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table according to an indicator function.\n*\n* @module @stdlib/utils/tabulate-by\n*\n* @example\n* var tabulateBy = require( '@stdlib/utils/tabulate-by' );\n*\n* function indicator( value ) {\n* return value[ 0 ];\n* }\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulateBy( arr, indicator );\n* // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a thunk.\n*\n* @param {Function} fcn - function to convert to a thunk\n* @param {...*} [args] - function arguments\n* @throws {TypeError} first argument must be a function\n* @returns {Function} thunk\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var f = thunk( add, 2, 3 );\n* // returns \n*\n* // ...\n*\n* // Evaluate the thunk:\n* var v = f();\n* // returns 5\n*/\nfunction thunk( fcn ) {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\t// NOTE: we return an anonymous function to satisfy the definition of a thunk (i.e., an anonymous function which has no parameters of its own and wraps another function)...\n\treturn function () { // eslint-disable-line no-restricted-syntax, func-names\n\t\treturn fcn.apply( null, args );\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = thunk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a thunk.\n*\n* @module @stdlib/utils/thunk\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var thunk = require( '@stdlib/utils/thunk' );\n*\n* var f = thunk( add, 2, 3 );\n* // returns \n*\n* // ...\n*\n* // Evaluate the thunk:\n* var v = f();\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"iterations\": 1000000,\n\t\"repeats\": 3,\n\t\"before\": \"\",\n\t\"after\": \"\",\n\t\"asynchronous\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNull = require( '@stdlib/assert/is-null' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {string} [options.before] - setup code\n* @param {string} [options.after] - cleanup code\n* @param {(PositiveInteger|null)} [options.iterations] - number of iterations\n* @param {PositiveInteger} [options.repeats] - number of repeats\n* @param {boolean} [options.asynchronous] - boolean indicating whether a snippet is asynchronous\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'iterations': 1e7,\n* 'repeats': 5\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'iterations' ) ) {\n\t\topts.iterations = options.iterations;\n\t\tif (\n\t\t\t!isPositiveInteger( opts.iterations ) &&\n\t\t\t!isNull( opts.iterations )\n\t\t) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer or null. Option: `%s`.', 'iterations', opts.iterations ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'repeats' ) ) {\n\t\topts.repeats = options.repeats;\n\t\tif ( !isPositiveInteger( opts.repeats ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'repeats', opts.repeats ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'before' ) ) {\n\t\topts.before = options.before;\n\t\tif ( !isString( opts.before ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'before', opts.before ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'after' ) ) {\n\t\topts.after = options.after;\n\t\tif ( !isString( opts.after ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'after', opts.after ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'asynchronous' ) ) {\n\t\topts.asynchronous = options.asynchronous;\n\t\tif ( !isBoolean( opts.asynchronous ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'asynchronous', opts.asynchronous ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar tic = require( '@stdlib/time/tic' );\nvar toc = require( '@stdlib/time/toc' );\n\n\n// MAIN //\n\n/**\n* Returns a context.\n*\n* @private\n* @param {Callback} done - callback to be invoked within snippet execution context\n* @returns {Object} context\n*/\nfunction context( done ) {\n\tvar ctx = {};\n\n\tdefineProperty( ctx, 'tic', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': tic\n\t});\n\tdefineProperty( ctx, 'toc', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': toc\n\t});\n\tdefineProperty( ctx, 'done', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': done\n\t});\n\treturn {\n\t\t'tic': tic,\n\t\t'toc': toc,\n\t\t'done': done\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = context;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar noop = 'next();';\n\n\n// MAIN //\n\n/**\n* Generates a source code body for asynchronous execution.\n*\n* ## Notes\n*\n* - Example output:\n*\n* ```javascript\n* \"use strict\";\n*\n* var ctx = this;\n* var state1 = {};\n* var t1, d1, i1;\n*\n* function before( state, next ) {\n* // {{before}}\n* }\n*\n* function cb1( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* i1 = 0;\n* t1 = ctx.tic();\n* main( state1, cb2 );\n* }\n*\n* function main( state, next ) {\n* // {{code}}\n* }\n*\n* function cb2( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* i1 += 1;\n* if ( i1 < 1e6 ) {\n* return main( state1, cb2 );\n* }\n* d1 = ctx.toc( t1 );\n* after( state1, cb3 );\n* }\n*\n* function after( state, next ) {\n* // {{after}}\n* }\n*\n* function cb3( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* ctx.done( null, d1 );\n* }\n*\n* before( state1, cb1 );\n*\n* return 1;\n* ```\n*\n* @private\n* @param {number} id - id\n* @param {string} code - code to time\n* @param {Options} opts - function options\n* @param {string} opts.before - setup code\n* @param {string} opts.after - cleanup code\n* @param {PositiveInteger} opts.iterations - number of iterations\n* @returns {string} source code body\n*/\nfunction body( id, code, opts ) {\n\tvar before;\n\tvar after;\n\tvar state;\n\tvar main;\n\tvar src;\n\tvar cb1;\n\tvar cb2;\n\tvar cb3;\n\tvar ctx;\n\tvar t;\n\tvar d;\n\tvar i;\n\n\tsrc = '\"use strict\";';\n\n\t// Define identifiers:\n\tbefore = '__before$'+id+'__';\n\tafter = '__after$'+id+'__';\n\tstate = '__state$'+id+'__';\n\tmain = '__main$'+id+'__';\n\tcb1 = '__cb1$'+id+'__';\n\tcb2 = '__cb2$'+id+'__';\n\tcb3 = '__cb3$'+id+'__';\n\tctx = '__ctx$'+id+'__';\n\ti = '__i$'+id+'__';\n\tt = '__t$'+id+'__';\n\td = '__d$'+id+'__';\n\n\t// Declare variables:\n\tsrc += 'var '+ctx+' = this;';\n\tsrc += 'var '+state+' = {};';\n\tsrc += 'var '+i+','+t+','+d+';';\n\n\t// Insert the setup code:\n\tsrc += 'function '+before+'( state, next ) {';\n\tsrc += ' '+(opts.before||noop)+';';\n\tsrc += '}';\n\n\t// Insert the setup callback:\n\tsrc += 'function '+cb1+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+i+' = 0;';\n\tsrc += ' '+t+' = '+ctx+'.tic();'; // start the timer\n\tsrc += ' '+main+'( '+state+','+cb2+' );';\n\tsrc += '}';\n\n\t// Wrap the code to time in a function:\n\tsrc += 'function '+main+'( state, next ) {';\n\tsrc += ' '+(code||noop)+';';\n\tsrc += '}';\n\n\t// Insert the main callback:\n\tsrc += 'function '+cb2+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+i+' += 1;';\n\tsrc += ' if ( '+i+' < '+opts.iterations+' ) {';\n\tsrc += ' return '+main+'( '+state+','+cb2+' );';\n\tsrc += ' }';\n\tsrc += ' '+d+' = '+ctx+'.toc( '+t+' );'; // stop the timer\n\tsrc += ' '+after+'( '+state+','+cb3+' );';\n\tsrc += '}';\n\n\t// Insert the cleanup code:\n\tsrc += 'function '+after+'( state, next ) {';\n\tsrc += ' '+(opts.after||noop)+';';\n\tsrc += '}';\n\n\t// Insert the cleanup callback:\n\tsrc += 'function '+cb3+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+ctx+'.done( null,'+d+' );'; // return results\n\tsrc += '}';\n\n\t// Invoke the setup function to begin the execution sequence:\n\tsrc += before+'( '+state+','+cb1+' );';\n\n\t// Return a value:\n\tsrc += 'return '+id+';';\n\n\treturn src;\n}\n\n\n// EXPORTS //\n\nmodule.exports = body;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Generates a source code body for synchronous execution.\n*\n* ## Notes\n*\n* - Example output:\n*\n* ```javascript\n* \"use strict\";\n*\n* var ctx = this;\n* var t1, d1, i1;\n*\n* // {{before}}\n*\n* t1 = ctx.tic();\n* for ( i1 = 0; i1 < 1e6; i1++ ) {\n* // {{code}}\n* }\n* d1 = ctx.toc( t1 );\n*\n* // {{after}}\n*\n* ctx.done( null, d1 );\n*\n* return 1;\n* ```\n*\n* @private\n* @param {number} id - id\n* @param {string} code - code to time\n* @param {Options} opts - function options\n* @param {string} opts.before - setup code\n* @param {string} opts.after - cleanup code\n* @param {PositiveInteger} opts.iterations - number of iterations\n* @returns {string} source code body\n*/\nfunction generate( id, code, opts ) {\n\tvar src;\n\tvar ctx;\n\tvar t;\n\tvar d;\n\tvar i;\n\n\tsrc = '\"use strict\";';\n\n\t// Declare variables:\n\tctx = '__ctx$'+id+'__';\n\ti = '__i$'+id+'__';\n\tt = '__t$'+id+'__';\n\td = '__d$'+id+'__';\n\n\tsrc += 'var '+ctx+' = this;';\n\tsrc += 'var '+t+','+d+','+i+';';\n\n\t// Insert the setup code:\n\tsrc += opts.before+';';\n\n\t// Start the timer:\n\tsrc += t+' = '+ctx+'.tic();';\n\n\t// Create the loop:\n\tsrc += 'for ( '+i+'= 0; '+i+' < '+opts.iterations+'; '+i+'++ ) {';\n\n\t// Insert the loop body:\n\tsrc += code+';';\n\n\t// Close the loop:\n\tsrc += '}';\n\n\t// Stop the timer:\n\tsrc += d+' = '+ctx+'.toc( '+t+' );';\n\n\t// Insert the cleanup code:\n\tsrc += opts.after+';';\n\n\t// Return results:\n\tsrc += ctx+'.done( null, '+d+' );';\n\n\t// Return a value:\n\tsrc += 'return '+id+';';\n\n\treturn src;\n}\n\n\n// EXPORTS //\n\nmodule.exports = generate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wraps a source code string similar to `require`.\n*\n* @private\n* @param {string} src - source code\n* @returns {string} wrapped code\n*/\nfunction wrap( src ) {\n\tvar out = '';\n\tout += '(function(require,__filename,__dirname){';\n\tout += src;\n\tout += '});';\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vm = require( 'vm' );\nvar wrap = require( './wrap.js' );\n\n\n// MAIN //\n\n/**\n* Compiles JavaScript source code for execution within a V8 virtual machine context.\n*\n* @private\n* @param {string} filename - filename to associate with compiled source code\n* @param {string} code - source code to compile\n* @returns {Function} compiled source code wrapped within a function\n*/\nfunction compile( filename, code ) {\n\tvar script;\n\tvar opts;\n\n\t// Wrap the source code similar to `require`:\n\tcode = wrap( code );\n\n\t// Compile the source code:\n\topts = {\n\t\t'filename': filename,\n\t\t'lineOffset': 0\n\t};\n\tscript = new vm.Script( code, opts );\n\n\t// Run the compiled code in the current V8 context:\n\topts = {\n\t\t'displayErrors': true\n\t};\n\treturn script.runInThisContext( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = compile;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( '@stdlib/random/base/minstd-shuffle' );\nvar createContext = require( './context.js' );\nvar asyncSource = require( './async.js' );\nvar syncSource = require( './sync.js' );\nvar compile = require( './vm_compile.js' );\n\n\n// MAIN //\n\n/**\n* Evaluates source code within a V8 virtual machine context.\n*\n* @private\n* @param {string} src - source code\n* @param {Object} opts - options\n* @param {string} filename - filename\n* @param {string} dirname - directory name\n* @param {Callback} clbk - callback to invoke upon completion\n* @returns {void}\n*/\nfunction evaluate( src, opts, filename, dirname, clbk ) {\n\tvar context;\n\tvar tmp;\n\tvar fcn;\n\tvar err;\n\tvar id;\n\n\t// Create an id:\n\tid = minstd();\n\n\t// Create an execution context:\n\tcontext = createContext( done );\n\n\t// Generate the source code to evaluate...\n\tif ( opts.asynchronous ) {\n\t\tsrc = asyncSource( id, src, opts );\n\t} else {\n\t\tsrc = syncSource( id, src, opts );\n\t}\n\t// Compile the source code:\n\tfcn = compile( filename, src );\n\n\t// Execute the source code:\n\ttmp = fcn.call( context, require, filename, dirname );\n\n\t// Check that the snippet did not prematurely return...\n\tif ( tmp !== id ) {\n\t\terr = new Error( 'evaluation error. Unable to retrieve evaluation results. Ensure that the provided snippet does not return prematurely.' );\n\t\treturn done( err );\n\t}\n\t/**\n\t* Callback invoked upon executing source code.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} results - results\n\t* @returns {void}\n\t*/\n\tfunction done( error, results ) {\n\t\tif ( error ) {\n\t\t\treturn clbk( error );\n\t\t}\n\t\treturn clbk( null, results );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = evaluate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum time.\n*\n* @private\n* @param {ArrayArray} times - times\n* @returns {NonNegativeIntegerArray} minimum time\n*/\nfunction min( times ) {\n\tvar out;\n\tvar t;\n\tvar i;\n\n\tout = times[ 0 ];\n\tfor ( i = 1; i < times.length; i++ ) {\n\t\tt = times[ i ];\n\t\tif (\n\t\t\tt[ 0 ] < out[ 0 ] ||\n\t\t\t(\n\t\t\t\tt[ 0 ] === out[ 0 ] &&\n\t\t\t\tt[ 1 ] < out[ 1 ]\n\t\t\t)\n\t\t) {\n\t\t\tout = t;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = min;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( './min_time.js' );\n\n\n// MAIN //\n\n/**\n* Transforms raw results.\n*\n* @private\n* @param {ArrayArray} raw - raw results\n* @param {PositiveInteger} iterations - number of iterations\n* @returns {Object} transformed results\n*/\nfunction transform( raw, iterations ) {\n\tvar secs;\n\tvar rate;\n\tvar out;\n\tvar m;\n\n\tm = min( raw );\n\tsecs = m[ 0 ] + ( m[ 1 ]/1e9 );\n\trate = iterations / secs;\n\n\tout = {\n\t\t'iterations': iterations,\n\t\t'repeats': raw.length,\n\t\t'min': m,\n\t\t'elapsed': secs,\n\t\t'rate': rate,\n\t\t'times': raw\n\t};\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = transform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar copy = require( './../../copy' );\nvar cwd = require( '@stdlib/process/cwd' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( './../../next-tick' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar evaluate = require( './vm_evaluate.js' );\nvar transform = require( './transform.js' );\n\n\n// VARIABLES //\n\nvar FILENAME = 'timeit.js';\nvar MIN_TIME = 0.1; // seconds\nvar ITERATIONS = 10; // 10^1\nvar MAX_ITERATIONS = 10000000000; // 10^10\n\n\n// MAIN //\n\n/**\n* Times a snippet.\n*\n* @param {string} code - snippet to time\n* @param {Options} [options] - function options\n* @param {string} [options.before=\"\"] - setup code\n* @param {string} [options.after=\"\"] - cleanup code\n* @param {(PositiveInteger|null)} [options.iterations=1e6] - number of iterations\n* @param {PositiveInteger} [options.repeats=3] - number of repeats\n* @param {boolean} [options.asynchronous=false] - boolean indicating whether a snippet is asynchronous\n* @param {Callback} clbk - callback to invoke upon completion\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} callback argument must be a function\n* @returns {void}\n*\n* @example\n* var code = '';\n* code += 'var x = Math.pow( Math.random(), 3 );';\n* code += 'if ( x !== x ) {';\n* code += 'throw new Error( \\'Something went wrong.\\' );';\n* code += '}';\n*\n* timeit( code, done );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.dir( results );\n* }\n*/\nfunction timeit( code, options, clbk ) {\n\tvar results;\n\tvar opts;\n\tvar dir;\n\tvar err;\n\tvar idx;\n\tvar cb;\n\n\tif ( !isString( code ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', code ) );\n\t}\n\topts = copy( defaults );\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\tcb = clbk;\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tresults = new Array( opts.repeats );\n\tdir = cwd();\n\tidx = 0;\n\n\t// Pretest to check for early returns and/or errors...\n\ttry {\n\t\tevaluate( code, opts, FILENAME, dir, onTest );\n\t} catch ( error ) {\n\t\terr = new Error( format( 'evaluation error. Encountered an error when evaluating snippet. %s', error.message ) );\n\t\treturn done( err );\n\t}\n\n\t/**\n\t* Evaluates a code snippet on the next turn of the event loop. Waiting until the next turn avoids the current turn being bogged down by a long running queue.\n\t*\n\t* @private\n\t* @param {Callback} clbk - callback\n\t*/\n\tfunction next( clbk ) {\n\t\tnextTick( onTick );\n\n\t\t/**\n\t\t* Callback invoked upon next turn of event loop.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction onTick() {\n\t\t\tevaluate( code, opts, FILENAME, dir, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked after completing pretest.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onTest( error, time ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !isArray( time ) || time.length !== 2 ) {\n\t\t\t// This should only happen if someone is a bad actor and attempts to call the `done` callback without providing timing results.\n\t\t\terror = new Error( 'evaluation error. Did not receive timing results.' );\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( opts.iterations === null ) {\n\t\t\topts.iterations = ITERATIONS;\n\t\t\treturn next( onRun );\n\t\t}\n\t\t// Begin timing the snippet...\n\t\treturn next( onFinish );\n\t}\n\n\t/**\n\t* Callback invoked upon running a pre-run to determine the number of iterations.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onRun( error, time ) {\n\t\tvar t;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tt = time[ 0 ] + ( time[ 1 ]/1e9 );\n\t\tif (\n\t\t\tt < MIN_TIME &&\n\t\t\topts.iterations < MAX_ITERATIONS\n\t\t) {\n\t\t\topts.iterations *= 10;\n\t\t\treturn next( onRun );\n\t\t}\n\t\t// Begin timing the snippet...\n\t\treturn next( onFinish );\n\t}\n\n\t/**\n\t* Callback invoked upon executing code.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onFinish( error, time ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tresults[ idx ] = time;\n\t\tidx += 1;\n\t\tif ( idx < opts.repeats ) {\n\t\t\treturn next( onFinish );\n\t\t}\n\t\tdone( null, results );\n\t}\n\n\t/**\n\t* Callback invoked upon completion.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {ArrayArray} results - raw results\n\t*/\n\tfunction done( error, results ) {\n\t\tvar out;\n\t\tif ( !error ) {\n\t\t\tout = transform( results, opts.iterations );\n\t\t}\n\t\t// Avoid releasing the zalgo:\n\t\tnextTick( onTick );\n\n\t\t/**\n\t\t* Callback invoked upon the next tick.\n\t\t*\n\t\t* @private\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction onTick() {\n\t\t\tif ( error ) {\n\t\t\t\treturn cb( error );\n\t\t\t}\n\t\t\tcb( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = timeit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Time a snippet.\n*\n* @module @stdlib/utils/timeit\n*\n* @example\n* var timeit = require( '@stdlib/utils/timeit' );\n*\n* var code = '';\n* code += 'var x = Math.pow( Math.random(), 3 );';\n* code += 'if ( x !== x ) {';\n* code += 'throw new Error( \\'Something went wrong.\\' );';\n* code += '}';\n*\n* timeit( code, done );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.dir( results );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not throw, returns the function return value; otherwise, returns `y`.\n*\n* @param {Function} x - function to try invoking\n* @param {*} y - value to return if a function throws\n* @throws {TypeError} first argument must be a function\n* @returns {*} either the return value of `x` or the provided argument `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n* var z = trycatch( x, -1.0 );\n* // returns \n*/\nfunction trycatch( x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\ttry {\n\t\treturn x();\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn y;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trycatch;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not throw, return the function return value; otherwise, return `y`.\n*\n* @module @stdlib/utils/try-catch\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trycatch = require( '@stdlib/utils/try-catch' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n* var z = trycatch( x, -1.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Wraps a function in a try/catch block.\n*\n* @param {Function} fcn - function to wrap\n* @param {*} [thisArg] - function context\n* @throws {TypeError} must provide a function\n* @returns {Function} wrapped function\n*\n* @example\n* function fcn() {\n* throw new Error( 'beep boop' );\n* }\n*\n* var f = wrap( fcn );\n*\n* var out = f();\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* // => 'beep boop'\n* }\n*/\nfunction wrap( fcn, thisArg ) {\n\tvar ctx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tctx = thisArg;\n\t} else {\n\t\tctx = null;\n\t}\n\treturn wrapped;\n\n\t/**\n\t* Wrapped function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*|Error} returned value or an error object\n\t*/\n\tfunction wrapped() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\ttry {\n\t\t\treturn fcn.apply( ctx, args );\n\t\t} catch ( error ) {\n\t\t\tif ( isError( error ) ) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t\t// Handle thrown literals...\n\t\t\tif ( typeof error === 'object' ) {\n\t\t\t\treturn new Error( JSON.stringify( error ) );\n\t\t\t}\n\t\t\treturn new Error( error.toString() );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wrap a function in a try/catch block.\n*\n* @module @stdlib/utils/try-function\n*\n* @example\n* var wrap = require( '@stdlib/utils/try-function' );\n*\n* function fcn() {\n* throw new Error( 'beep boop' );\n* }\n*\n* var f = wrap( fcn );\n*\n* var out = f();\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* // => 'beep boop'\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isError = require( '@stdlib/assert/is-error' );\n\n\n// MAIN //\n\n/**\n* Wraps `require` in a try/catch block.\n*\n* @param {string} id - module id\n* @returns {*|Error} `module.exports` of the resolved module or an error\n*\n* @example\n* var out = tryRequire( 'beepboop' );\n*\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* }\n*/\nfunction tryRequire( id ) {\n\ttry {\n\t\treturn require( id ); // eslint-disable-line stdlib/no-dynamic-require\n\t} catch ( error ) {\n\t\tif ( isError( error ) ) {\n\t\t\treturn error;\n\t\t}\n\t\t// Handle case where a literal is thrown...\n\t\tif ( typeof error === 'object' ) {\n\t\t\treturn new Error( JSON.stringify( error ) );\n\t\t}\n\t\treturn new Error( error.toString() );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = tryRequire;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wrap `require` in a try/catch block.\n*\n* @module @stdlib/utils/try-require\n*\n* @example\n* var tryRequire = require( '@stdlib/utils/try-require' );\n*\n* var out = tryRequire( 'beepboop' );\n*\n* if ( out instanceof Error ) {\n* console.log( out.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not throw, returns the function return value; otherwise, returns the return value of a second function `y`.\n*\n* @param {Function} x - function to try invoking\n* @param {Function} y - function to invoke if a function throws\n* @throws {TypeError} first argument must be a function\n* @returns {*} the return value of either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n*\n* function y() {\n* return randu();\n* }\n*\n* var z = trythen( x, y );\n* // returns \n*/\nfunction trythen( x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', y ) );\n\t}\n\ttry {\n\t\treturn x();\n\t} catch ( error ) {\n\t\treturn y( error );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trythen;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not throw, return the function return value; otherwise, return the return value of a second function `y`.\n*\n* @module @stdlib/utils/try-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trythen = require( '@stdlib/utils/try-then' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n*\n* function y() {\n* return randu();\n* }\n*\n* var z = trythen( x, y );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/jsdoc-doctest-decimal-point */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/max' );\nvar UINT8 = require( '@stdlib/constants/uint8/max' );\nvar INT16 = require( '@stdlib/constants/int16/max' );\nvar UINT16 = require( '@stdlib/constants/uint16/max' );\nvar INT32 = require( '@stdlib/constants/int32/max' );\nvar UINT32 = require( '@stdlib/constants/uint32/max' );\nvar FLOAT16 = require( '@stdlib/constants/float16/pinf' );\nvar FLOAT32 = require( '@stdlib/constants/float32/pinf' );\nvar FLOAT64 = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum value of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} maximum value\n*\n* @example\n* var m = typemax( 'int8' );\n* // returns 127\n*\n* @example\n* var m = typemax( 'uint8' );\n* // returns 255\n*\n* @example\n* var m = typemax( 'int16' );\n* // returns 32767\n*/\nfunction typemax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'uint32':\n\t\treturn UINT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'uint8':\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn UINT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'uint16':\n\t\treturn UINT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = typemax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum value of a specified numeric type.\n*\n* @module @stdlib/utils/type-max\n*\n* @example\n* var typemax = require( '@stdlib/utils/type-max' );\n*\n* var m = typemax( 'int8' );\n* // returns 127\n*\n* m = typemax( 'uint8' );\n* // returns 255\n*\n* m = typemax( 'int16' );\n* // returns 32767\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/jsdoc-doctest-decimal-point */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/min' );\nvar INT16 = require( '@stdlib/constants/int16/min' );\nvar INT32 = require( '@stdlib/constants/int32/min' );\nvar FLOAT16 = require( '@stdlib/constants/float16/ninf' );\nvar FLOAT32 = require( '@stdlib/constants/float32/ninf' );\nvar FLOAT64 = require( '@stdlib/constants/float64/ninf' );\n\n\n// MAIN //\n\n/**\n* Returns the minimum value of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} minimum value\n*\n* @example\n* var m = typemin( 'int8' );\n* // returns -128\n*\n* @example\n* var m = typemin( 'uint8' );\n* // returns 0\n*\n* @example\n* var m = typemin( 'int16' );\n* // returns -32768\n*/\nfunction typemin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tcase 'uint32':\n\t\t// Fall-through..\n\tcase 'uint16': // eslint-disable-line no-fallthrough\n\t\t// Fall-through..\n\tcase 'uint8': // eslint-disable-line no-fallthrough\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn 0;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = typemin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum value of a specified numeric type.\n*\n* @module @stdlib/utils/type-min\n*\n* @example\n* var typemin = require( '@stdlib/utils/type-min' );\n*\n* var m = typemin( 'int8' );\n* // returns -128\n*\n* m = typemin( 'uint8' );\n* // returns 0\n*\n* m = typemin( 'int16' );\n* // returns -32768\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts the first letter of each object key to lowercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'AA': 1,\n* 'BB': 2\n* };\n*\n* var obj2 = uncapitalizeKeys( obj1 );\n* // returns { 'aA': 1, 'bB': 2 }\n*/\nfunction uncapitalizeKeys( obj ) {\n\tvar out;\n\tvar key;\n\tvar k;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tif ( key === '' ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t} else {\n\t\t\t\tk = key.charAt( 0 ).toLowerCase() + key.slice( 1 );\n\t\t\t\tout[ k ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncapitalizeKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert the first letter of each object key to lowercase.\n*\n* @module @stdlib/utils/uncapitalize-keys\n*\n* @example\n* var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' );\n*\n* var obj1 = {\n* 'AA': 1,\n* 'BB': 2\n* };\n*\n* var obj2 = uncapitalizeKeys( obj1 );\n* // returns { 'aA': 1, 'bB': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a curried function into a function invoked with multiple arguments.\n*\n* @param {Function} fcn - curried function\n* @param {PositiveInteger} [arity] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} uncurried function\n*\n* @example\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurry( addX );\n*\n* var sum = add( 2, 3 );\n* // returns 5\n*/\nfunction uncurry( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = null;\n\t}\n\telse if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t}\n\telse if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t}\n\telse {\n\t\tlen = null;\n\t\tcontext = arity;\n\t}\n\treturn uncurried;\n\n\t/**\n\t* Uncurried function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} if arity is set, must provide expected number of input arguments\n\t* @throws {Error} configured arity must be compatible with curried function\n\t* @throws {Error} if arity is not set, number of arguments must be compatible with curried function\n\t* @returns {*} function result\n\t*/\n\tfunction uncurried() {\n\t\tvar f;\n\t\tvar i;\n\n\t\tf = fcn;\n\t\tif ( len ) {\n\t\t\tif ( len > arguments.length ) {\n\t\t\t\tthrow new Error( format( 'insufficient arguments. Expected %u argument(s) and only received %u argument(s).', len, arguments.length ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( isFunction( f ) ) {\n\t\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error( format( 'invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', len, i ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn f;\n\t\t}\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tif ( isFunction( f ) ) {\n\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t} else {\n\t\t\t\tthrow new Error( format( 'invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', arguments.length, i ) );\n\t\t\t}\n\t\t}\n\t\treturn f;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncurry;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a curried function into a function invoked with multiple arguments.\n*\n* @module @stdlib/utils/uncurry\n*\n* @example\n* var uncurry = require( '@stdlib/utils/uncurry' );\n*\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurry( addX );\n*\n* var sum = add( 2, 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a curried function into a function invoked with multiple arguments.\n*\n* @param {Function} fcn - curried function\n* @param {PositiveInteger} [arity] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} uncurried function\n*\n* @example\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurryRight( addX );\n*\n* var sum = add( 3, 2 );\n* // returns 5\n*/\nfunction uncurryRight( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = null;\n\t}\n\telse if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t}\n\telse if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t}\n\telse {\n\t\tlen = null;\n\t\tcontext = arity;\n\t}\n\treturn uncurried;\n\n\t/**\n\t* Uncurried function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} if arity is set, must provide expected number of input arguments\n\t* @throws {Error} configured arity must be compatible with curried function\n\t* @throws {Error} if arity is not set, number of arguments must be compatible with curried function\n\t* @returns {*} function result\n\t*/\n\tfunction uncurried() {\n\t\tvar f;\n\t\tvar i;\n\n\t\tf = fcn;\n\t\tif ( len ) {\n\t\t\tif ( len > arguments.length ) {\n\t\t\t\tthrow new Error( format( 'insufficient arguments. Expected %u argument(s) and only received %u argument(s).', len, arguments.length ) );\n\t\t\t}\n\t\t\tfor ( i = len-1; i >= 0; i-- ) {\n\t\t\t\tif ( isFunction( f ) ) {\n\t\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error( format( 'invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', len, i ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn f;\n\t\t}\n\t\tfor ( i = arguments.length-1; i >= 0; i-- ) {\n\t\t\tif ( isFunction( f ) ) {\n\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t} else {\n\t\t\t\tthrow new Error( format( 'invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', arguments.length, i ) );\n\t\t\t}\n\t\t}\n\t\treturn f;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncurryRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a curried function into a function invoked with multiple arguments.\n*\n* @module @stdlib/utils/uncurry-right\n*\n* @example\n* var uncurryRight = require( '@stdlib/utils/uncurry-right' );\n*\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurryRight( addX );\n*\n* var sum = add( 3, 2 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {Array} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {Array} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = unshift( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction unshift( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {Array} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar unshiftArray = require( './unshift_array.js' );\nvar unshiftObject = require( './unshift_object.js' );\nvar unshiftTypedArray = require( './unshift_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @param {...*} items - items to add\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {(Array|TypedArray|Object)} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( collection ) {\n\tvar items;\n\tvar i;\n\titems = new Array( arguments.length-1 );\n\tfor ( i = 0; i < arguments.length-1; i++ ) {\n\t\titems[ i ] = arguments[ i+1 ];\n\t}\n\tif ( isArray( collection ) ) {\n\t\treturn unshiftArray( collection, items );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn unshiftTypedArray( collection, items );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn unshiftObject( collection, items );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add one or more elements to the beginning of a collection.\n*\n* @module @stdlib/utils/unshift\n*\n* @example\n* var unshift = require( '@stdlib/utils/unshift' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to stop invoking a function\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i >= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* until( predicate, beep );\n*/\nfunction until( predicate, fcn, thisArg ) {\n\tvar i;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\ti = 0;\n\twhile ( !predicate( i ) ) {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = until;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/until\n*\n* @example\n* var until = require( '@stdlib/utils/until' );\n*\n* function predicate( i ) {\n* return ( i >= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* until( predicate, beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, key, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, key, collection ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* untilEach( arr, predicate, log );\n*/\nfunction untilEach( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = 0;\n\twhile (\n\t\ti < len &&\n\t\t!predicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/until-each\n*\n* @example\n* var untilEach = require( '@stdlib/utils/until-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* untilEach( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `untilEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `untilEach()`, `[].push()` behavior is consistent with `untilEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* untilEachRight( arr, predicate, log );\n*/\nfunction untilEachRight( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = len - 1;\n\twhile (\n\t\ti >= 0 &&\n\t\t!predicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/until-each-right\n*\n* @example\n* var untilEachRight = require( '@stdlib/utils/until-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* untilEachRight( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar isArray = require( '@stdlib/assert/is-array' );\n\n\n// MAIN //\n\n/**\n* Unzips a zipped array (i.e., a nested array of tuples).\n*\n* @param {Array} arr - zipped array\n* @param {Array} [idx] - array of indices specifying which tuple elements to unzip\n* @throws {TypeError} first argument must be a zipped array\n* @throws {TypeError} second argument must be an array of integer indices\n* @throws {Error} indices must be on the interval from zero to the tuple length\n* @returns {Array} array of unzipped arrays\n*\n* @example\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n*\n* var out = unzip( arr );\n* // returns [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n*\n* @example\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n*\n* var out = unzip( arr, [ 0, 2 ] );\n* // returns [ [ 1, 2 ], [ 3, 4 ] ]\n*/\nfunction unzip( arr, idx ) {\n\tvar numVals;\n\tvar len;\n\tvar out;\n\tvar tmp;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( 'invalid argument. Must provide a zipped array.' );\n\t}\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( !isArray( arr[i] ) ) {\n\t\t\tthrow new TypeError( 'invalid argument. Array must only contain arrays.' );\n\t\t}\n\t}\n\t// Assume that the first tuple is representative of all tuples...\n\tnumVals = arr[ 0 ].length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isArray( idx ) ) {\n\t\t\tthrow new TypeError( 'invalid argument. Indices must be specified as an array.' );\n\t\t}\n\t\tfor ( i = 0; i < idx.length; i++ ) {\n\t\t\tk = idx[ i ];\n\t\t\tif ( !isInteger( k ) ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. All indices must be integers.' );\n\t\t\t}\n\t\t\tif ( k < 0 || k > numVals ) {\n\t\t\t\tthrow new Error( 'invalid argument. Must provide valid indices (i.e., must be a nonnegative integer less than or equal to the tuple length).' );\n\t\t\t}\n\t\t}\n\t\tnumVals = idx.length;\n\t} else {\n\t\tidx = new Array( numVals );\n\t\tfor ( i = 0; i < numVals; i++ ) {\n\t\t\tidx[ i ] = i;\n\t\t}\n\t}\n\tout = new Array( numVals );\n\tfor ( j = 0; j < numVals; j++ ) {\n\t\ttmp = new Array( len );\n\t\tk = idx[ j ];\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\ttmp[ i ] = arr[ i ][ k ];\n\t\t}\n\t\tout[ j ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unzip;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Unzip a zipped array (i.e., a nested array of tuples).\n*\n* @module @stdlib/utils/unzip\n*\n* @example\n* var unzip = require( '@stdlib/utils/unzip' );\n*\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n* var out = unzip( arr );\n* // returns [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n*\n* arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n* out = unzip( arr, [ 0, 2 ] );\n* // returns [ [ 1, 2 ], [ 3, 4 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts each object key to uppercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = uppercaseKeys( obj1 );\n* // returns { 'A': 1, 'B': 2 }\n*/\nfunction uppercaseKeys( obj ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key.toUpperCase() ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uppercaseKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert each object key to uppercase.\n*\n* @module @stdlib/utils/uppercase-keys\n*\n* @example\n* var uppercaseKeys = require( '@stdlib/utils/uppercase-keys' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = uppercaseKeys( obj1 );\n* // returns { 'A': 1, 'B': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property values.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} value array\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var vals = objectValues( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\nfunction objectValues( obj ) {\n\tvar keys;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ] = obj[ keys[i] ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property values.\n*\n* @module @stdlib/utils/values\n*\n* @example\n* var objectValues = require( '@stdlib/utils/values' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var vals = objectValues( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property values.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} value array\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var values = objectValuesIn( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\nfunction objectValuesIn( obj ) {\n\tvar out;\n\tvar key;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( obj[ key ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectValuesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property values.\n*\n* @module @stdlib/utils/values-in\n*\n* @example\n* var objectValuesIn = require( '@stdlib/utils/values-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var values = objectValuesIn( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* whilst( predicate, beep );\n*/\nfunction whilst( predicate, fcn, thisArg ) {\n\tvar i;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\ti = 0;\n\twhile ( predicate( i ) ) {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = whilst;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/while\n*\n* @example\n* var whilst = require( '@stdlib/utils/while' );\n*\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* whilst( predicate, beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* whileEach( arr, predicate, log );\n*/\nfunction whileEach( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = 0;\n\twhile (\n\t\ti < len &&\n\t\tpredicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/while-each\n*\n* @example\n* var whileEach = require( '@stdlib/utils/while-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* whileEach( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `whileEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `whileEach()`, `[].push()` behavior is consistent with `whileEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* whileEachRight( arr, predicate, log );\n*/\nfunction whileEachRight( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = len - 1;\n\twhile (\n\t\ti >= 0 &&\n\t\tpredicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/while-each-right\n*\n* @example\n* var whileEachRight = require( '@stdlib/utils/while-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* whileEachRight( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isWritable = require( '@stdlib/assert/is-writable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property writable names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = writableProperties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction writableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar n;\n\tvar i;\n\n\tout = propertyNames( value );\n\tn = 0;\n\tfor ( i = 0; i < out.length; i++ ) {\n\t\tif ( isWritable( value, out[ i ] ) ) {\n\t\t\tout[ n ] = out[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tout.length = n;\n\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isWritable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable property names and symbols.\n*\n* @module @stdlib/utils/writable-properties\n*\n* @example\n* var writableProperties = require( '@stdlib/utils/writable-properties' );\n*\n* var props = writableProperties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isWritable = require( '@stdlib/assert/is-writable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable property names and symbols\n*\n* @example\n* var props = writablePropertiesIn( [] );\n* // returns [...]\n*/\nfunction writablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting writable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisWritable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisWritable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable property names and symbols.\n*\n* @module @stdlib/utils/writable-properties-in\n*\n* @example\n* var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' );\n*\n* var props = writablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own writable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNames( obj );\n* // returns [ 'a' ]\n*/\nfunction writablePropertyNames( value ) {\n\tvar names;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tnames = getOwnPropertyNames( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tif ( isWritableProperty( value, names[ i ] ) ) {\n\t\t\tnames[ n ] = names[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tnames.length = n;\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable property names.\n*\n* @module @stdlib/utils/writable-property-names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var writablePropertyNames = require( '@stdlib/utils/writable-property-names' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNames( obj );\n* // returns [ 'a' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNamesIn( obj );\n* // e.g., returns [ 'a', ... ]\n*/\nfunction writablePropertyNamesIn( value ) {\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting writable property names...\n\tnames = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable property names.\n*\n* @module @stdlib/utils/writable-property-names-in\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNamesIn( obj );\n* // e.g., returns [ 'a', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own writable symbol properties\n*\n* @example\n* var symbols = writablePropertySymbols( {} );\n*/\nfunction writablePropertySymbols( value ) {\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isWritableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable symbol properties.\n*\n* @module @stdlib/utils/writable-property-symbols\n*\n* @example\n* var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' );\n*\n* var symbols = writablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable symbol properties\n*\n* @example\n* var symbols = writablePropertySymbolsIn( {} );\n*/\nfunction writablePropertySymbolsIn( value ) {\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all writable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable symbol properties.\n*\n* @module @stdlib/utils/writable-property-symbols-in\n*\n* @example\n* var writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' );\n*\n* var symbols = writablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Generates array tuples from input arrays.\n*\n* @param {...Array} arr - input arrays to be zipped\n* @param {Object} [opts] - function options\n* @param {boolean} [opts.trunc=true] - boolean indicating whether to truncate arrays longer than the shortest input array\n* @param {*} [opts.fill=null] - fill value used for arrays of unequal length\n* @param {boolean} [opts.arrays=false] - boolean indicating whether an input array should be interpreted as an array of arrays to be zipped\n* @throws {TypeError} must provide array arguments\n* @throws {Error} must provide at least one array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} output array of arrays\n*\n* @example\n* var zipped = zip( [ 1, 2 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* @example\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* @example\n* var opts = {\n* 'trunc': false\n* };\n*\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n*\n* @example\n* var opts = {\n* 'trunc': false,\n* 'fill': ''\n* };\n*\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, '' ] ]\n*\n* @example\n* var arr = [ [ 1, 2 ], [ 'a', 'b' ] ];\n*\n* // Default behavior:\n* var zipped = zip( arr );\n* // returns [ [ [ 1, 2 ] ], [ [ 'a', 'b' ] ] ]\n*\n* // Array of arrays:\n* zipped = zip( arr, { 'arrays': true } );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*/\nfunction zip() {\n\tvar nargs;\n\tvar args;\n\tvar fill;\n\tvar opts;\n\tvar arg;\n\tvar flg;\n\tvar len;\n\tvar arr;\n\tvar out;\n\tvar val;\n\tvar i;\n\tvar j;\n\n\topts = {};\n\tfill = null;\n\targs = Array.prototype.slice.call( arguments );\n\tnargs = args.length;\n\n\tfor ( i = 0; i < nargs-1; i++ ) {\n\t\tif ( !isArray( args[i] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide array arguments. Value: `%s`.', args[i] ) );\n\t\t}\n\t}\n\targ = args[ nargs-1 ];\n\tflg = isObject( arg );\n\tif ( !flg && !isArray( arg ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be either an array or an options object. Value: `%s`.', arg ) );\n\t}\n\tif ( flg ) {\n\t\topts = args.pop();\n\t}\n\tnargs = args.length;\n\tif ( nargs === 0 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least one array.' );\n\t}\n\tif ( hasOwnProp( opts, 'trunc' ) ) {\n\t\tif ( !isBoolean( opts.trunc ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'trunc', opts.trunc ) );\n\t\t}\n\t} else {\n\t\topts.trunc = true;\n\t}\n\tif ( hasOwnProp( opts, 'fill' ) ) {\n\t\tfill = opts.fill;\n\t}\n\tif ( hasOwnProp( opts, 'arrays' ) ) {\n\t\tif ( !isBoolean( opts.arrays ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'arrays', opts.arrays ) );\n\t\t}\n\t} else {\n\t\topts.arrays = false;\n\t}\n\tif ( nargs === 1 && opts.arrays ) {\n\t\t// Treat the lone array argument as an array of arrays to be zipped...\n\t\targs = args[ 0 ];\n\t\tnargs = args.length;\n\t}\n\tlen = args[ 0 ].length;\n\tif ( opts.trunc ) {\n\t\t// Find the min array length...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tval = args[ i ].length;\n\t\t\tif ( val < len ) {\n\t\t\t\tlen = val;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Find the max array length...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tval = args[ i ].length;\n\t\t\tif ( val > len ) {\n\t\t\t\tlen = val;\n\t\t\t}\n\t\t}\n\t}\n\tout = new Array( len );\n\tfor ( j = 0; j < len; j++ ) {\n\t\t// Temporary array to store tuples...\n\t\tarr = new Array( nargs );\n\n\t\t// Create the tuples...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targ = args[ i ];\n\n\t\t\t// If an array is too short, use a fill value...\n\t\t\tif ( arg.length <= j ) {\n\t\t\t\tarr[ i ] = fill;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tarr[ i ] = arg[ j ];\n\t\t}\n\t\tout[ j ] = arr;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = zip;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate array tuples from input arrays.\n*\n* @module @stdlib/utils/zip\n*\n* @example\n* var zip = require( '@stdlib/utils/zip' );\n*\n* var zipped = zip( [ 1, 2 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* var opts = {\n* 'trunc': false\n* };\n*\n* zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n/*\n* The following modules are intentionally not exported: library-manifest\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace utils\n*/\nvar utils = {};\n\n/**\n* @name any\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any}\n*/\nsetReadOnly( utils, 'any', require( './../any' ) );\n\n/**\n* @name anyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any-by}\n*/\nsetReadOnly( utils, 'anyBy', require( './../any-by' ) );\n\n/**\n* @name anyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any-by-right}\n*/\nsetReadOnly( utils, 'anyByRight', require( './../any-by-right' ) );\n\n/**\n* @name append\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/append}\n*/\nsetReadOnly( utils, 'append', require( './../append' ) );\n\n/**\n* @name argumentFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/argument-function}\n*/\nsetReadOnly( utils, 'argumentFunction', require( './../argument-function' ) );\n\n/**\n* @name async\n* @memberof utils\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/async}\n*/\nsetReadOnly( utils, 'async', require( './../async' ) );\n\n/**\n* @name bifurcate\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate}\n*/\nsetReadOnly( utils, 'bifurcate', require( './../bifurcate' ) );\n\n/**\n* @name bifurcateBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-by}\n*/\nsetReadOnly( utils, 'bifurcateBy', require( './../bifurcate-by' ) );\n\n/**\n* @name bifurcateIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-in}\n*/\nsetReadOnly( utils, 'bifurcateIn', require( './../bifurcate-in' ) );\n\n/**\n* @name bifurcateOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-own}\n*/\nsetReadOnly( utils, 'bifurcateOwn', require( './../bifurcate-own' ) );\n\n/**\n* @name capitalizeKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/capitalize-keys}\n*/\nsetReadOnly( utils, 'capitalizeKeys', require( './../capitalize-keys' ) );\n\n/**\n* @name CircularBuffer\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/circular-buffer}\n*/\nsetReadOnly( utils, 'CircularBuffer', require( './../circular-buffer' ) );\n\n/**\n* @name commonKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/common-keys}\n*/\nsetReadOnly( utils, 'commonKeys', require( './../common-keys' ) );\n\n/**\n* @name commonKeysIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/common-keys-in}\n*/\nsetReadOnly( utils, 'commonKeysIn', require( './../common-keys-in' ) );\n\n/**\n* @name CompactAdjacencyMatrix\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/compact-adjacency-matrix}\n*/\nsetReadOnly( utils, 'CompactAdjacencyMatrix', require( './../compact-adjacency-matrix' ) );\n\n/**\n* @name compose\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/compose}\n*/\nsetReadOnly( utils, 'compose', require( './../compose' ) );\n\n/**\n* @name constantFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/constant-function}\n*/\nsetReadOnly( utils, 'constantFunction', require( './../constant-function' ) );\n\n/**\n* @name constructorName\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/constructor-name}\n*/\nsetReadOnly( utils, 'constructorName', require( './../constructor-name' ) );\n\n/**\n* @name convertPath\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/convert-path}\n*/\nsetReadOnly( utils, 'convertPath', require( './../convert-path' ) );\n\n/**\n* @name copy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/copy}\n*/\nsetReadOnly( utils, 'copy', require( './../copy' ) );\n\n/**\n* @name countBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/count-by}\n*/\nsetReadOnly( utils, 'countBy', require( './../count-by' ) );\n\n/**\n* @name curry\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/curry}\n*/\nsetReadOnly( utils, 'curry', require( './../curry' ) );\n\n/**\n* @name curryRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/curry-right}\n*/\nsetReadOnly( utils, 'curryRight', require( './../curry-right' ) );\n\n/**\n* @name decorateAfter\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/decorate-after}\n*/\nsetReadOnly( utils, 'decorateAfter', require( './../decorate-after' ) );\n\n/**\n* @name deepGet\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-get}\n*/\nsetReadOnly( utils, 'deepGet', require( './../deep-get' ) );\n\n/**\n* @name deepPluck\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-pluck}\n*/\nsetReadOnly( utils, 'deepPluck', require( './../deep-pluck' ) );\n\n/**\n* @name deepSet\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-set}\n*/\nsetReadOnly( utils, 'deepSet', require( './../deep-set' ) );\n\n/**\n* @name setConfigurableReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-only-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableReadOnlyAccessor', require( './../define-configurable-read-only-accessor' ) );\n\n/**\n* @name setConfigurableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-only-property}\n*/\nsetReadOnly( utils, 'setConfigurableReadOnly', require( './../define-configurable-read-only-property' ) );\n\n/**\n* @name setConfigurableReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-write-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableReadWriteAccessor', require( './../define-configurable-read-write-accessor' ) );\n\n/**\n* @name setConfigurableWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-write-only-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableWriteOnlyAccessor', require( './../define-configurable-write-only-accessor' ) );\n\n/**\n* @name setMemoizedConfigurableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-configurable-read-only-property}\n*/\nsetReadOnly( utils, 'setMemoizedConfigurableReadOnly', require( './../define-memoized-configurable-read-only-property' ) );\n\n/**\n* @name defineMemoizedProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-property}\n*/\nsetReadOnly( utils, 'defineMemoizedProperty', require( './../define-memoized-property' ) );\n\n/**\n* @name setMemoizedReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-read-only-property}\n*/\nsetReadOnly( utils, 'setMemoizedReadOnly', require( './../define-memoized-read-only-property' ) );\n\n/**\n* @name setNonEnumerableProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-property}\n*/\nsetReadOnly( utils, 'setNonEnumerableProperty', require( './../define-nonenumerable-property' ) );\n\n/**\n* @name setNonEnumerableReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-only-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadOnlyAccessor', require( './../define-nonenumerable-read-only-accessor' ) );\n\n/**\n* @name setNonEnumerableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-only-property}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadOnly', require( './../define-nonenumerable-read-only-property' ) );\n\n/**\n* @name setNonEnumerableReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-write-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadWriteAccessor', require( './../define-nonenumerable-read-write-accessor' ) );\n\n/**\n* @name setNonEnumerableWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-write-only-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableWriteOnlyAccessor', require( './../define-nonenumerable-write-only-accessor' ) );\n\n/**\n* @name defineProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-properties}\n*/\nsetReadOnly( utils, 'defineProperties', require( './../define-properties' ) );\n\n/**\n* @name defineProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-property}\n*/\nsetReadOnly( utils, 'defineProperty', require( './../define-property' ) );\n\n/**\n* @name setReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-only-accessor}\n*/\nsetReadOnly( utils, 'setReadOnlyAccessor', require( './../define-read-only-accessor' ) );\n\n/**\n* @name setReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-only-property}\n*/\nsetReadOnly( utils, 'setReadOnly', require( './../define-read-only-property' ) );\n\n/**\n* @name setReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-write-accessor}\n*/\nsetReadOnly( utils, 'setReadWriteAccessor', require( './../define-read-write-accessor' ) );\n\n/**\n* @name setWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-write-only-accessor}\n*/\nsetReadOnly( utils, 'setWriteOnlyAccessor', require( './../define-write-only-accessor' ) );\n\n/**\n* @name dirname\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/dirname}\n*/\nsetReadOnly( utils, 'dirname', require( './../dirname' ) );\n\n/**\n* @name doUntil\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until}\n*/\nsetReadOnly( utils, 'doUntil', require( './../do-until' ) );\n\n/**\n* @name doUntilEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until-each}\n*/\nsetReadOnly( utils, 'doUntilEach', require( './../do-until-each' ) );\n\n/**\n* @name doUntilEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until-each-right}\n*/\nsetReadOnly( utils, 'doUntilEachRight', require( './../do-until-each-right' ) );\n\n/**\n* @name doWhile\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while}\n*/\nsetReadOnly( utils, 'doWhile', require( './../do-while' ) );\n\n/**\n* @name doWhileEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while-each}\n*/\nsetReadOnly( utils, 'doWhileEach', require( './../do-while-each' ) );\n\n/**\n* @name doWhileEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while-each-right}\n*/\nsetReadOnly( utils, 'doWhileEachRight', require( './../do-while-each-right' ) );\n\n/**\n* @name DoublyLinkedList\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/doubly-linked-list}\n*/\nsetReadOnly( utils, 'DoublyLinkedList', require( './../doubly-linked-list' ) );\n\n/**\n* @name dsv\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/dsv}\n*/\nsetReadOnly( utils, 'dsv', require( './../dsv' ) );\n\n/**\n* @name objectEntries\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/entries}\n*/\nsetReadOnly( utils, 'objectEntries', require( './../entries' ) );\n\n/**\n* @name objectEntriesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/entries-in}\n*/\nsetReadOnly( utils, 'objectEntriesIn', require( './../entries-in' ) );\n\n/**\n* @name enumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-properties}\n*/\nsetReadOnly( utils, 'enumerableProperties', require( './../enumerable-properties' ) );\n\n/**\n* @name enumerablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-properties-in}\n*/\nsetReadOnly( utils, 'enumerablePropertiesIn', require( './../enumerable-properties-in' ) );\n\n/**\n* @name enumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-property-symbols}\n*/\nsetReadOnly( utils, 'enumerablePropertySymbols', require( './../enumerable-property-symbols' ) );\n\n/**\n* @name enumerablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-property-symbols-in}\n*/\nsetReadOnly( utils, 'enumerablePropertySymbolsIn', require( './../enumerable-property-symbols-in' ) );\n\n/**\n* @name rescape\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/escape-regexp-string}\n*/\nsetReadOnly( utils, 'rescape', require( './../escape-regexp-string' ) );\n\n/**\n* @name evil\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/eval}\n*/\nsetReadOnly( utils, 'evil', require( './../eval' ) );\n\n/**\n* @name every\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every}\n*/\nsetReadOnly( utils, 'every', require( './../every' ) );\n\n/**\n* @name everyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every-by}\n*/\nsetReadOnly( utils, 'everyBy', require( './../every-by' ) );\n\n/**\n* @name everyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every-by-right}\n*/\nsetReadOnly( utils, 'everyByRight', require( './../every-by-right' ) );\n\n/**\n* @name extname\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/extname}\n*/\nsetReadOnly( utils, 'extname', require( './../extname' ) );\n\n/**\n* @name FIFO\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/fifo}\n*/\nsetReadOnly( utils, 'FIFO', require( './../fifo' ) );\n\n/**\n* @name filterArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/filter-arguments}\n*/\nsetReadOnly( utils, 'filterArguments', require( './../filter-arguments' ) );\n\n/**\n* @name find\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/find}\n*/\nsetReadOnly( utils, 'find', require( './../find' ) );\n\n/**\n* @name flattenArray\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/flatten-array}\n*/\nsetReadOnly( utils, 'flattenArray', require( './../flatten-array' ) );\n\n/**\n* @name flattenObject\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/flatten-object}\n*/\nsetReadOnly( utils, 'flattenObject', require( './../flatten-object' ) );\n\n/**\n* @name forEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-each}\n*/\nsetReadOnly( utils, 'forEach', require( './../for-each' ) );\n\n/**\n* @name forEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-each-right}\n*/\nsetReadOnly( utils, 'forEachRight', require( './../for-each-right' ) );\n\n/**\n* @name forIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-in}\n*/\nsetReadOnly( utils, 'forIn', require( './../for-in' ) );\n\n/**\n* @name forOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-own}\n*/\nsetReadOnly( utils, 'forOwn', require( './../for-own' ) );\n\n/**\n* @name objectFromEntries\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/from-entries}\n*/\nsetReadOnly( utils, 'objectFromEntries', require( './../from-entries' ) );\n\n/**\n* @name functionName\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/function-name}\n*/\nsetReadOnly( utils, 'functionName', require( './../function-name' ) );\n\n/**\n* @name functionSequence\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/function-sequence}\n*/\nsetReadOnly( utils, 'functionSequence', require( './../function-sequence' ) );\n\n/**\n* @name getPrototypeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/get-prototype-of}\n*/\nsetReadOnly( utils, 'getPrototypeOf', require( './../get-prototype-of' ) );\n\n/**\n* @name getGlobal\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/global}\n*/\nsetReadOnly( utils, 'getGlobal', require( './../global' ) );\n\n/**\n* @name group\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group}\n*/\nsetReadOnly( utils, 'group', require( './../group' ) );\n\n/**\n* @name groupBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-by}\n*/\nsetReadOnly( utils, 'groupBy', require( './../group-by' ) );\n\n/**\n* @name groupIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-in}\n*/\nsetReadOnly( utils, 'groupIn', require( './../group-in' ) );\n\n/**\n* @name groupOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-own}\n*/\nsetReadOnly( utils, 'groupOwn', require( './../group-own' ) );\n\n/**\n* @name identity\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/identity-function}\n*/\nsetReadOnly( utils, 'identity', require( './../identity-function' ) );\n\n/**\n* @name ifelse\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/if-else}\n*/\nsetReadOnly( utils, 'ifelse', require( './../if-else' ) );\n\n/**\n* @name ifthen\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/if-then}\n*/\nsetReadOnly( utils, 'ifthen', require( './../if-then' ) );\n\n/**\n* @name indexOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/index-of}\n*/\nsetReadOnly( utils, 'indexOf', require( './../index-of' ) );\n\n/**\n* @name inherit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherit}\n*/\nsetReadOnly( utils, 'inherit', require( './../inherit' ) );\n\n/**\n* @name inheritedEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-enumerable-properties}\n*/\nsetReadOnly( utils, 'inheritedEnumerableProperties', require( './../inherited-enumerable-properties' ) );\n\n/**\n* @name inheritedEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-enumerable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedEnumerablePropertySymbols', require( './../inherited-enumerable-property-symbols' ) );\n\n/**\n* @name inheritedKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-keys}\n*/\nsetReadOnly( utils, 'inheritedKeys', require( './../inherited-keys' ) );\n\n/**\n* @name inheritedNonEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-properties}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerableProperties', require( './../inherited-nonenumerable-properties' ) );\n\n/**\n* @name inheritedNonEnumerablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-property-names}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerablePropertyNames', require( './../inherited-nonenumerable-property-names' ) );\n\n/**\n* @name inheritedNonEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerablePropertySymbols', require( './../inherited-nonenumerable-property-symbols' ) );\n\n/**\n* @name inheritedProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-properties}\n*/\nsetReadOnly( utils, 'inheritedProperties', require( './../inherited-properties' ) );\n\n/**\n* @name inheritedPropertyDescriptor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-descriptor}\n*/\nsetReadOnly( utils, 'inheritedPropertyDescriptor', require( './../inherited-property-descriptor' ) );\n\n/**\n* @name inheritedPropertyDescriptors\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-descriptors}\n*/\nsetReadOnly( utils, 'inheritedPropertyDescriptors', require( './../inherited-property-descriptors' ) );\n\n/**\n* @name inheritedPropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-names}\n*/\nsetReadOnly( utils, 'inheritedPropertyNames', require( './../inherited-property-names' ) );\n\n/**\n* @name inheritedPropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedPropertySymbols', require( './../inherited-property-symbols' ) );\n\n/**\n* @name inheritedWritableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-properties}\n*/\nsetReadOnly( utils, 'inheritedWritableProperties', require( './../inherited-writable-properties' ) );\n\n/**\n* @name inheritedWritablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-property-names}\n*/\nsetReadOnly( utils, 'inheritedWritablePropertyNames', require( './../inherited-writable-property-names' ) );\n\n/**\n* @name inheritedWritablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedWritablePropertySymbols', require( './../inherited-writable-property-symbols' ) );\n\n/**\n* @name inmap\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inmap}\n*/\nsetReadOnly( utils, 'inmap', require( './../inmap' ) );\n\n/**\n* @name inmapRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inmap-right}\n*/\nsetReadOnly( utils, 'inmapRight', require( './../inmap-right' ) );\n\n/**\n* @name keyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/key-by}\n*/\nsetReadOnly( utils, 'keyBy', require( './../key-by' ) );\n\n/**\n* @name keyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/key-by-right}\n*/\nsetReadOnly( utils, 'keyByRight', require( './../key-by-right' ) );\n\n/**\n* @name objectKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/keys}\n*/\nsetReadOnly( utils, 'objectKeys', require( './../keys' ) );\n\n/**\n* @name keysIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/keys-in}\n*/\nsetReadOnly( utils, 'keysIn', require( './../keys-in' ) );\n\n/**\n* @name LinkedList\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/linked-list}\n*/\nsetReadOnly( utils, 'LinkedList', require( './../linked-list' ) );\n\n/**\n* @name lowercaseKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/lowercase-keys}\n*/\nsetReadOnly( utils, 'lowercaseKeys', require( './../lowercase-keys' ) );\n\n/**\n* @name map\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map}\n*/\nsetReadOnly( utils, 'map', require( './../map' ) );\n\n/**\n* @name mapArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-arguments}\n*/\nsetReadOnly( utils, 'mapArguments', require( './../map-arguments' ) );\n\n/**\n* @name mapFun\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-function}\n*/\nsetReadOnly( utils, 'mapFun', require( './../map-function' ) );\n\n/**\n* @name mapKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-keys}\n*/\nsetReadOnly( utils, 'mapKeys', require( './../map-keys' ) );\n\n/**\n* @name mapReduce\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-reduce}\n*/\nsetReadOnly( utils, 'mapReduce', require( './../map-reduce' ) );\n\n/**\n* @name mapReduceRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-reduce-right}\n*/\nsetReadOnly( utils, 'mapReduceRight', require( './../map-reduce-right' ) );\n\n/**\n* @name mapRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-right}\n*/\nsetReadOnly( utils, 'mapRight', require( './../map-right' ) );\n\n/**\n* @name mapValues\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-values}\n*/\nsetReadOnly( utils, 'mapValues', require( './../map-values' ) );\n\n/**\n* @name map2\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2}\n*/\nsetReadOnly( utils, 'map2', require( './../map2' ) );\n\n/**\n* @name map2Right\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2-right}\n*/\nsetReadOnly( utils, 'map2Right', require( './../map2-right' ) );\n\n/**\n* @name map2d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2d}\n*/\nsetReadOnly( utils, 'map2d', require( './../map2d' ) );\n\n/**\n* @name map3d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map3d}\n*/\nsetReadOnly( utils, 'map3d', require( './../map3d' ) );\n\n/**\n* @name map4d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map4d}\n*/\nsetReadOnly( utils, 'map4d', require( './../map4d' ) );\n\n/**\n* @name map5d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map5d}\n*/\nsetReadOnly( utils, 'map5d', require( './../map5d' ) );\n\n/**\n* @name maskArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/mask-arguments}\n*/\nsetReadOnly( utils, 'maskArguments', require( './../mask-arguments' ) );\n\n/**\n* @name memoize\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/memoize}\n*/\nsetReadOnly( utils, 'memoize', require( './../memoize' ) );\n\n/**\n* @name merge\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/merge}\n*/\nsetReadOnly( utils, 'merge', require( './../merge' ) );\n\n/**\n* @name moveProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/move-property}\n*/\nsetReadOnly( utils, 'moveProperty', require( './../move-property' ) );\n\n/**\n* @name namedtypedtuple\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/named-typed-tuple}\n*/\nsetReadOnly( utils, 'namedtypedtuple', require( './../named-typed-tuple' ) );\n\n/**\n* @name naryFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nary-function}\n*/\nsetReadOnly( utils, 'naryFunction', require( './../nary-function' ) );\n\n/**\n* @name nativeClass\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/native-class}\n*/\nsetReadOnly( utils, 'nativeClass', require( './../native-class' ) );\n\n/**\n* @name nextTick\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/next-tick}\n*/\nsetReadOnly( utils, 'nextTick', require( './../next-tick' ) );\n\n/**\n* @name none\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none}\n*/\nsetReadOnly( utils, 'none', require( './../none' ) );\n\n/**\n* @name noneBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none-by}\n*/\nsetReadOnly( utils, 'noneBy', require( './../none-by' ) );\n\n/**\n* @name noneByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none-by-right}\n*/\nsetReadOnly( utils, 'noneByRight', require( './../none-by-right' ) );\n\n/**\n* @name nonEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-properties}\n*/\nsetReadOnly( utils, 'nonEnumerableProperties', require( './../nonenumerable-properties' ) );\n\n/**\n* @name nonEnumerablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-properties-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertiesIn', require( './../nonenumerable-properties-in' ) );\n\n/**\n* @name nonEnumerablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-names}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertyNames', require( './../nonenumerable-property-names' ) );\n\n/**\n* @name nonEnumerablePropertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-names-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertyNamesIn', require( './../nonenumerable-property-names-in' ) );\n\n/**\n* @name nonEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-symbols}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertySymbols', require( './../nonenumerable-property-symbols' ) );\n\n/**\n* @name nonEnumerablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-symbols-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertySymbolsIn', require( './../nonenumerable-property-symbols-in' ) );\n\n/**\n* @name nonIndexKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonindex-keys}\n*/\nsetReadOnly( utils, 'nonIndexKeys', require( './../nonindex-keys' ) );\n\n/**\n* @name noop\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/noop}\n*/\nsetReadOnly( utils, 'noop', require( './../noop' ) );\n\n/**\n* @name objectInverse\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/object-inverse}\n*/\nsetReadOnly( utils, 'objectInverse', require( './../object-inverse' ) );\n\n/**\n* @name objectInverseBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/object-inverse-by}\n*/\nsetReadOnly( utils, 'objectInverseBy', require( './../object-inverse-by' ) );\n\n/**\n* @name omit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/omit}\n*/\nsetReadOnly( utils, 'omit', require( './../omit' ) );\n\n/**\n* @name omitBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/omit-by}\n*/\nsetReadOnly( utils, 'omitBy', require( './../omit-by' ) );\n\n/**\n* @name openURL\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/open-url}\n*/\nsetReadOnly( utils, 'openURL', require( './../open-url' ) );\n\n/**\n* @name papply\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/papply}\n*/\nsetReadOnly( utils, 'papply', require( './../papply' ) );\n\n/**\n* @name papplyRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/papply-right}\n*/\nsetReadOnly( utils, 'papplyRight', require( './../papply-right' ) );\n\n/**\n* @name parallel\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/parallel}\n*/\nsetReadOnly( utils, 'parallel', require( './../parallel' ) );\n\n/**\n* @name parseJSON\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/parse-json}\n*/\nsetReadOnly( utils, 'parseJSON', require( './../parse-json' ) );\n\n/**\n* @name pick\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick}\n*/\nsetReadOnly( utils, 'pick', require( './../pick' ) );\n\n/**\n* @name pickArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick-arguments}\n*/\nsetReadOnly( utils, 'pickArguments', require( './../pick-arguments' ) );\n\n/**\n* @name pickBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick-by}\n*/\nsetReadOnly( utils, 'pickBy', require( './../pick-by' ) );\n\n/**\n* @name pluck\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pluck}\n*/\nsetReadOnly( utils, 'pluck', require( './../pluck' ) );\n\n/**\n* @name pop\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pop}\n*/\nsetReadOnly( utils, 'pop', require( './../pop' ) );\n\n/**\n* @name prepend\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/prepend}\n*/\nsetReadOnly( utils, 'prepend', require( './../prepend' ) );\n\n/**\n* @name properties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/properties}\n*/\nsetReadOnly( utils, 'properties', require( './../properties' ) );\n\n/**\n* @name propertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/properties-in}\n*/\nsetReadOnly( utils, 'propertiesIn', require( './../properties-in' ) );\n\n/**\n* @name propertyDescriptor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptor}\n*/\nsetReadOnly( utils, 'propertyDescriptor', require( './../property-descriptor' ) );\n\n/**\n* @name propertyDescriptorIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptor-in}\n*/\nsetReadOnly( utils, 'propertyDescriptorIn', require( './../property-descriptor-in' ) );\n\n/**\n* @name propertyDescriptors\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptors}\n*/\nsetReadOnly( utils, 'propertyDescriptors', require( './../property-descriptors' ) );\n\n/**\n* @name propertyDescriptorsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptors-in}\n*/\nsetReadOnly( utils, 'propertyDescriptorsIn', require( './../property-descriptors-in' ) );\n\n/**\n* @name propertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-names}\n*/\nsetReadOnly( utils, 'propertyNames', require( './../property-names' ) );\n\n/**\n* @name propertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-names-in}\n*/\nsetReadOnly( utils, 'propertyNamesIn', require( './../property-names-in' ) );\n\n/**\n* @name propertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-symbols}\n*/\nsetReadOnly( utils, 'propertySymbols', require( './../property-symbols' ) );\n\n/**\n* @name propertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-symbols-in}\n*/\nsetReadOnly( utils, 'propertySymbolsIn', require( './../property-symbols-in' ) );\n\n/**\n* @name push\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/push}\n*/\nsetReadOnly( utils, 'push', require( './../push' ) );\n\n/**\n* @name realmax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/real-max}\n*/\nsetReadOnly( utils, 'realmax', require( './../real-max' ) );\n\n/**\n* @name realmin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/real-min}\n*/\nsetReadOnly( utils, 'realmin', require( './../real-min' ) );\n\n/**\n* @name reduce\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce}\n*/\nsetReadOnly( utils, 'reduce', require( './../reduce' ) );\n\n/**\n* @name reduceRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce-right}\n*/\nsetReadOnly( utils, 'reduceRight', require( './../reduce-right' ) );\n\n/**\n* @name reduce2d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce2d}\n*/\nsetReadOnly( utils, 'reduce2d', require( './../reduce2d' ) );\n\n/**\n* @name reFromString\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/regexp-from-string}\n*/\nsetReadOnly( utils, 'reFromString', require( './../regexp-from-string' ) );\n\n/**\n* @name rejectArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reject-arguments}\n*/\nsetReadOnly( utils, 'rejectArguments', require( './../reject-arguments' ) );\n\n/**\n* @name reorderArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reorder-arguments}\n*/\nsetReadOnly( utils, 'reorderArguments', require( './../reorder-arguments' ) );\n\n/**\n* @name reverseArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reverse-arguments}\n*/\nsetReadOnly( utils, 'reverseArguments', require( './../reverse-arguments' ) );\n\n/**\n* @name safeintmax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/safe-int-max}\n*/\nsetReadOnly( utils, 'safeintmax', require( './../safe-int-max' ) );\n\n/**\n* @name safeintmin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/safe-int-min}\n*/\nsetReadOnly( utils, 'safeintmin', require( './../safe-int-min' ) );\n\n/**\n* @name shift\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/shift}\n*/\nsetReadOnly( utils, 'shift', require( './../shift' ) );\n\n/**\n* @name sizeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/size-of}\n*/\nsetReadOnly( utils, 'sizeOf', require( './../size-of' ) );\n\n/**\n* @name some\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some}\n*/\nsetReadOnly( utils, 'some', require( './../some' ) );\n\n/**\n* @name someBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some-by}\n*/\nsetReadOnly( utils, 'someBy', require( './../some-by' ) );\n\n/**\n* @name someByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some-by-right}\n*/\nsetReadOnly( utils, 'someByRight', require( './../some-by-right' ) );\n\n/**\n* @name Stack\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/stack}\n*/\nsetReadOnly( utils, 'Stack', require( './../stack' ) );\n\n/**\n* @name tabulate\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/tabulate}\n*/\nsetReadOnly( utils, 'tabulate', require( './../tabulate' ) );\n\n/**\n* @name tabulateBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/tabulate-by}\n*/\nsetReadOnly( utils, 'tabulateBy', require( './../tabulate-by' ) );\n\n/**\n* @name thunk\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/thunk}\n*/\nsetReadOnly( utils, 'thunk', require( './../thunk' ) );\n\n/**\n* @name timeit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/timeit}\n*/\nsetReadOnly( utils, 'timeit', require( './../timeit' ) );\n\n/**\n* @name trycatch\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-catch}\n*/\nsetReadOnly( utils, 'trycatch', require( './../try-catch' ) );\n\n/**\n* @name tryFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-function}\n*/\nsetReadOnly( utils, 'tryFunction', require( './../try-function' ) );\n\n/**\n* @name tryRequire\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-require}\n*/\nsetReadOnly( utils, 'tryRequire', require( './../try-require' ) );\n\n/**\n* @name trythen\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-then}\n*/\nsetReadOnly( utils, 'trythen', require( './../try-then' ) );\n\n/**\n* @name typemax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-max}\n*/\nsetReadOnly( utils, 'typemax', require( './../type-max' ) );\n\n/**\n* @name typemin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-min}\n*/\nsetReadOnly( utils, 'typemin', require( './../type-min' ) );\n\n/**\n* @name typeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-of}\n*/\nsetReadOnly( utils, 'typeOf', require( './../type-of' ) );\n\n/**\n* @name uncapitalizeKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncapitalize-keys}\n*/\nsetReadOnly( utils, 'uncapitalizeKeys', require( './../uncapitalize-keys' ) );\n\n/**\n* @name uncurry\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncurry}\n*/\nsetReadOnly( utils, 'uncurry', require( './../uncurry' ) );\n\n/**\n* @name uncurryRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncurry-right}\n*/\nsetReadOnly( utils, 'uncurryRight', require( './../uncurry-right' ) );\n\n/**\n* @name unshift\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/unshift}\n*/\nsetReadOnly( utils, 'unshift', require( './../unshift' ) );\n\n/**\n* @name until\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until}\n*/\nsetReadOnly( utils, 'until', require( './../until' ) );\n\n/**\n* @name untilEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until-each}\n*/\nsetReadOnly( utils, 'untilEach', require( './../until-each' ) );\n\n/**\n* @name untilEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until-each-right}\n*/\nsetReadOnly( utils, 'untilEachRight', require( './../until-each-right' ) );\n\n/**\n* @name unzip\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/unzip}\n*/\nsetReadOnly( utils, 'unzip', require( './../unzip' ) );\n\n/**\n* @name uppercaseKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uppercase-keys}\n*/\nsetReadOnly( utils, 'uppercaseKeys', require( './../uppercase-keys' ) );\n\n/**\n* @name objectValues\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/values}\n*/\nsetReadOnly( utils, 'objectValues', require( './../values' ) );\n\n/**\n* @name objectValuesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/values-in}\n*/\nsetReadOnly( utils, 'objectValuesIn', require( './../values-in' ) );\n\n/**\n* @name whilst\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while}\n*/\nsetReadOnly( utils, 'whilst', require( './../while' ) );\n\n/**\n* @name whileEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while-each}\n*/\nsetReadOnly( utils, 'whileEach', require( './../while-each' ) );\n\n/**\n* @name whileEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while-each-right}\n*/\nsetReadOnly( utils, 'whileEachRight', require( './../while-each-right' ) );\n\n/**\n* @name writableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-properties}\n*/\nsetReadOnly( utils, 'writableProperties', require( './../writable-properties' ) );\n\n/**\n* @name writablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-properties-in}\n*/\nsetReadOnly( utils, 'writablePropertiesIn', require( './../writable-properties-in' ) );\n\n/**\n* @name writablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-names}\n*/\nsetReadOnly( utils, 'writablePropertyNames', require( './../writable-property-names' ) );\n\n/**\n* @name writablePropertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-names-in}\n*/\nsetReadOnly( utils, 'writablePropertyNamesIn', require( './../writable-property-names-in' ) );\n\n/**\n* @name writablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-symbols}\n*/\nsetReadOnly( utils, 'writablePropertySymbols', require( './../writable-property-symbols' ) );\n\n/**\n* @name writablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-symbols-in}\n*/\nsetReadOnly( utils, 'writablePropertySymbolsIn', require( './../writable-property-symbols-in' ) );\n\n/**\n* @name zip\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/zip}\n*/\nsetReadOnly( utils, 'zip', require( './../zip' ) );\n\n\n// EXPORTS //\n\nmodule.exports = utils;\n"], - "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAS,OAAO,OAAO,gBAAmB,WAAe,OAAO,eAAiB,KAKrFD,GAAO,QAAUC,KC3BjB,IAAAC,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAiB,KAerB,SAASC,IAA2B,CAEnC,GAAI,CACH,OAAAD,GAAgB,CAAC,EAAG,IAAK,CAAC,CAAE,EACrB,EACR,OAAUE,EAAM,CACf,MAAO,EACR,CACD,CAKAH,GAAO,QAAUE,KClDjB,IAAAE,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAuDA,IAAIC,GAAiB,OAAO,eAK5BD,GAAO,QAAUC,KC5DjB,IAAAC,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAwBA,IAAIC,GAAS,QAAS,uBAAwB,EA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,EASlED,EAAaC,EAAO,SAAU,IAAwB,EAStDD,EAAaC,EAAO,YAAa,IAA6B,EAS9DD,EAAaC,EAAO,iBAAkB,IAAmC,EASzED,EAAaC,EAAO,qBAAsB,IAAsC,EAShFD,EAAaC,EAAO,uBAAwB,IAAyC,EASrFD,EAAaC,EAAO,wBAAyB,IAA0C,EASvFD,EAAaC,EAAO,0BAA2B,IAA6C,EAS5FD,EAAaC,EAAO,0BAA2B,IAA4C,EAS3FD,EAAaC,EAAO,4BAA6B,IAA+C,EAShGD,EAAaC,EAAO,MAAO,IAAsB,EAKjD,OAAO,QAAUA", - "names": ["require_define_property", "__commonJSMin", "exports", "module", "main", "require_has_define_property_support", "__commonJSMin", "exports", "module", "defineProperty", "hasDefinePropertySupport", "err", "require_builtin", "__commonJSMin", "exports", "module", "defineProperty", "require_polyfill", "__commonJSMin", "exports", "module", "format", "objectProtoype", "toStr", "defineGetter", "defineSetter", "lookupGetter", "lookupSetter", "defineProperty", "obj", "prop", "descriptor", "prototype", "hasValue", "hasGet", "hasSet", "require_lib", "__commonJSMin", "exports", "module", "hasDefinePropertySupport", "builtin", "polyfill", "defineProperty", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "format", "any", "collection", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "anyBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "anyByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_append_array", "__commonJSMin", "exports", "module", "append", "arr", "items", "i", "require_append_object", "__commonJSMin", "exports", "module", "append", "obj", "items", "len", "require_append_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "append", "arr", "items", "nbytes", "ibytes", "total", "len", "buf", "n", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isCollection", "isTypedArrayLike", "isInteger", "format", "appendArray", "appendObject", "appendTypedArray", "append", "collection1", "collection2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "wrap", "idx", "argn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "anyByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "anyByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "anyByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "anyByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isnan", "isCollection", "isString", "isInteger", "format", "indexOf", "arr", "searchElement", "fromIndex", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "indexOf", "format", "returns", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "bool", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "bifurcateByAsync", "collection", "done", "clbk", "error", "results", "require_main", "__commonJSMin", "exports", "module", "factory", "bifurcateByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "composeAsync", "nFuncs", "f", "i", "composite", "done", "args", "next", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "hasOwnProp", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "countByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "countByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doUntilAsync", "fcn", "predicate", "done", "thisArg", "args", "idx", "next", "error", "i", "onPredicate", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doWhileAsync", "fcn", "predicate", "done", "thisArg", "args", "idx", "next", "error", "i", "onPredicate", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "PINF", "format", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "everyByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "everyByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "PINF", "format", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "everyByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "everyByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "forEachAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "forEachAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "forEachRightAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "forEachRightAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "funseqAsync", "nFuncs", "f", "i", "pipeline", "done", "args", "next", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "indexOf", "format", "returns", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "hasOwnProp", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "groupByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "groupByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifelseAsync", "predicate", "x", "y", "done", "clbk", "error", "bool", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifthenAsync", "predicate", "x", "y", "done", "clbk1", "error", "bool", "clbk2", "nargs", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "inmapAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "inmapAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "inmapRightAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "inmapRightAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "n", "opts", "fcn", "done", "count", "flg", "out", "lim", "idx", "m", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "mapFunAsync", "n", "done", "clbk", "error", "results", "require_main", "__commonJSMin", "exports", "module", "factory", "mapFunAsync", "fcn", "n", "options", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_builtin", "__commonJSMin", "exports", "module", "keys", "value", "require_has_arguments_bug", "__commonJSMin", "exports", "module", "keys", "test", "check", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin_wrapper", "__commonJSMin", "exports", "module", "isArguments", "builtin", "slice", "keys", "value", "require_main", "__commonJSMin", "exports", "module", "noop", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_enumerable_prototype_bug", "__commonJSMin", "exports", "module", "isEnumerableProperty", "noop", "bool", "require_has_non_enumerable_properties_bug", "__commonJSMin", "exports", "module", "isEnumerableProperty", "obj", "bool", "require_re", "__commonJSMin", "exports", "module", "RE", "require_codegen", "__commonJSMin", "exports", "module", "getGlobal", "require_self", "__commonJSMin", "exports", "module", "obj", "require_window", "__commonJSMin", "exports", "module", "obj", "require_global", "__commonJSMin", "exports", "module", "obj", "require_global_this", "__commonJSMin", "exports", "module", "obj", "require_main", "__commonJSMin", "exports", "module", "isBoolean", "format", "getThis", "Self", "Win", "Global", "GlobalThis", "getGlobal", "codegen", "require_lib", "__commonJSMin", "exports", "module", "main", "require_nodelist", "__commonJSMin", "exports", "module", "getGlobal", "root", "nodeList", "require_typedarray", "__commonJSMin", "exports", "module", "typedarray", "require_check", "__commonJSMin", "exports", "module", "RE", "nodeList", "typedarray", "check", "require_tostring", "__commonJSMin", "exports", "module", "toStr", "require_main", "__commonJSMin", "exports", "module", "toStr", "nativeClass", "v", "require_tostringtag", "__commonJSMin", "exports", "module", "Symbol", "toStrTag", "require_polyfill", "__commonJSMin", "exports", "module", "hasOwnProp", "toStringTag", "toStr", "nativeClass", "v", "isOwn", "tag", "out", "err", "require_lib", "__commonJSMin", "exports", "module", "hasToStringTag", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "nativeClass", "RE", "isBuffer", "constructorName", "v", "match", "name", "ctor", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "ctorName", "typeOf", "v", "type", "require_polyfill", "__commonJSMin", "exports", "module", "ctorName", "typeOf", "v", "require_lib", "__commonJSMin", "exports", "module", "usePolyfill", "builtin", "polyfill", "main", "require_is_constructor_prototype", "__commonJSMin", "exports", "module", "isConstructorPrototype", "value", "require_excluded_keys", "__commonJSMin", "exports", "module", "require_window", "__commonJSMin", "exports", "module", "w", "require_has_automation_equality_bug", "__commonJSMin", "exports", "module", "hasOwnProp", "indexOf", "typeOf", "isConstructorPrototype", "EXCLUDED_KEYS", "win", "bool", "check", "k", "err", "require_has_window", "__commonJSMin", "exports", "module", "bool", "require_is_constructor_prototype_wrapper", "__commonJSMin", "exports", "module", "hasAutomationEqualityBug", "isConstructorPrototype", "HAS_WINDOW", "wrapper", "value", "error", "require_non_enumerable", "__commonJSMin", "exports", "module", "require_polyfill", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "isArguments", "HAS_ENUM_PROTO_BUG", "HAS_NON_ENUM_PROPS_BUG", "isConstructorPrototype", "NON_ENUMERABLE", "keys", "value", "skipConstructor", "skipPrototype", "isFcn", "out", "k", "p", "i", "require_main", "__commonJSMin", "exports", "module", "hasArgumentsBug", "HAS_BUILTIN", "builtin", "wrapper", "polyfill", "keys", "require_lib", "__commonJSMin", "exports", "module", "main", "require_limit", "__commonJSMin", "exports", "module", "logger", "objectKeys", "debug", "limit", "obj", "opts", "fcn", "done", "maxIndex", "count", "keys", "flg", "lim", "len", "idx", "out", "i", "next", "value", "key", "cb", "error", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "format", "PINF", "validate", "limit", "factory", "options", "transform", "opts", "err", "f", "mapKeysAsync", "obj", "done", "clbk", "error", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "mapKeysAsync", "obj", "options", "transform", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "objectKeys", "debug", "limit", "obj", "opts", "fcn", "done", "maxIndex", "count", "keys", "flg", "lim", "len", "idx", "out", "i", "next", "key", "cb", "error", "value", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "format", "PINF", "validate", "limit", "factory", "options", "transform", "opts", "err", "f", "mapValuesAsync", "obj", "done", "clbk", "error", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "mapValuesAsync", "obj", "options", "transform", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "noneByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "noneByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "noneByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "noneByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "acc", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "reduceAsync", "collection", "initial", "done", "clbk", "error", "acc", "require_main", "__commonJSMin", "exports", "module", "factory", "reduceAsync", "collection", "initial", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "acc", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "reduceRightAsync", "collection", "initial", "done", "clbk", "error", "acc", "require_main", "__commonJSMin", "exports", "module", "factory", "reduceRightAsync", "collection", "initial", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "isFunctionArray", "isFunction", "format", "factory", "fcns", "clbk", "thisArg", "waterfall", "idx", "next", "args", "len", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "waterfall", "fcns", "clbk", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "n", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "cnt", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "isPositiveInteger", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "someByAsync", "collection", "n", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "someByAsync", "collection", "n", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "n", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "cnt", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "someByRightAsync", "collection", "n", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "someByRightAsync", "collection", "n", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "indexOf", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "tmp", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "tabulateByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "tabulateByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trycatchAsync", "x", "y", "done", "clbk", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trythenAsync", "x", "y", "done", "clbk1", "error", "nargs", "args", "i", "clbk2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "untilAsync", "predicate", "fcn", "done", "thisArg", "args", "idx", "onPredicate", "error", "result", "next", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "whileAsync", "predicate", "fcn", "done", "thisArg", "args", "idx", "onPredicate", "error", "result", "next", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "returnValues", "returnIndices", "returnPairs", "format", "validate", "bifurcate", "collection", "options", "filter", "opts", "err", "f", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "v", "i", "require_return_indices", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "i", "require_return_pairs", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "validate", "returnValues", "returnIndices", "returnPairs", "bifurcateBy", "collection", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_return_keys", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "require_return_pairs", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "bifurcateIn", "obj", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "bifurcateOwn", "obj", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "capitalizeKeys", "obj", "out", "key", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "MAX_ITERATIONS", "arraylike2object", "format", "CircularBuffer", "buffer", "buf", "i", "niters", "iter", "self", "FLG", "N", "n", "next", "end", "factory", "value", "set", "get", "v", "out", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "hasOwnProp", "commonKeys", "nargs", "keys", "arg", "ptr", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "keysIn", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "keysIn", "hasProp", "commonKeysIn", "nargs", "keys", "arg", "ptr", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_from_adjacency_list_iterator", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIterator", "it", "out", "v", "z", "require_from_adjacency_list_iterator_map", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_edges_iterator", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIterator", "it", "out", "v", "z", "require_from_edges_iterator_map", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_set_bit", "__commonJSMin", "exports", "module", "setBit", "value", "i", "require_clear_bit", "__commonJSMin", "exports", "module", "clearBit", "value", "i", "require_is_set", "__commonJSMin", "exports", "module", "Boolean", "isSet", "value", "i", "require_bit_value", "__commonJSMin", "exports", "module", "bitValue", "value", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isFunction", "isObject", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "Int32Array", "Int8Array", "format", "ceil", "floor", "grev", "fromIteratorAdjList", "fromIteratorAdjListMap", "fromIteratorEdges", "fromIteratorEdgesMap", "setBit", "clearBit", "isSet", "bitValue", "HAS_ITERATOR_SYMBOL", "NBITS", "CompactAdjacencyMatrix", "N", "list", "thisArg", "nargs", "edges", "clbk", "adj", "tmp", "len", "i", "j", "edge", "out", "bucket", "bit", "idx", "deg", "marks", "self", "err", "visit", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "compose", "nFuncs", "f", "i", "composite", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "wrap", "value", "constantFunction", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "reExtendedLengthPath", "lowercase", "replace", "format", "RE_WIN_DEVICE_ROOT", "RE_POSIX_DEVICE_ROOT", "convertPath", "from", "to", "device", "parts", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "reRegExp", "format", "reFromString", "str", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertyNames", "getOwnPropertyNames", "value", "require_polyfill", "__commonJSMin", "exports", "module", "Object", "keys", "getOwnPropertyNames", "value", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "propertyDescriptor", "getOwnPropertyDescriptor", "value", "property", "desc", "require_polyfill", "__commonJSMin", "exports", "module", "hasOwnProp", "getOwnPropertyDescriptor", "value", "property", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_native", "__commonJSMin", "exports", "module", "getProto", "require_proto", "__commonJSMin", "exports", "module", "getProto", "obj", "require_polyfill", "__commonJSMin", "exports", "module", "nativeClass", "getProto", "getPrototypeOf", "obj", "proto", "require_detect", "__commonJSMin", "exports", "module", "isFunction", "builtin", "polyfill", "getProto", "require_main", "__commonJSMin", "exports", "module", "Object", "getProto", "getPrototypeOf", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_typed_arrays", "__commonJSMin", "exports", "module", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "hash", "int8array", "arr", "uint8array", "uint8clampedarray", "int16array", "uint16array", "int32array", "uint32array", "float32array", "float64array", "typedarrays", "out", "require_deep_copy", "__commonJSMin", "exports", "module", "hasOwnProp", "isArray", "isBuffer", "isError", "typeOf", "regexp", "indexOf", "objectKeys", "propertyNames", "propertyDescriptor", "getPrototypeOf", "defineProperty", "copyBuffer", "typedArrays", "cloneInstance", "val", "cache", "names", "name", "refs", "desc", "tmp", "ref", "i", "deepCopy", "copyError", "error", "keys", "key", "err", "copy", "level", "parent", "ctor", "x", "j", "require_main", "__commonJSMin", "exports", "module", "isArray", "isNonNegativeInteger", "format", "PINF", "deepCopy", "copy", "value", "level", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "hasOwnProp", "format", "validate", "countBy", "collection", "options", "indicator", "thisArg", "opts", "err", "out", "len", "cb", "g", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "curry", "fcn", "arity", "thisArg", "context", "len", "createCurried", "args", "curried", "v", "cargs", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "curryRight", "fcn", "arity", "thisArg", "context", "len", "createCurried", "args", "curried", "v", "cargs", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "apply", "fcn", "args", "after", "thisArg", "r1", "r2", "decorateAfter", "arity", "fcns", "f", "fN", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "i", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "reNativeFunction", "function2string", "Fcn", "format", "RE_PARAMETERS", "decorateAfter", "fcn", "arity", "after", "thisArg", "params", "str", "len", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_dget", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "deepGet", "obj", "props", "len", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isString", "isArray", "format", "validate", "defaults", "dget", "deepGet", "obj", "path", "options", "isStr", "props", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isString", "isArray", "isObjectLike", "format", "validate", "defaults", "dget", "factory", "path", "options", "isStr", "props", "opts", "err", "deepGet", "obj", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isBoolean", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "deepGet", "isArray", "format", "defaults", "validate", "deepPluck", "arr", "path", "options", "dget", "opts", "out", "err", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isBoolean", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_dset", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "isFunction", "deepSet", "obj", "props", "create", "val", "bool", "len", "v", "p", "i", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isString", "isArray", "format", "validate", "defaults", "dset", "deepSet", "obj", "path", "value", "options", "isStr", "props", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isString", "isArray", "isObjectLike", "format", "validate", "defaults", "dset", "factory", "path", "options", "isStr", "props", "opts", "err", "deepSet", "obj", "value", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineProperty", "format", "defineMemoizedProperty", "obj", "prop", "desc", "getter", "memoize", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineMemoizedProperty", "format", "setMemoizedConfigurableReadOnly", "obj", "prop", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineMemoizedProperty", "format", "setMemoizedReadOnly", "obj", "prop", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableProperty", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_builtin", "__commonJSMin", "exports", "module", "defineProperties", "require_polyfill", "__commonJSMin", "exports", "module", "isObject", "objectKeys", "defineProperty", "format", "defineProperties", "obj", "props", "keys", "name", "i", "require_lib", "__commonJSMin", "exports", "module", "hasDefinePropertiesSupport", "builtin", "polyfill", "defineProperties", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "format", "RE_DIRNAME", "dirname", "path", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doUntil", "fcn", "predicate", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doUntilEach", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doUntilEachRight", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doWhile", "fcn", "predicate", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doWhileEach", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doWhileEachRight", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "defineProperty", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "format", "Node", "DoublyLinkedList", "node", "value", "location", "loc", "n", "direction", "values", "iter", "self", "FLG", "dir", "inc", "i", "next", "end", "factory", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "format", "RE_CHARS", "rescape", "str", "len", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "noop", "throwError", "err", "defaults", "require_enum2state", "__commonJSMin", "exports", "module", "require_state2enum", "__commonJSMin", "exports", "module", "enum2state", "table", "out", "i", "state2enum", "require_closed", "__commonJSMin", "exports", "module", "state2enum", "CLOSED", "processor", "parser", "next", "require_comment", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "processor", "parser", "newlineLastIndex", "newline", "next", "ch", "require_error", "__commonJSMin", "exports", "module", "state2enum", "ERROR", "processor", "parser", "next", "require_max", "__commonJSMin", "exports", "module", "max", "x", "y", "require_escape", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "ERROR", "FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "skipLastIndex", "escapeLength", "delimiter", "newline", "comment", "escape", "strict", "skip", "max", "next", "ch", "cursor", "idx", "d", "require_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ESCAPE", "FIELD", "INIT", "QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "escapeLastIndex", "quoteLastIndex", "delimiter", "newline", "quoting", "escape", "strict", "quote", "next", "ch", "idx", "require_init", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "COMMENT", "FIELD", "ESCAPE", "INIT", "QUOTED_FIELD", "SKIP", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "quoteLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "quoting", "escape", "strict", "quote", "skip", "next", "ch", "idx", "require_invalid_quote_end", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ERROR", "FIELD", "INIT", "removeWhitespace", "parser", "state", "processor", "delimiterLastIndex", "newlineLastIndex", "delimiter", "newline", "next", "ch", "require_quote_end", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "ERROR", "FIELD", "INIT", "INVALID_QUOTE_END", "QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "quoteLastIndex", "doublequote", "delimiter", "newline", "strict", "quote", "max", "next", "ch", "require_quoted_escape", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ERROR", "QUOTED_FIELD", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "escapeLength", "strict", "quote", "next", "ch", "cursor", "idx", "d", "require_quoted_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "QUOTE_END", "QUOTED_ESCAPE", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "doublequote", "escape", "quote", "next", "ch", "require_skip", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "SKIP", "SKIPPED_COMMENT", "SKIPPED_FIELD", "SKIPPED_ESCAPE", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "quoteLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "quoting", "escape", "strict", "quote", "skip", "next", "ch", "idx", "require_skipped_comment", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "processor", "parser", "newlineLastIndex", "newline", "next", "ch", "require_skipped_escape", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "SKIPPED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "escape", "skip", "max", "next", "ch", "cursor", "idx", "d", "require_skipped_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "SKIPPED_ESCAPE", "SKIPPED_FIELD", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "escapeLastIndex", "quoteLastIndex", "delimiter", "newline", "quoting", "escape", "strict", "quote", "next", "ch", "idx", "require_skipped_invalid_quote_end", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_FIELD", "INIT", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "delimiter", "newline", "next", "ch", "require_skipped_quote_end", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "INIT", "SKIPPED_FIELD", "SKIPPED_INVALID_QUOTE_END", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "quoteLastIndex", "doublequote", "delimiter", "newline", "quote", "max", "next", "ch", "require_skipped_quoted_escape", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_QUOTED_FIELD", "processor", "parser", "quoteLastIndex", "quote", "next", "ch", "cursor", "idx", "d", "require_skipped_quoted_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_QUOTE_END", "SKIPPED_QUOTED_ESCAPE", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "doublequote", "escape", "quote", "next", "ch", "require_states", "__commonJSMin", "exports", "module", "enum2state", "closed", "comment", "error", "escape", "field", "init", "invalidQuoteEnd", "quoteEnd", "quotedEscape", "quotedField", "skip", "skippedComment", "skippedEscape", "skippedField", "skippedInvalidQuoteEnd", "skippedQuoteEnd", "skippedQuotedEscape", "skippedQuotedField", "table", "states", "parser", "out", "i", "require_main", "__commonJSMin", "exports", "module", "logger", "setReadOnly", "setReadOnlyAccessor", "Boolean", "format", "rescape", "replace", "defaults", "state2enum", "enum2state", "states", "debug", "CLOSED", "COMMENT", "ERROR", "ESCAPE", "FIELD", "INIT", "INVALID_QUOTE_END", "QUOTE_END", "QUOTED_ESCAPE", "QUOTED_FIELD", "SKIP", "SKIPPED_COMMENT", "SKIPPED_ESCAPE", "SKIPPED_FIELD", "SKIPPED_INVALID_QUOTE_END", "SKIPPED_QUOTE_END", "SKIPPED_QUOTED_ESCAPE", "SKIPPED_QUOTED_FIELD", "array2pattern", "list", "pattern", "i", "Parser", "options", "opts", "ch", "buf", "N", "target", "start", "end", "value", "idx", "v", "search", "name", "err", "state", "chunk", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isObjectLike", "format", "objectEntries", "obj", "keys", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "objectEntriesIn", "obj", "key", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertySymbols", "getOwnPropertySymbols", "value", "require_polyfill", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "keys", "propertySymbols", "isEnumerable", "enumerableProperties", "value", "out", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isEnumerable", "Object", "enumerablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isEnumerableProperty", "Object", "enumerablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isEnumerableProperty", "hasOwnProp", "Object", "enumerablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "evil", "require_main", "__commonJSMin", "exports", "module", "isCollection", "format", "every", "collection", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "everyBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "everyByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "RE_EXTNAME", "format", "extname", "filename", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Node", "FIFO", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "value", "node", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "filterArguments", "fcn", "predicate", "thisArg", "wrap", "args", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_find", "__commonJSMin", "exports", "module", "isFunction", "isInteger", "isObject", "isString", "isCollection", "hasOwnProp", "indexOf", "format", "RETURNS", "find", "arr", "options", "clbk", "count", "mode", "opts", "len", "out", "ret", "cb", "i", "k", "v", "require_lib", "__commonJSMin", "exports", "module", "find", "require_defaults", "__commonJSMin", "exports", "module", "FLOAT64_MAX", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_recurse", "__commonJSMin", "exports", "module", "isArrayLikeObject", "recurse", "out", "arr", "depth", "v", "i", "require_main", "__commonJSMin", "exports", "module", "copy", "isArrayLikeObject", "format", "defaults", "validate", "recurse", "flattenArray", "arr", "options", "opts", "err", "out", "require_gen_fcn", "__commonJSMin", "exports", "module", "Fcn", "genFcn", "dims", "len", "n", "f", "i", "require_wrap_flatten", "__commonJSMin", "exports", "module", "isArrayLikeObject", "format", "wrap", "flatten", "flattenArray", "arr", "require_wrap_flatten_copy", "__commonJSMin", "exports", "module", "isArrayLikeObject", "format", "copy", "wrap", "flatten", "flattenArray", "arr", "require_factory", "__commonJSMin", "exports", "module", "isPositiveIntegerArray", "isObject", "hasOwnProp", "isBoolean", "format", "defaults", "genFcn", "wrapFlatten", "wrapFlattenCopy", "factory", "dims", "options", "copyFLG", "flatten", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "FLOAT64_MAX", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isString", "isBoolean", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_recurse", "__commonJSMin", "exports", "module", "objectKeys", "isPlainObject", "isArray", "recurse", "out", "obj", "prefix", "depth", "opts", "keys", "val", "key", "i", "require_flatten", "__commonJSMin", "exports", "module", "copy", "recurse", "flatten", "obj", "opts", "out", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "defaults", "validate", "flatten", "flattenObject", "obj", "options", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isObjectLike", "format", "defaults", "validate", "flatten", "factory", "options", "opts", "err", "flattenObject", "obj", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "forEach", "collection", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "forEachRight", "collection", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "forIn", "obj", "fcn", "thisArg", "bool", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "forOwn", "obj", "fcn", "thisArg", "keys", "bool", "len", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayArray", "format", "objectFromEntries", "entries", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasFunctionNameSupport", "format", "RE", "isFunctionNameSupported", "functionName", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "funseq", "nFuncs", "f", "i", "pipeline", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "returnValues", "returnIndices", "returnPairs", "format", "validate", "group", "collection", "options", "groups", "opts", "err", "g", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "v", "i", "require_return_indices", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "i", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "validate", "returnValues", "returnIndices", "returnPairs", "groupBy", "collection", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "g", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "groupIn", "obj", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "g", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "groupOwn", "obj", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "identity", "x", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "ifelse", "bool", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifthen", "bool", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "format", "validate", "value", "type", "require_native", "__commonJSMin", "exports", "module", "require_polyfill", "__commonJSMin", "exports", "module", "Ctor", "createObject", "proto", "require_detect", "__commonJSMin", "exports", "module", "builtin", "polyfill", "createObject", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "format", "validate", "createObject", "inherit", "ctor", "superCtor", "err", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isEnumerableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedEnumerableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isEnumerableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedEnumerablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyNames", "getPrototypeOf", "isEnumerable", "hasOwnProp", "format", "inheritedKeys", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerablePropertyNames", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertySymbols", "propertyNames", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedProperties", "value", "level", "out", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyDescriptor", "getPrototypeOf", "format", "inheritedPropertyDescriptor", "value", "property", "level", "desc", "obj", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertyDescriptors", "getOwnPropertyDescriptors", "value", "require_polyfill", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "propertyDescriptor", "defineProperty", "getOwnPropertyDescriptors", "value", "symbols", "names", "desc", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyDescriptors", "getOwnPropertySymbols", "getPrototypeOf", "objectKeys", "defineProperty", "hasOwnProp", "format", "inheritedPropertyDescriptors", "value", "level", "desc", "keys", "obj", "tmp", "N", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertyNames", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedPropertyNames", "value", "level", "names", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertySymbols", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedPropertySymbols", "value", "level", "out", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritablePropertyNames", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "inmap", "collection", "fcn", "thisArg", "len", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "inmapRight", "collection", "fcn", "thisArg", "len", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "keyBy", "collection", "fcn", "thisArg", "out", "len", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "keyByRight", "collection", "fcn", "thisArg", "out", "len", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "defineProperty", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Node", "LinkedList", "node", "value", "n", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "lowercaseKeys", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "get", "set", "ref", "shx", "shy", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_array", "__commonJSMin", "exports", "module", "map", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "format", "ndarrayFcn", "arrayFcn", "map", "arr", "fcn", "thisArg", "out", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map", "arr", "out", "fcn", "thisArg", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "mapArguments", "fcn", "clbk", "thisArg", "wrap", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "mapFun", "fcn", "n", "thisArg", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "mapFun", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasOwnProp", "format", "mapKeys", "obj", "transform", "out", "key", "v", "require_lib", "__commonJSMin", "exports", "module", "mapKeys", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapReduce", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "mapReduce", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "mapReduce", "arr", "initial", "mapper", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapReduceRight", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "mapReduceRight", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "mapReduceRight", "arr", "initial", "mapper", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapRight", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "get", "set", "ref", "shx", "shy", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_array", "__commonJSMin", "exports", "module", "mapRight", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "format", "ndarrayFcn", "arrayFcn", "mapRight", "arr", "fcn", "thisArg", "out", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "mapRight", "arr", "out", "fcn", "thisArg", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasOwnProp", "format", "mapValues", "obj", "transform", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "mapValues", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map2", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "ordx", "ordy", "ordz", "xget", "yget", "zset", "xref", "yref", "shx", "shy", "shz", "len", "sx", "sy", "sz", "ox", "oy", "oz", "ix", "iy", "iz", "i", "require_array", "__commonJSMin", "exports", "module", "map2", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "xget", "yget", "zset", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "broadcastShapes", "broadcast", "format", "ndarrayFcn", "arrayFcn", "map2", "x", "y", "fcn", "thisArg", "isxnd", "isynd", "out", "tmp", "sh", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map2", "x", "y", "out", "fcn", "thisArg", "isxnd", "isynd", "isznd", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map2Right", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "ordx", "ordy", "ordz", "xget", "yget", "zset", "xref", "yref", "shx", "shy", "shz", "len", "sx", "sy", "sz", "ox", "oy", "oz", "ix", "iy", "iz", "i", "require_array", "__commonJSMin", "exports", "module", "map2Right", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "xget", "yget", "zset", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "broadcastShapes", "broadcast", "format", "ndarrayFcn", "arrayFcn", "map2Right", "x", "y", "fcn", "thisArg", "isxnd", "isynd", "out", "tmp", "sh", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map2Right", "x", "y", "out", "fcn", "thisArg", "isxnd", "isynd", "isznd", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map2d", "arr", "fcn", "thisArg", "out", "tmp", "M", "N", "a", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map3d", "arr", "fcn", "thisArg", "out", "t1", "t2", "a1", "a2", "S0", "S1", "S2", "i0", "i1", "i2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map4d", "arr", "fcn", "thisArg", "out", "t1", "t2", "t3", "a1", "a2", "a3", "S0", "S1", "S2", "S3", "i0", "i1", "i2", "i3", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map5d", "arr", "fcn", "thisArg", "out", "t1", "t2", "t3", "t4", "a1", "a2", "a3", "a4", "S0", "S1", "S2", "S3", "S4", "i0", "i1", "i2", "i3", "i4", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "maskArguments", "fcn", "mask", "thisArg", "fcns", "idx", "i", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "setReadOnly", "identity", "hasOwnProp", "format", "memoize", "fcn", "hashFunction", "toKey", "cache", "memoized", "args", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "memoize", "require_defaults", "__commonJSMin", "exports", "module", "PINF", "defaults", "require_deepmerge", "__commonJSMin", "exports", "module", "objectKeys", "isObject", "hasOwnProp", "isBuffer", "isFunction", "typeOf", "deepCopy", "deepMerge", "target", "source", "level", "copy", "override", "extend", "hasProp", "isFunc", "name", "keys", "curr", "key", "val", "tmp", "i", "require_mergefcn", "__commonJSMin", "exports", "module", "isObject", "format", "deepMerge", "mergefcn", "opts", "merge", "target", "nargs", "arg", "src", "i", "require_main", "__commonJSMin", "exports", "module", "defaults", "mergefcn", "merge", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isFunction", "isPositiveInteger", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "validate", "defaults", "mergefcn", "factory", "options", "opts", "err", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "format", "moveProperty", "source", "prop", "target", "desc", "require_lib", "__commonJSMin", "exports", "module", "moveProperty", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertiesIn", "value", "out", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_contains", "__commonJSMin", "exports", "module", "contains", "arr", "v", "i", "require_has_distinct_elements", "__commonJSMin", "exports", "module", "hasOwnProp", "hasDistinctElements", "arr", "obj", "i", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isString", "dtypes", "format", "contains", "DTYPES", "validate", "opts", "options", "require_ascending", "__commonJSMin", "exports", "module", "ascending", "a", "b", "require_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "fields", "it", "clbk", "thisArg", "out", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isStringArray", "isString", "isArrayBuffer", "isFunction", "isInteger", "isObject", "isCollection", "hasOwnProp", "hasIteratorSymbolSupport", "propertiesIn", "typedarray", "Int8Array", "getDtype", "defineProperty", "setNonEnumerableProperty", "setNonEnumerableReadOnlyAccessor", "setNonEnumerableReadWriteAccessor", "floor", "ITERATOR_SYMBOL", "format", "contains", "hasDistinctElements", "validate", "ascending", "fromIterator", "fromIteratorMap", "RESERVED_PROPS", "HAS_ITERATOR_SYMBOL", "factory", "names", "options", "nfields", "fields", "opts", "err", "i", "namedtypedtuple", "indices", "dtype", "nargs", "tuple", "getter", "setter", "getFields", "orderedFields", "entries", "every", "fieldOf", "filter", "find", "findIndex", "findField", "forEach", "ind2key", "key2ind", "keys", "lastFieldOf", "map", "reduce", "reduceRight", "reverse", "slice", "some", "sort", "subtuple", "toJSON", "toString", "get", "set", "v", "out", "self", "iter", "FLG", "next", "end", "value", "predicate", "thisArg", "bool", "searchElement", "tmp", "f", "fcn", "ind", "key", "acc", "j", "begin", "compareFunction", "clbk", "k", "wrapper", "ia", "ib", "a", "b", "src", "it", "obj", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "naryFunction", "fcn", "arity", "thisArg", "fcns", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "x", "y", "z", "w", "v", "t", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "proc", "nextTick", "clbk", "args", "i", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "format", "none", "collection", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "noneBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "noneByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "isNonEnumerable", "nonEnumerableProperties", "value", "out", "tmp", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isNonEnumerable", "nonEnumerablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "isNonEnumerableProperty", "nonEnumerablePropertyNames", "value", "names", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "isNonEnumerableProperty", "hasOwnProp", "Object", "nonEnumerablePropertyNamesIn", "value", "names", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isNonEnumerableProperty", "Object", "nonEnumerablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isNonEnumerableProperty", "hasOwnProp", "Object", "nonEnumerablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "RE_INTEGER_INDEX", "nonIndexKeys", "obj", "keys", "len", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isArray", "isObject", "isObjectLike", "isBoolean", "hasOwnProp", "format", "invert", "obj", "opts", "allowDupes", "keys", "len", "key", "val", "out", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isArray", "isObject", "isObjectLike", "isBoolean", "isFunction", "hasOwnProp", "format", "invertBy", "obj", "opts", "transform", "allowDupes", "keys", "len", "key", "val", "out", "cb", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isString", "isStringArray", "indexOf", "format", "omit", "obj", "keys", "ownKeys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "omitBy", "obj", "predicate", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "spawn", "IS_WINDOWS", "IS_DARWIN", "format", "isURI", "ARGS", "CMD", "openURL", "url", "args", "proc", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "papply", "fcn", "pargs", "i", "papplied", "args", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "papplyRight", "fcn", "pargs", "len", "pappliedRight", "nargs", "args", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "numCPUs", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isPositiveInteger", "isNonNegativeInteger", "isBoolean", "isString", "format", "validate", "opts", "options", "require_env", "__commonJSMin", "exports", "module", "objectKeys", "ENV", "copy", "keys", "env", "out", "opts", "require_options", "__commonJSMin", "exports", "module", "cwd", "env", "getOpts", "options", "opts", "require_exec", "__commonJSMin", "exports", "module", "fork", "path", "logger", "objectKeys", "format", "getOpts", "debug", "WORKER_FILEPATH", "exec", "files", "opts", "clbk", "numClosed", "workers", "pending", "fopts", "args", "proc", "pids", "pid", "idx", "err", "i", "onError", "onClose", "onExit", "onDisconnect", "onMessage", "next", "child", "numPending", "close", "listener", "filepath", "code", "signal", "processExit", "childClosed", "done", "error", "require_node", "__commonJSMin", "exports", "module", "exec", "require_main", "__commonJSMin", "exports", "module", "path", "isStringArray", "isFunction", "format", "cwd", "defaults", "validate", "exec", "parallel", "options", "files", "opts", "clbk", "err", "dir", "i", "done", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "isFunction", "format", "parseJSON", "str", "reviver", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "isStringArray", "hasOwnProp", "format", "pick", "obj", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "isCollection", "format", "pickArguments", "fcn", "indices", "thisArg", "fcns", "idx", "v", "i", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "pickBy", "obj", "predicate", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isArray", "hasOwnProp", "format", "defaults", "validate", "pluck", "arr", "prop", "options", "opts", "out", "err", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_pop_object", "__commonJSMin", "exports", "module", "pop", "obj", "len", "v", "require_pop_typed_array", "__commonJSMin", "exports", "module", "pop", "arr", "view", "len", "v", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "popObject", "popTypedArray", "pop", "collection", "v", "require_lib", "__commonJSMin", "exports", "module", "main", "require_prepend_array", "__commonJSMin", "exports", "module", "prepend", "arr", "items", "i", "require_prepend_object", "__commonJSMin", "exports", "module", "prepend", "obj", "items", "len", "n", "i", "require_prepend_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "prepend", "arr", "items", "nbytes", "ibytes", "offset", "total", "len", "buf", "n", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isCollection", "isTypedArrayLike", "isInteger", "format", "prependArray", "prependObject", "prependTypedArray", "prepend", "collection1", "collection2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "properties", "value", "out", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyDescriptor", "getPrototypeOf", "propertyDescriptorIn", "value", "property", "desc", "obj", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyDescriptors", "getOwnPropertySymbols", "getPrototypeOf", "objectKeys", "defineProperty", "hasOwnProp", "Object", "propertyDescriptorsIn", "value", "desc", "keys", "obj", "tmp", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertyNamesIn", "value", "names", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertySymbolsIn", "value", "symbols", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_push_array", "__commonJSMin", "exports", "module", "push", "arr", "items", "i", "require_push_object", "__commonJSMin", "exports", "module", "push", "obj", "items", "len", "require_push_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "push", "arr", "items", "nbytes", "ibytes", "total", "len", "buf", "n", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "pushArray", "pushObject", "pushTypedArray", "push", "collection", "items", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "realmax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "realmin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "reduce", "x", "initial", "fcn", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "reduce", "x", "initial", "fcn", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "reduce", "arr", "initial", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "reduceRight", "x", "initial", "fcn", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "reduceRight", "x", "initial", "fcn", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "reduceRight", "arr", "initial", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isCollection", "isFunction", "format", "reduce2d", "arr", "initial", "reducer", "thisArg", "out", "acc", "M", "N", "a", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "rejectArguments", "fcn", "predicate", "thisArg", "wrap", "args", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeIntegerArray", "format", "reorderArguments", "fcn", "indices", "thisArg", "reordered", "args", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "reverseArguments", "fcn", "thisArg", "reversed", "args", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "safeintmax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "safeintmin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_shift_object", "__commonJSMin", "exports", "module", "shift", "obj", "len", "v", "require_shift_typed_array", "__commonJSMin", "exports", "module", "shift", "arr", "offset", "view", "v", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "shiftObject", "shiftTypedArray", "shift", "collection", "v", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "UINT8", "INT16", "UINT16", "INT32", "UINT32", "FLOAT16", "FLOAT32", "FLOAT64", "COMPLEX64", "COMPLEX128", "sizeOf", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "format", "some", "collection", "n", "count", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isFunction", "format", "someBy", "collection", "n", "predicate", "thisArg", "count", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isFunction", "format", "someByRight", "collection", "n", "predicate", "thisArg", "count", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Stack", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "value", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "indexOf", "format", "tabulate", "collection", "count", "tmp", "len", "out", "v", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "indexOf", "format", "validate", "tabulateBy", "collection", "options", "indicator", "thisArg", "count", "opts", "tmp", "len", "out", "err", "cb", "v", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "thunk", "fcn", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isPositiveInteger", "isString", "isBoolean", "isNull", "format", "validate", "opts", "options", "require_context", "__commonJSMin", "exports", "module", "defineProperty", "tic", "toc", "context", "done", "ctx", "require_async", "__commonJSMin", "exports", "module", "noop", "body", "id", "code", "opts", "before", "after", "state", "main", "src", "cb1", "cb2", "cb3", "ctx", "t", "d", "i", "require_sync", "__commonJSMin", "exports", "module", "generate", "id", "code", "opts", "src", "ctx", "t", "d", "i", "require_wrap", "__commonJSMin", "exports", "module", "wrap", "src", "out", "require_vm_compile", "__commonJSMin", "exports", "module", "vm", "wrap", "compile", "filename", "code", "script", "opts", "require_vm_evaluate", "__commonJSMin", "exports", "module", "minstd", "createContext", "asyncSource", "syncSource", "compile", "evaluate", "src", "opts", "filename", "dirname", "clbk", "context", "tmp", "fcn", "err", "id", "done", "error", "results", "require_min_time", "__commonJSMin", "exports", "module", "min", "times", "out", "require_transform", "__commonJSMin", "exports", "module", "min", "transform", "raw", "iterations", "secs", "rate", "out", "m", "require_main", "__commonJSMin", "exports", "module", "isString", "isFunction", "isArray", "copy", "cwd", "format", "nextTick", "defaults", "validate", "evaluate", "transform", "FILENAME", "MIN_TIME", "ITERATIONS", "MAX_ITERATIONS", "timeit", "code", "options", "clbk", "results", "opts", "dir", "err", "idx", "cb", "onTest", "error", "done", "next", "onTick", "time", "onRun", "onFinish", "t", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trycatch", "x", "y", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isError", "format", "wrap", "fcn", "thisArg", "ctx", "wrapped", "args", "len", "i", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isError", "tryRequire", "id", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trythen", "x", "y", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "UINT8", "INT16", "UINT16", "INT32", "UINT32", "FLOAT16", "FLOAT32", "FLOAT64", "typemax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "INT16", "INT32", "FLOAT16", "FLOAT32", "FLOAT64", "typemin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "uncapitalizeKeys", "obj", "out", "key", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "uncurry", "fcn", "arity", "thisArg", "context", "len", "uncurried", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "uncurryRight", "fcn", "arity", "thisArg", "context", "len", "uncurried", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_unshift_array", "__commonJSMin", "exports", "module", "unshift", "arr", "items", "i", "require_unshift_object", "__commonJSMin", "exports", "module", "unshift", "obj", "items", "len", "n", "i", "require_unshift_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "unshift", "arr", "items", "nbytes", "ibytes", "offset", "total", "len", "buf", "n", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "unshiftArray", "unshiftObject", "unshiftTypedArray", "unshift", "collection", "items", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "until", "predicate", "fcn", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "untilEach", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "untilEachRight", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isInteger", "isArray", "unzip", "arr", "idx", "numVals", "len", "out", "tmp", "i", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "uppercaseKeys", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isObjectLike", "format", "objectValues", "obj", "keys", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "objectValuesIn", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "whilst", "predicate", "fcn", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "whileEach", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "whileEachRight", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "isWritable", "writableProperties", "value", "out", "tmp", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isWritable", "Object", "writablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "isWritableProperty", "Object", "writablePropertyNames", "value", "names", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "isWritableProperty", "hasOwnProp", "writablePropertyNamesIn", "value", "names", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isWritableProperty", "writablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isWritableProperty", "hasOwnProp", "writablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isBoolean", "isObject", "isArray", "hasOwnProp", "format", "zip", "nargs", "args", "fill", "opts", "arg", "flg", "len", "arr", "out", "val", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "setReadOnly", "utils"] + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './define_property.js' );\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasDefinePropertySupport;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils/define-property\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nvar hasDefinePropertySupport = require( './has_define_property_support.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-only property.\n*\n* @module @stdlib/utils/define-read-only-property\n*\n* @example\n* var setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n*\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection is truthy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether at least one element is truthy\n*\n* @example\n* var arr = [ 0, 0, 0, 0, 1 ];\n*\n* var bool = any( arr );\n* // returns true\n*/\nfunction any( collection ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( collection[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = any;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection is truthy.\n*\n* @module @stdlib/utils/any\n*\n* @example\n* var any = require( '@stdlib/utils/any' );\n*\n* var arr = [ 0, 0, 0, 0, 1 ];\n*\n* var bool = any( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4, -1 ];\n*\n* var bool = anyBy( arr, isNegative );\n* // returns true\n*/\nfunction anyBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @module @stdlib/utils/any-by\n*\n* @example\n* var anyBy = require( '@stdlib/utils/any-by' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4, -1 ];\n*\n* var bool = anyBy( arr, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, 2, 3, 4 ];\n*\n* var bool = anyByRight( arr, isNegative );\n* // returns true\n*/\nfunction anyByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/any-by-right\n*\n* @example\n* var anyByRight = require( '@stdlib/utils/any-by-right' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, 2, 3, 4 ];\n*\n* var bool = anyByRight( arr, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( arr, items ) {\n\tvar i;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tarr.push( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = append( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 1.0, '1': 2.0, '2': 3.0, '3': 4.0 }\n*/\nfunction append( obj, items ) {\n\tvar len;\n\tvar i;\n\tlen = obj.length;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tobj[ len+i ] = items[ i ];\n\t}\n\tobj.length = len + items.length;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the end of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is followed by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\ttotal = nbytes + ibytes + arr.byteOffset;\n\n\tif ( arr.buffer.byteLength < total ) {\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\tv = new arr.constructor( buf, 0, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i ] = arr[ i ];\n\t\t}\n\t} else {\n\t\tv = new arr.constructor( arr.buffer, arr.byteOffset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ len+i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar appendArray = require( './append_array.js' );\nvar appendObject = require( './append_object.js' );\nvar appendTypedArray = require( './append_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the end of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction append( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn appendArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn appendTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn appendObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = append;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add the elements of one collection to the end of another collection.\n*\n* @module @stdlib/utils/append\n*\n* @example\n* var append = require( '@stdlib/utils/append' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = append( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function which always returns a specified argument.\n*\n* @param {NonNegativeInteger} idx - argument index\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Function} argument function\n*\n* @example\n* var argn = wrap( 1 );\n*\n* var v = argn( 1.0, 2.0, 3.0 );\n* // returns 2.0\n*\n* v = argn( 'a', 'b', 'c' );\n* // returns 'b'\n*\n* v = argn( null );\n* // returns undefined\n*/\nfunction wrap( idx ) {\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\treturn argn;\n\n\t/**\n\t* Argument function.\n\t*\n\t* @private\n\t* @returns {*} argument\n\t*/\n\tfunction argn() {\n\t\treturn arguments[ idx ];\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function which always returns a specified argument.\n*\n* @module @stdlib/utils/argument-function\n*\n* @example\n* var argumentFunction = require( '@stdlib/utils/argument-function' );\n*\n* var argn = argumentFunction( 1 );\n*\n* var v = argn( 1.0, 2.0, 3.0 );\n* // returns 2.0\n*\n* v = argn( 'a', 'b', 'c' );\n* // returns 'b'\n*\n* v = argn( null );\n* // returns undefined\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only property.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-property\n*\n* @example\n* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'any-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `anyByAsync` function which invokes the predicate function for each collection element sequentially:\n* var anyByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* anyByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn anyByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction anyByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* anyByAsync( files, predicate, done );\n*/\nfunction anyByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/any-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var anyByAsync = require( '@stdlib/utils/async/any-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* anyByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'any-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `anyByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var anyByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* anyByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn anyByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction anyByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* anyByRightAsync( files, predicate, done );\n*/\nfunction anyByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = anyByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/any-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var anyByRightAsync = require( '@stdlib/utils/async/any-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read at least one file.' );\n* } else {\n* console.log( 'Unable to read any files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* anyByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = indexOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the first index at which a given element can be found.\n*\n* @module @stdlib/utils/index-of\n*\n* @example\n* var indexOf = require( '@stdlib/utils/index-of' );\n*\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* arr = [ 4, 3, 2, 1 ];\n* idx = indexOf( arr, 5 );\n* // returns -1\n*\n* // Using a `fromIndex`:\n* arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* // `fromIndex` which exceeds `array` length:\n* arr = [ 1, 2, 3, 4, 2, 5 ];\n* idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* // Negative `fromIndex`:\n* arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* // Negative `fromIndex` exceeding input `array` length:\n* arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* // Array-like objects:\n* var str = 'bebop';\n* idx = indexOf( str, 'o' );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar indexOf = require( './../../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10,\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'bifurcate-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {string} [options.returns] - output format\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = [];\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tout.push( [], [] );\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, v, cb );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [bool] - group indicator\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, bool ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, ( bool ) ? '0' : '1' );\n\n\t\t\t// Default is to return values...\n\t\t\tif ( opts.returns === 'indices' ) {\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tout[ 0 ].push( j );\n\t\t\t\t} else {\n\t\t\t\t\tout[ 1 ].push( j );\n\t\t\t\t}\n\t\t\t} else if ( opts.returns === '*' ) {\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tout[ 0 ].push( [ j, v ] );\n\t\t\t\t} else {\n\t\t\t\t\tout[ 1 ].push( [ j, v ] );\n\t\t\t\t}\n\t\t\t} else if ( bool ) {\n\t\t\t\tout[ 0 ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( v );\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function which splits values into two groups according to a predicate function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `bifurcateByAsync` function which invokes the predicate function for each collection element sequentially:\n* var bifurcateByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* bifurcateByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn bifurcateByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction bifurcateByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} results - bifurcation results\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, results ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, results );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* bifurcateByAsync( files, predicate, done );\n*/\nfunction bifurcateByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/async/bifurcate-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var bifurcateByAsync = require( '@stdlib/utils/async/bifurcate-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* bifurcateByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function composition.\n*\n* @param {...Function} f - functions to compose\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} composite function\n*\n* @example\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = composeAsync( c, b, a );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\nfunction composeAsync() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to compose.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn composite;\n\n\t/**\n\t* Composite function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @param {Callback} done - callback to invoke after invoking all functions\n\t*/\n\tfunction composite() {\n\t\tvar done;\n\t\tvar args;\n\t\tvar i;\n\n\t\t// Cache the callback function:\n\t\tdone = arguments[ arguments.length-1 ];\n\n\t\t// Copy arguments which should be provided to the first invoked function...\n\t\targs = new Array( arguments.length-1 );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\t// Append the callback an invoked function should call upon completion:\n\t\targs.push( next );\n\n\t\t// Start invoking provided functions:\n\t\ti = nFuncs - 1;\n\t\tf[ i ].apply( null, args );\n\n\t\t/**\n\t\t* Callback invoked upon completion of a composed function.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {*} result - result to pass to next function\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\ti -= 1;\n\t\t\tif ( i < 0 ) {\n\t\t\t\treturn done( null, result );\n\t\t\t}\n\t\t\tf[ i ]( result, next );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = composeAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function composition.\n*\n* @module @stdlib/utils/async/compose\n*\n* @example\n* var composeAsync = require( '@stdlib/utils/async/compose' );\n*\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = composeAsync( c, b, a );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'count-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\tout[ group ] += 1;\n\t\t\t} else {\n\t\t\t\tout[ group ] = 1;\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for grouping values according to an indicator function and returns group counts.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `countByAsync` function which invokes the indicator function for each collection element sequentially:\n* var countByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* countByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn countByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction countByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - counts\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and returns group counts.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* countByAsync( files, indicator, done );\n*/\nfunction countByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = countByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function and return group counts.\n*\n* @module @stdlib/utils/async/count-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var countByAsync = require( '@stdlib/utils/async/count-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* countByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doUntilAsync( fcn, predicate, done );\n*/\nfunction doUntilAsync( fcn, predicate, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tfcn.call( thisArg, idx, next );\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/async/do-until\n*\n* @example\n* var doUntilAsync = require( '@stdlib/utils/async/do-until' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doUntilAsync( fcn, predicate, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doWhileAsync( fcn, predicate, done );\n*/\nfunction doWhileAsync( fcn, predicate, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tfcn.call( thisArg, idx, next );\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/async/do-while\n*\n* @example\n* var doWhileAsync = require( '@stdlib/utils/async/do-while' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* doWhileAsync( fcn, predicate, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'every-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( !result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `everyByAsync` function which invokes the predicate function for each collection element sequentially:\n* var everyByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* everyByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn everyByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction everyByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* everyByAsync( files, predicate, done );\n*/\nfunction everyByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/every-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var everyByAsync = require( '@stdlib/utils/async/every-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* everyByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'every-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions, and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( !result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `everyByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var everyByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* everyByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn everyByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction everyByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* everyByRightAsync( files, predicate, done );\n*/\nfunction everyByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/every-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var everyByRightAsync = require( '@stdlib/utils/async/every-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read all files.' );\n* } else {\n* console.log( 'Was unable to read all files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* everyByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'for-each-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `forEachAsync` function which invokes `read` for each collection element sequentially:\n* var forEachAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* // Run `read` for each element in `files`:\n* forEachAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn forEachAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction forEachAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* forEachAsync( files, read, done );\n*/\nfunction forEachAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/async/for-each\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var forEachAsync = require( '@stdlib/utils/async/for-each' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* forEachAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'for-each-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `forEachRightAsync` function which invokes `read` for each collection element sequentially:\n* var forEachRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* // Run `read` for each element in `files`:\n* forEachRightAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn forEachRightAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction forEachRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* forEachRightAsync( files, read, done );\n*/\nfunction forEachRightAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/async/for-each-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var forEachRightAsync = require( '@stdlib/utils/async/for-each-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( 'Successfully read all files.' );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* console.log( 'Successfully read file: %s', file );\n* next();\n* }\n* }\n*\n* forEachRightAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function sequence.\n*\n* @param {...Function} f - functions to evaluate in sequential order\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} pipeline function\n*\n* @example\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = funseqAsync( a, b, c );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\nfunction funseqAsync() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn pipeline;\n\n\t/**\n\t* Pipeline function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @param {Callback} done - callback to invoke after invoking all functions\n\t*/\n\tfunction pipeline() {\n\t\tvar done;\n\t\tvar args;\n\t\tvar i;\n\n\t\t// Cache the callback function:\n\t\tdone = arguments[ arguments.length-1 ];\n\n\t\t// Copy arguments which should be provided to the first invoked function...\n\t\targs = new Array( arguments.length-1 );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\t// Append the callback an invoked function should call upon completion:\n\t\targs.push( next );\n\n\t\t// Start invoking provided functions:\n\t\ti = 0;\n\t\tf[ i ].apply( null, args );\n\n\t\t/**\n\t\t* Callback invoked upon completion of a provided function.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {*} result - result to pass to next function\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\ti += 1;\n\t\t\tif ( i === nFuncs ) {\n\t\t\t\treturn done( null, result );\n\t\t\t}\n\t\t\tf[ i ]( result, next );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = funseqAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function sequence.\n*\n* @module @stdlib/utils/async/function-sequence\n*\n* @example\n* var funseqAsync = require( '@stdlib/utils/async/function-sequence' );\n*\n* function a( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, 2*x );\n* }\n* }\n*\n* function b( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x+3 );\n* }\n* }\n*\n* function c( x, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, x/5 );\n* }\n* }\n*\n* var f = funseqAsync( a, b, c );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* // => 3\n* }\n*\n* f( 6, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar indexOf = require( './../../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10,\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'group-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {string} [options.returns] - output format\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Default is to return values...\n\t\t\tif ( opts.returns === 'indices' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( j );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ j ];\n\t\t\t\t}\n\t\t\t} else if ( opts.returns === '*' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( [ j, v ] );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ [ j, v ] ];\n\t\t\t\t}\n\t\t\t} else if ( hasOwnProp( out, group ) ) {\n\t\t\t\tout[ group ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ group ] = [ v ];\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for grouping values according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `groupByAsync` function which invokes the indicator function for each collection element sequentially:\n* var groupByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* groupByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn groupByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction groupByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - group-by result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* groupByAsync( files, indicator, done );\n*/\nfunction groupByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function.\n*\n* @module @stdlib/utils/async/group-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var groupByAsync = require( '@stdlib/utils/async/group-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* groupByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a predicate function returns a truthy value, returns `x`; otherwise, returns `y`.\n*\n* @param {Function} predicate - predicate function\n* @param {*} x - value to return if a condition is truthy\n* @param {*} y - value to return if a condition is falsy\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifelseAsync( predicate, 1.0, -1.0, done );\n*/\nfunction ifelseAsync( predicate, x, y, done ) {\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tpredicate( clbk );\n\n\t/**\n\t* Callback invoked by a predicate function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} bool - condition\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, bool ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( bool ) {\n\t\t\treturn done( null, x );\n\t\t}\n\t\tdone( null, y );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifelseAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a predicate function returns a truthy value, return `x`; otherwise, return `y`.\n*\n* @module @stdlib/utils/async/if-else\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifelseAsync = require( '@stdlib/utils/async/if-else' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifelseAsync( predicate, 1.0, -1.0, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a predicate function returns a truthy value, invokes `x`; otherwise, invokes `y`.\n*\n* @param {Function} predicate - predicate function\n* @param {Function} x - function to invoke if a condition is truthy\n* @param {Function} y - function to invoke if a condition is falsy\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, 1.0 );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifthenAsync( predicate, x, y, done );\n*/\nfunction ifthenAsync( predicate, x, y, done ) {\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tpredicate( clbk1 );\n\n\t/**\n\t* Callback invoked by a predicate function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} bool - condition\n\t* @returns {void}\n\t*/\n\tfunction clbk1( error, bool ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( bool ) {\n\t\t\treturn x( clbk2 );\n\t\t}\n\t\ty( clbk2 );\n\t}\n\n\t/**\n\t* Callback invoked by either `x` or `y`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - results\n\t* @returns {void}\n\t*/\n\tfunction clbk2( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifthenAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a predicate function returns a truthy value, invoke `x`; otherwise, invoke `y`.\n*\n* @module @stdlib/utils/async/if-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifthenAsync = require( '@stdlib/utils/async/if-then' );\n*\n* function predicate( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, randu() > 0.5 );\n* }\n* }\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, 1.0 );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n* ifthenAsync( predicate, x, y, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'inmap-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions, and updates a collection in-place.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection and to update the collection in-place.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `inmapAsync` function which invokes `read` for each collection element sequentially:\n* var inmapAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* // Run `read` for each element in `files`:\n* inmapAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn inmapAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection and updates a collection in-place.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction inmapAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, collection );\n\t\t\t}\n\t\t\tdone( null, collection );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates a collection in-place.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* inmapAsync( files, read, done );\n*/\nfunction inmapAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update a collection in-place.\n*\n* @module @stdlib/utils/async/inmap\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var inmapAsync = require( '@stdlib/utils/async/inmap' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* inmapAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'inmap-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left, and updates a collection in-place.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done();\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx -= 1;\n\t\tj = idx;\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( collection[ j ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ j ], j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tcollection[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done();\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function once for each element in a collection and to update the collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `inmapRightAsync` function which invokes `read` for each collection element sequentially:\n* var inmapRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* // Run `read` for each element in `files`:\n* inmapRightAsync( files, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn inmapRightAsync;\n\n\t/**\n\t* Invokes a function for each element in a collection and updates a collection in-place, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction inmapRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, collection );\n\t\t\t}\n\t\t\tdone( null, collection );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates a collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling. Note, however, that the function may have mutated an input collection during prior invocations, resulting in a partially mutated collection.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* inmapRightAsync( files, read, done );\n*/\nfunction inmapRightAsync( collection, options, fcn, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, fcn );\n\t}\n\tfactory( options, fcn )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update a collection in-place, iterating from right to left.\n*\n* @module @stdlib/utils/async/inmap-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var inmapRightAsync = require( '@stdlib/utils/async/inmap-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* function read( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* error = new Error( 'unable to read file: '+file );\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* inmapRightAsync( files, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before the next invocation\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-function-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times, limiting the number of concurrently pending invocations, and returns an array of accumulated function return values.\n*\n* @private\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( n, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar out;\n\tvar lim;\n\tvar idx;\n\tvar m;\n\tvar i;\n\n\tdebug( 'Number of invocations: %d', n );\n\n\t// Note: we explicitly preallocate in order to facilitate inserting a function result into its associated output array index. This means we do not ensure \"fast\" elements for large output arrays.\n\tout = new Array( n );\n\tif ( n === 0 ) {\n\t\tdebug( 'Finished invoking a function.' );\n\t\treturn done( null, out );\n\t}\n\tif ( n < opts.limit ) {\n\t\tlim = n;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\n\tcount = 0;\n\tidx = -1;\n\tm = n - 1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all invocations...\n\t\tif ( idx < m ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to process the next function invocation.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar j;\n\t\tidx += 1;\n\t\tj = idx;\n\t\tdebug( 'Invocation number: %d', j );\n\t\tfcn.call( opts.thisArg, j, cb );\n\n\t\t/**\n\t\t* Callback invoked once a provided function completes.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further invocations:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tout[ j ] = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next invocation.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Completed invocation %d of %d.', count, n );\n\t\tif ( idx < m ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === n ) {\n\t\t\tdebug( 'Finished invoking a function.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to invoke a function `n` times and return an array of accumulated function return values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function again\n* @param {Function} fcn - function to invoke\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes a function `n` times and returns an array of accumulated function return values\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* var mapFunAsync = factory( opts, fcn );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( results );\n* }\n*\n* mapFunAsync( 10, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapFunAsync;\n\n\t/**\n\t* Invokes a function `n` times and returns an array of accumulated function return values.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} n - number of function invocations\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapFunAsync( n, done ) {\n\t\tif ( !isNonNegativeInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Number of function invocations must be a nonnegative integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {Array} results - results\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, results ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, results );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times and returns an array of accumulated function return values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Function} fcn - function to invoke\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function again\n* @param {Function} done - callback to invoke upon invoking a function `n` times\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( JSON.stringify( out ) );\n* // => [ 0, 1, 2, 3, 4 ]\n* }\n*\n* mapFunAsync( fcn, 5, done );\n*/\nfunction mapFunAsync( fcn, n, options, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( fcn )( n, options );\n\t}\n\tfactory( options, fcn )( n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapFunAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function `n` times and return an array of accumulated function return values.\n*\n* @module @stdlib/utils/async/map-function\n*\n* @example\n* var mapFunAsync = require( '@stdlib/utils/async/map-function' );\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* next( null, i );\n* }\n* }\n*\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( JSON.stringify( out ) );\n* // => [ 0, 1, 2, 3, 4 ]\n* }\n*\n* mapFunAsync( fcn, 5, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keys = require( './builtin.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = check;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArguments = require( '@stdlib/assert/is-arguments' );\nvar builtin = require( './builtin.js' );\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nmodule.exports = noop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @module @stdlib/utils/noop\n*\n* @example\n* var noop = require( '@stdlib/utils/noop' );\n*\n* noop();\n* // ...does nothing.\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar noop = require( './../../noop' );\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nmodule.exports = RE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof global === 'object' ) ? global : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar getThis = require( './codegen.js' );\nvar Self = require( './self.js' );\nvar Win = require( './window.js' );\nvar Global = require( './global.js' );\nvar GlobalThis = require( './global_this.js' );\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: Node.js\n\tif ( Global ) {\n\t\treturn Global;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the global object.\n*\n* @module @stdlib/utils/global\n*\n* @example\n* var getGlobal = require( '@stdlib/utils/global' );\n*\n* var g = getGlobal();\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getGlobal = require( './../../../global' );\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nmodule.exports = nodeList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = typedarray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar RE = require( './fixtures/re.js' );\nvar nodeList = require( './fixtures/nodelist.js' );\nvar typedarray = require( './fixtures/typedarray.js' );\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = check;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nmodule.exports = toStr;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Symbol = require( '@stdlib/symbol/ctor' );\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nmodule.exports = toStrTag;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar toStringTag = require( './tostringtag.js' );\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils/native-class\n*\n* @example\n* var nativeClass = require( '@stdlib/utils/native-class' );\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nvar hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( './../../native-class' );\nvar RE = require( '@stdlib/regexp/function-name' ).REGEXP;\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nmodule.exports = constructorName;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine the name of a value's constructor.\n*\n* @module @stdlib/utils/constructor-name\n*\n* @example\n* var constructorName = require( '@stdlib/utils/constructor-name' );\n*\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* v = constructorName( {} );\n* // returns 'Object'\n*\n* v = constructorName( true );\n* // returns 'Boolean'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils/type-of\n*\n* @example\n* var typeOf = require( '@stdlib/utils/type-of' );\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nvar usePolyfill = require( './check.js' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isConstructorPrototype;\n", "[\n\t\"console\",\n\t\"external\",\n\t\"frame\",\n\t\"frameElement\",\n\t\"frames\",\n\t\"innerHeight\",\n\t\"innerWidth\",\n\t\"outerHeight\",\n\t\"outerWidth\",\n\t\"pageXOffset\",\n\t\"pageYOffset\",\n\t\"parent\",\n\t\"scrollLeft\",\n\t\"scrollTop\",\n\t\"scrollX\",\n\t\"scrollY\",\n\t\"self\",\n\t\"webkitIndexedDB\",\n\t\"webkitStorageInfo\",\n\t\"window\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nmodule.exports = w;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar typeOf = require( './../../type-of' );\nvar isConstructorPrototype = require( './is_constructor_prototype.js' );\nvar EXCLUDED_KEYS = require( './excluded_keys.json' );\nvar win = require( './window.js' );\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasAutomationEqualityBug = require( './has_automation_equality_bug.js' );\nvar isConstructorPrototype = require( './is_constructor_prototype.js' );\nvar HAS_WINDOW = require( './has_window.js' );\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\n", "[\n\t\"toString\",\n\t\"toLocaleString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"constructor\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isArguments = require( '@stdlib/assert/is-arguments' );\nvar HAS_ENUM_PROTO_BUG = require( './has_enumerable_prototype_bug.js' );\nvar HAS_NON_ENUM_PROPS_BUG = require( './has_non_enumerable_properties_bug.js' );\nvar isConstructorPrototype = require( './is_constructor_prototype_wrapper.js' );\nvar NON_ENUMERABLE = require( './non_enumerable.json' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasArgumentsBug = require( './has_arguments_bug.js' );\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar wrapper = require( './builtin_wrapper.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names.\n*\n* @module @stdlib/utils/keys\n*\n* @example\n* var keys = require( '@stdlib/utils/keys' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-values-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own property in a source object, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - We need to cache an object value to prevent the edge case where, during the invocation of the transform function, the value corresponding to a particular key is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Object} obj - source object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( obj, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar keys;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tdebug( 'Number of keys: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing an object.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all properties...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next property.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar value;\n\t\tvar key;\n\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\n\t\tvalue = obj[ key ];\n\t\tdebug( '%s: %s', key, JSON.stringify( value ) );\n\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, key, cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, key, value, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, key, value, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [key] - transformed key\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, key ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next property.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d properties.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing an object.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which maps keys from one object to a new object having the same values\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a reusable function:\n* var mapKeysAsync = factory( opts, read );\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, done );\n*/\nfunction factory( options, transform ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = transform;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapKeysAsync;\n\n\t/**\n\t* Maps keys from one object to a new object having the same values.\n\t*\n\t* @private\n\t* @param {Object} obj - source object\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapKeysAsync( obj, done ) {\n\t\tif ( typeof obj !== 'object' || obj === null ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( obj, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} [out] - output object\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, out ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Maps keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, opts, read, done );\n*/\nfunction mapKeysAsync( obj, options, transform, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( obj, transform );\n\t}\n\tfactory( options, transform )( obj, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapKeysAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map keys from one object to a new object having the same values.\n*\n* @module @stdlib/utils/async/map-keys\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var mapKeysAsync = require( '@stdlib/utils/async/map-keys' );\n*\n* function read( key, value, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( value, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, key+':unreadable' );\n* }\n* next( null, key+':readable' );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapKeysAsync( files, opts, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'map-values-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own property in a source object, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Object} obj - source object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( obj, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar keys;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tdebug( 'Number of keys: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing an object.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all properties...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next property.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar key;\n\t\tidx += 1;\n\t\tkey = keys[ idx ];\n\t\tdebug( '%s: %s', key, JSON.stringify( obj[ key ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], cb );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, obj[ key ], key, obj, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes transforming a property value.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [value] - transformed value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, value ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of properties:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Transform result => %s: %s', key, JSON.stringify( value ) );\n\t\t\tout[ key ] = value;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next property.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d properties.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing an object.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to map values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which maps values from one object to a new object having the same keys\n*\n* @example\n* var stat = require( 'fs' ).stat;\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a reusable function:\n* var mapValuesAsync = factory( opts, getStats );\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, done );\n*/\nfunction factory( options, transform ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = transform;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn mapValuesAsync;\n\n\t/**\n\t* Maps values from one object to a new object having the same keys.\n\t*\n\t* @private\n\t* @param {Object} obj - source object\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction mapValuesAsync( obj, done ) {\n\t\tif ( typeof obj !== 'object' || obj === null ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( obj, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} [out] - output object\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, out ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Maps values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n* - Iteration and insertion order are **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next own property\n* @param {Function} transform - transform function\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var stat = require( 'fs' ).stat;\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, opts, getStats, done );\n*/\nfunction mapValuesAsync( obj, options, transform, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( obj, transform );\n\t}\n\tfactory( options, transform )( obj, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapValuesAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map values from one object to a new object having the same keys.\n*\n* @module @stdlib/utils/async/map-values\n*\n* @example\n* var stat = require( 'fs' ).stat;\n* var mapValuesAsync = require( '@stdlib/utils/async/map-values' );\n*\n* function getStats( file, next ) {\n* stat( file, onStats );\n*\n* function onStats( error, data ) {\n* if ( error ) {\n* return next( error );\n* }\n* next( null, data );\n* }\n* }\n*\n* // Define a callback which handles errors:\n* function done( error, out ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( out );\n* }\n*\n* // Create a dictionary of file names:\n* var files = {\n* 'file1': './beep.js',\n* 'file2': './boop.js'\n* };\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Process each file in `files`:\n* mapValuesAsync( files, opts, getStats, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'none-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection fail a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `noneByAsync` function which invokes the predicate function for each collection element sequentially:\n* var noneByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* noneByAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn noneByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction noneByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* noneByAsync( files, predicate, done );\n*/\nfunction noneByAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/none-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var noneByAsync = require( '@stdlib/utils/async/none-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* noneByAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'none-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions, and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, true );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, true );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create an `noneByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var noneByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* noneByRightAsync( files, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn noneByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction noneByRightAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* noneByRightAsync( files, predicate, done );\n*/\nfunction noneByRightAsync( collection, options, predicate, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, predicate );\n\t}\n\tfactory( options, predicate )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/none-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var noneByRightAsync = require( '@stdlib/utils/async/none-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Was unable to read all files.' );\n* } else {\n* console.log( 'Was able to read at least one file.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* noneByRightAsync( files, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'reduce-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {*} acc - initial value\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, acc, opts, fcn, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, acc );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var opts = {\n* 'series': false\n* };\n*\n* // Create a `reduceAsync` function which invokes `read` for each collection element concurrently:\n* var reduceAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* // Run `read` for each element in `files`:\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series === void 0 && opts.limit === void 0 ) {\n\t\topts.series = true;\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn reduceAsync;\n\n\t/**\n\t* Applies a function against an accumulator and each element in a collection and return the accumulated result.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {*} initial - initial value\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction reduceAsync( collection, initial, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, initial, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [acc] - accumulated value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, acc ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {*} initial - initial value\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, read, done );\n*/\nfunction reduceAsync( collection, initial, options, fcn, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, initial, fcn );\n\t}\n\tfactory( options, fcn )( collection, initial, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in a collection and return the accumulated result.\n*\n* @module @stdlib/utils/async/reduce\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var reduceAsync = require( '@stdlib/utils/async/reduce' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var acc = {\n* 'count': 0\n* };\n* reduceAsync( files, acc, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'reduce-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {*} acc - initial value\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, acc, opts, fcn, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, acc );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', fcn.length );\n\n\tcount = 0;\n\tidx = len;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the provided function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error, data ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var opts = {\n* 'series': false\n* };\n*\n* // Create a `reduceRightAsync` function which invokes `read` for each collection element concurrently:\n* var reduceRightAsync = factory( opts, read );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles errors:\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* // Run `read` for each element in `files`:\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, done );\n*/\nfunction factory( options, fcn ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = fcn;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series === void 0 && opts.limit === void 0 ) {\n\t\topts.series = true;\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn reduceRightAsync;\n\n\t/**\n\t* Applies a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {*} initial - initial value\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction reduceRightAsync( collection, initial, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, initial, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [acc] - accumulated value\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, acc ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, acc );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* ## Notes\n*\n* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {*} initial - initial value\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=true] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} fcn - function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, read, done );\n*/\nfunction reduceRightAsync( collection, initial, options, fcn, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, initial, fcn );\n\t}\n\tfactory( options, fcn )( collection, initial, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.\n*\n* @module @stdlib/utils/async/reduce-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var reduceRightAsync = require( '@stdlib/utils/async/reduce-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, acc ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( acc.count );\n* }\n*\n* function read( acc, file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, acc );\n* }\n* acc.count += 1;\n* next( null, acc );\n* }\n* }\n*\n* var acc = {\n* 'count': 0\n* };\n* reduceRightAsync( files, acc, read, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunctionArray = require( '@stdlib/assert/is-function-array' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a reusable waterfall function.\n*\n* @param {FunctionArray} fcns - array of functions\n* @param {Callback} clbk - callback to invoke upon completion\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be an array of functions\n* @throws {TypeError} second argument must be a function\n* @returns {Function} waterfall function\n*\n* @example\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* var waterfall = factory( fcns, done );\n*\n* waterfall();\n* waterfall();\n* waterfall();\n*/\nfunction factory( fcns, clbk, thisArg ) {\n\tif ( !isFunctionArray( fcns ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of functions. Value: `%s`.', fcns ) );\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\treturn waterfall;\n\n\t/**\n\t* Executes functions in series, passing the results of one function as arguments to the next function.\n\t*\n\t* @private\n\t*/\n\tfunction waterfall() {\n\t\tvar idx = -1;\n\t\tnext(); // eslint-disable-line node/callback-return\n\n\t\t/**\n\t\t* Executes the next function in the series.\n\t\t*\n\t\t* @private\n\t\t* @param {(Error|null)} error - error object\n\t\t* @param {...*} args - results to pass to next callback\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction next() {\n\t\t\tvar args;\n\t\t\tvar len;\n\t\t\tvar i;\n\n\t\t\t// Check for an error...\n\t\t\tif ( arguments[ 0 ] ) {\n\t\t\t\treturn clbk( arguments[ 0 ] );\n\t\t\t}\n\t\t\t// Update the counter and check if we have run all functions...\n\t\t\tidx += 1;\n\t\t\tif ( idx >= fcns.length ) {\n\t\t\t\treturn clbk();\n\t\t\t}\n\t\t\t// Copy the remaining arguments...\n\t\t\tlen = arguments.length;\n\t\t\targs = new Array( len );\n\t\t\tfor ( i = 0; i < len-1; i++ ) {\n\t\t\t\targs[ i ] = arguments[ i+1 ];\n\t\t\t}\n\t\t\t// Add the callback:\n\t\t\targs[ i ] = next;\n\n\t\t\t// Apply the arguments to the next function in the waterfall:\n\t\t\tfcns[ idx ].apply( thisArg, args );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Executes functions in series, passing the results of one function as arguments to the next function.\n*\n* @param {FunctionArray} fcns - array of functions\n* @param {Callback} clbk - callback to invoke upon completion\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be an array of functions\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* waterfall( fcns, done );\n*/\nfunction waterfall( fcns, clbk, thisArg ) {\n\tfactory( fcns, clbk, thisArg )();\n}\n\n\n// EXPORTS //\n\nmodule.exports = waterfall;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Execute functions in series, passing the results of one function as arguments to the next function.\n*\n* @module @stdlib/utils/async/series-waterfall\n*\n* @example\n* var waterfall = require( '@stdlib/utils/async/series-waterfall' );\n*\n* function foo( next ) {\n* next( null, 'beep' );\n* }\n*\n* function bar( str, next ) {\n* console.log( str );\n* // => 'beep'\n*\n* next();\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* var fcns = [ foo, bar ];\n*\n* waterfall( fcns, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'some-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, n, opts, predicate, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar cnt;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0; // processed element count\n\tidx = -1;\n\tcnt = 0; // success count\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx += 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tcnt += 1;\n\t\t\tif ( cnt === n ) {\n\t\t\t\tflg = true;\n\t\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\t\treturn done( null, true );\n\t\t\t}\n\t\t}\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `someByAsync` function which invokes the predicate function for each collection element sequentially:\n* var someByAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* someByAsync( files, 2, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn someByAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {PositiveInteger} n - number of elements\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} second argument must be a positive integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction someByAsync( collection, n, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isPositiveInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* someByAsync( files, 2, predicate, done );\n*/\nfunction someByAsync( collection, n, options, predicate, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, n, predicate );\n\t}\n\tfactory( options, predicate )( collection, n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/async/some-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var someByAsync = require( '@stdlib/utils/async/some-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* someByAsync( files, 2, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'some-by-right-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes a predicate function once for each element in a collection, limiting the number of concurrently pending functions and iterating from right to left.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} predicate - predicate function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, n, opts, predicate, done ) {\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar cnt;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, false );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', predicate.length );\n\n\tcount = 0; // processed element count\n\tidx = len;\n\tcnt = 0; // success count\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx > 0 ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tidx -= 1;\n\t\tdebug( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once a provided function finishes processing a collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @param {*} [result] - test result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( flg ) {\n\t\t\t// Prevent further processing of collection elements:\n\t\t\treturn;\n\t\t}\n\t\tif ( error ) {\n\t\t\tflg = true;\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\n\t\tdebug( 'Test result: %s', !!result );\n\t\tif ( result && !flg ) {\n\t\t\tcnt += 1;\n\t\t\tif ( cnt === n ) {\n\t\t\t\tflg = true;\n\t\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\t\treturn done( null, true );\n\t\t\t}\n\t\t}\n\t\tif ( idx > 0 ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, false );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the predicate function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `someByRightAsync` function which invokes the predicate function for each collection element sequentially:\n* var someByRightAsync = factory( opts, predicate );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* // Try to read each element in `files`:\n* someByRightAsync( files, 2, done );\n*/\nfunction factory( options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = predicate;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn someByRightAsync;\n\n\t/**\n\t* Invokes a predicate function for each element in a collection, iterating from right to left.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {PositiveInteger} n - number of elements\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} second argument must be a positive integer\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction someByRightAsync( collection, n, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isPositiveInteger( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, n, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {boolean} bool - test result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, bool ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error, false );\n\t\t\t}\n\t\t\tdone( null, bool );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - If a predicate function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} predicate - predicate function to invoke for each element in a collection\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* someByRightAsync( files, 2, predicate, done );\n*/\nfunction someByRightAsync( collection, n, options, predicate, done ) {\n\tif ( arguments.length < 5 ) {\n\t\treturn factory( options )( collection, n, predicate );\n\t}\n\tfactory( options, predicate )( collection, n, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByRightAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/async/some-by-right\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var someByRightAsync = require( '@stdlib/utils/async/some-by-right' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, bool ) {\n* if ( error ) {\n* throw error;\n* }\n* if ( bool ) {\n* console.log( 'Successfully read some files.' );\n* } else {\n* console.log( 'Unable to read some files.' );\n* }\n* }\n*\n* function predicate( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, false );\n* }\n* next( null, true );\n* }\n* }\n*\n* someByRightAsync( files, 2, predicate, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar indexOf = require( './../../../index-of' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'tabulate-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = [];\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\ttmp = [];\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tvar i;\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Determine if we've seen the group/category before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\t\t\ti = indexOf( tmp, group );\n\t\t\tif ( i === -1 ) {\n\t\t\t\ttmp.push( group );\n\t\t\t\tout.push( [ group, 1, 0 ] );\n\t\t\t} else {\n\t\t\t\tout[ i ][ 1 ] += 1;\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\t// Compute percentages...\n\t\t\tfor ( i = 0; i < out.length; i++ ) {\n\t\t\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t\t\t}\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating a frequency table according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* - The output frequency table is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `tabulateByAsync` function which invokes the indicator function for each collection element sequentially:\n* var tabulateByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* tabulateByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn tabulateByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction tabulateByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - frequency table\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table according to an indicator function.\n*\n* ## Notes\n*\n* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).\n*\n* - The output frequency table is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* tabulateByAsync( files, indicator, done );\n*/\nfunction tabulateByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulateByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table according to an indicator function.\n*\n* @module @stdlib/utils/async/tabulate-by\n*\n* @example\n* var readFile = require( '@stdlib/fs/read-file' );\n* var tabulateByAsync = require( '@stdlib/utils/async/tabulate-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* tabulateByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not return an error, invokes a callback with the function result; otherwise, invokes a callback with a value `y`.\n*\n* @param {Function} x - function to invoke\n* @param {*} y - value to return if `x` returns an error\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* console.log( error.message );\n* }\n* console.log( result );\n* }\n*\n* trycatchAsync( x, -1.0, done );\n*/\nfunction trycatchAsync( x, y, done ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tx( clbk );\n\n\t/**\n\t* Callback invoked by `x`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {*} result - result\n\t* @returns {void}\n\t*/\n\tfunction clbk( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error, y );\n\t\t}\n\t\tdone( null, result );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trycatchAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not return an error, invoke a callback with the function result; otherwise, invoke a callback with a value `y`.\n*\n* @module @stdlib/utils/async/try-catch\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trycatchAsync = require( '@stdlib/utils/async/try-catch' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* console.log( error.message );\n* }\n* console.log( result );\n* }\n*\n* trycatchAsync( x, -1.0, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not return an error, invokes a callback with the function result; otherwise, invokes a second function `y`.\n*\n* @param {Function} x - function to invoke\n* @param {Function} y - function to invoke if `x` returns an error\n* @param {Function} done - callback to invoke upon completion\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} last argument must be a function\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* trythenAsync( x, y, done );\n*/\nfunction trythenAsync( x, y, done ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t}\n\tx( clbk1 );\n\n\t/**\n\t* Callback invoked by `x`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - function results\n\t* @returns {void}\n\t*/\n\tfunction clbk1( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\tif ( y.length === 1 ) {\n\t\t\t\treturn y( clbk2 );\n\t\t\t}\n\t\t\treturn y( error, clbk2 );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\treturn done.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked by `y`.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} args - function results\n\t* @returns {void}\n\t*/\n\tfunction clbk2( error ) {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tnargs = arguments.length;\n\t\targs = new Array( nargs );\n\t\targs[ 0 ] = null;\n\t\tfor ( i = 1; i < nargs; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\treturn done.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trythenAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not return an error, invoke a callback with the function result; otherwise, invoke a second function `y`.\n*\n* @module @stdlib/utils/async/try-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trythenAsync = require( '@stdlib/utils/async/try-then' );\n*\n* function x( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* if ( randu() > 0.5 ) {\n* return clbk( null, 1.0 );\n* }\n* clbk( new Error( 'beep' ) );\n* }\n* }\n*\n* function y( clbk ) {\n* setTimeout( onTimeout, 0 );\n* function onTimeout() {\n* clbk( null, -1.0 );\n* }\n* }\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* trythenAsync( x, y, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* untilAsync( predicate, fcn, done );\n*/\nfunction untilAsync( predicate, fcn, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tpredicate( idx, onPredicate );\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/async/until\n*\n* @example\n* var untilAsync = require( '@stdlib/utils/async/until' );\n*\n* function predicate( i, clbk ) {\n* clbk( null, i >= 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* untilAsync( predicate, fcn, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {Callback} done - callback to invoke upon completion\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* whileAsync( predicate, fcn, done );\n*/\nfunction whileAsync( predicate, fcn, done, thisArg ) {\n\tvar args;\n\tvar idx;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( done ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );\n\t}\n\targs = [];\n\tidx = 0;\n\tpredicate( idx, onPredicate );\n\n\t/**\n\t* Callback invoked upon a predicate result.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {boolean} result - predicate result\n\t* @returns {void}\n\t*/\n\tfunction onPredicate( error, result ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( result ) {\n\t\t\treturn fcn.call( thisArg, idx, next );\n\t\t}\n\t\tif ( args.length ) {\n\t\t\targs.unshift( null ); // error argument\n\t\t}\n\t\tdone.apply( null, args );\n\t}\n\n\t/**\n\t* Callback invoked upon completion of a provided function.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {...*} results - function results\n\t* @returns {void}\n\t*/\n\tfunction next( error ) {\n\t\tvar i;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tidx += 1;\n\n\t\t// Cache the most recent results...\n\t\tif ( arguments.length > 1 ) {\n\t\t\targs = new Array( arguments.length-1 );\n\t\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\t\targs[ i-1 ] = arguments[ i ];\n\t\t\t}\n\t\t}\n\t\t// Run the test condition:\n\t\tpredicate( idx, onPredicate );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/async/while\n*\n* @example\n* var whileAsync = require( '@stdlib/utils/async/while' );\n*\n* function predicate( i, clbk ) {\n* clbk( null, i < 5 );\n* }\n*\n* function fcn( i, next ) {\n* setTimeout( onTimeout, i );\n* function onTimeout() {\n* console.log( 'beep: %d', i );\n* next();\n* }\n* }\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* whileAsync( predicate, fcn, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name anyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by}\n*/\nsetReadOnly( ns, 'anyByAsync', require( './../../async/any-by' ) );\n\n/**\n* @name anyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by-right}\n*/\nsetReadOnly( ns, 'anyByRightAsync', require( './../../async/any-by-right' ) );\n\n/**\n* @name bifurcateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/bifurcate-by}\n*/\nsetReadOnly( ns, 'bifurcateByAsync', require( './../../async/bifurcate-by' ) );\n\n/**\n* @name composeAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/compose}\n*/\nsetReadOnly( ns, 'composeAsync', require( './../../async/compose' ) );\n\n/**\n* @name countByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/count-by}\n*/\nsetReadOnly( ns, 'countByAsync', require( './../../async/count-by' ) );\n\n/**\n* @name doUntilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-until}\n*/\nsetReadOnly( ns, 'doUntilAsync', require( './../../async/do-until' ) );\n\n/**\n* @name doWhileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-while}\n*/\nsetReadOnly( ns, 'doWhileAsync', require( './../../async/do-while' ) );\n\n/**\n* @name everyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by}\n*/\nsetReadOnly( ns, 'everyByAsync', require( './../../async/every-by' ) );\n\n/**\n* @name everyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by-right}\n*/\nsetReadOnly( ns, 'everyByRightAsync', require( './../../async/every-by-right' ) );\n\n/**\n* @name forEachAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each}\n*/\nsetReadOnly( ns, 'forEachAsync', require( './../../async/for-each' ) );\n\n/**\n* @name forEachRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each-right}\n*/\nsetReadOnly( ns, 'forEachRightAsync', require( './../../async/for-each-right' ) );\n\n/**\n* @name functionSequenceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/function-sequence}\n*/\nsetReadOnly( ns, 'functionSequenceAsync', require( './../../async/function-sequence' ) );\n\n/**\n* @name groupByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/group-by}\n*/\nsetReadOnly( ns, 'groupByAsync', require( './../../async/group-by' ) );\n\n/**\n* @name ifelseAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-else}\n*/\nsetReadOnly( ns, 'ifelseAsync', require( './../../async/if-else' ) );\n\n/**\n* @name ifthenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-then}\n*/\nsetReadOnly( ns, 'ifthenAsync', require( './../../async/if-then' ) );\n\n/**\n* @name inmapAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap}\n*/\nsetReadOnly( ns, 'inmapAsync', require( './../../async/inmap' ) );\n\n/**\n* @name inmapRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap-right}\n*/\nsetReadOnly( ns, 'inmapRightAsync', require( './../../async/inmap-right' ) );\n\n/**\n* @name mapFunAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-function}\n*/\nsetReadOnly( ns, 'mapFunAsync', require( './../../async/map-function' ) );\n\n/**\n* @name mapKeysAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-keys}\n*/\nsetReadOnly( ns, 'mapKeysAsync', require( './../../async/map-keys' ) );\n\n/**\n* @name mapValuesAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-values}\n*/\nsetReadOnly( ns, 'mapValuesAsync', require( './../../async/map-values' ) );\n\n/**\n* @name noneByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by}\n*/\nsetReadOnly( ns, 'noneByAsync', require( './../../async/none-by' ) );\n\n/**\n* @name noneByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by-right}\n*/\nsetReadOnly( ns, 'noneByRightAsync', require( './../../async/none-by-right' ) );\n\n/**\n* @name reduceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce}\n*/\nsetReadOnly( ns, 'reduceAsync', require( './../../async/reduce' ) );\n\n/**\n* @name reduceRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce-right}\n*/\nsetReadOnly( ns, 'reduceRightAsync', require( './../../async/reduce-right' ) );\n\n/**\n* @name waterfall\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/series-waterfall}\n*/\nsetReadOnly( ns, 'waterfall', require( './../../async/series-waterfall' ) );\n\n/**\n* @name someByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by}\n*/\nsetReadOnly( ns, 'someByAsync', require( './../../async/some-by' ) );\n\n/**\n* @name someByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by-right}\n*/\nsetReadOnly( ns, 'someByRightAsync', require( './../../async/some-by-right' ) );\n\n/**\n* @name tabulateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/tabulate-by}\n*/\nsetReadOnly( ns, 'tabulateByAsync', require( './../../async/tabulate-by' ) );\n\n/**\n* @name trycatchAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-catch}\n*/\nsetReadOnly( ns, 'trycatchAsync', require( './../../async/try-catch' ) );\n\n/**\n* @name trythenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-then}\n*/\nsetReadOnly( ns, 'trythenAsync', require( './../../async/try-then' ) );\n\n/**\n* @name untilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/until}\n*/\nsetReadOnly( ns, 'untilAsync', require( './../../async/until' ) );\n\n/**\n* @name whileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/while}\n*/\nsetReadOnly( ns, 'whileAsync', require( './../../async/while' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar returnValues = require( '@stdlib/array/base/bifurcate-values' );\nvar returnIndices = require( '@stdlib/array/base/bifurcate-indices' );\nvar returnPairs = require( '@stdlib/array/base/bifurcate-entries' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Collection} filter - collection indicating which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a collection\n* @throws {RangeError} first and last arguments must be the same length\n* @returns {(Array|ArrayArray)} results\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcate( arr, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcate( collection, options, filter ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tf = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = filter;\n\t}\n\tif ( !isCollection( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a collection. Value: `%s`.', f ) );\n\t}\n\tif ( collection.length !== f.length ) {\n\t\tthrow new RangeError( 'invalid arguments. First and last arguments must be the same length.' );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, f );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, f );\n\t}\n\treturn returnPairs( collection, f );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups.\n*\n* @module @stdlib/utils/bifurcate\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var out = bifurcate( arr, filter );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var bifurcate = require( '@stdlib/utils/bifurcate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var filter = [ true, true, false, true ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = bifurcate( arr, opts, filter );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tbool = predicate.call( thisArg, v, i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( v );\n\t\t} else {\n\t\t\tout[ 1 ].push( v );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as element indices.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbool = predicate.call( thisArg, collection[ i ], i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( i );\n\t\t} else {\n\t\t\tout[ 1 ].push( i );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as index-element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the predicate function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, {}, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcateBy( collection, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\treturn [];\n\t}\n\tout = [ [], [] ];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tbool = predicate.call( thisArg, v, i );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( [ i, v ] );\n\t\t} else {\n\t\t\tout[ 1 ].push( [ i, v ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnIndices = require( './return_indices.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\nfunction bifurcateBy( collection, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, opts, cb );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, opts, cb );\n\t}\n\treturn returnPairs( collection, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-by\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = bifurcateBy( arr, predicate );\n* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ 0, 1, 3 ], [ 2 ] ]\n*\n* @example\n* var bifurcateBy = require( '@stdlib/utils/bifurcate-by' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateBy( arr, opts, predicate );\n* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tv = obj[ key ];\n\t\tbool = predicate.call( thisArg, v, key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( v );\n\t\t} else {\n\t\t\tout[ 1 ].push( v );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tbool = predicate.call( thisArg, obj[ key ], key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( key );\n\t\t} else {\n\t\t\tout[ 1 ].push( key );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, {}, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateIn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tflg = false;\n\t\tv = obj[ key ];\n\t\tbool = predicate.call( thisArg, v, key );\n\t\tif ( bool ) {\n\t\t\tout[ 0 ].push( [ key, v ] );\n\t\t} else {\n\t\t\tout[ 1 ].push( [ key, v ] );\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits an object's own and inherited property values into two groups according to a predicate function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateIn( obj, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split an object's own and inherited property values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-in\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = bifurcateIn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* var bifurcateIn = require( '@stdlib/utils/bifurcate-in' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateIn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tv = obj[ key ];\n\t\t\tbool = predicate.call( thisArg, v, key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( v );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function specifying which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tbool = predicate.call( thisArg, obj[ key ], key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( key );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Splits values into two groups according to a predicate function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the predicate function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @returns {(Array|Array)} results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, {}, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateOwn( obj, opts, predicate ) {\n\tvar thisArg;\n\tvar bool;\n\tvar out;\n\tvar key;\n\tvar flg;\n\tvar v;\n\n\tthisArg = opts.thisArg;\n\tout = [ [], [] ];\n\tflg = true;\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tflg = false;\n\t\t\tv = obj[ key ];\n\t\t\tbool = predicate.call( thisArg, v, key );\n\t\t\tif ( bool ) {\n\t\t\t\tout[ 0 ].push( [ key, v ] );\n\t\t\t} else {\n\t\t\t\tout[ 1 ].push( [ key, v ] );\n\t\t\t}\n\t\t}\n\t}\n\tif ( flg ) {\n\t\tout.length = 0;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Splits an object's own property values into two groups according to a predicate function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} predicate - predicate function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} group results\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = bifurcateOwn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\nfunction bifurcateOwn( obj, options, predicate ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = predicate;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = bifurcateOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split an object's own property values into two groups according to a predicate function.\n*\n* @module @stdlib/utils/bifurcate-own\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var out = bifurcateOwn( obj, predicate );\n* // e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n*\n* @example\n* var bifurcateOwn = require( '@stdlib/utils/bifurcate-own' );\n*\n* function predicate( v ) {\n* return v[ 0 ] === 'b';\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = bifurcateOwn( obj, opts, predicate );\n* // e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts the first letter of each object key to uppercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'aa': 1,\n* 'bb': 2\n* };\n*\n* var obj2 = capitalizeKeys( obj1 );\n* // returns { 'Aa': 1, 'Bb': 2 }\n*/\nfunction capitalizeKeys( obj ) {\n\tvar out;\n\tvar key;\n\tvar k;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tif ( key === '' ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t} else {\n\t\t\t\tk = key.charAt( 0 ).toUpperCase() + key.slice( 1 );\n\t\t\t\tout[ k ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = capitalizeKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert the first letter of each object key to uppercase.\n*\n* @module @stdlib/utils/capitalize-keys\n*\n* @example\n* var capitalizeKeys = require( '@stdlib/utils/capitalize-keys' );\n*\n* var obj1 = {\n* 'aa': 1,\n* 'bb': 2\n* };\n*\n* var obj2 = capitalizeKeys( obj1 );\n* // returns { 'Aa': 1, 'Bb': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-accessor\n*\n* @example\n* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar MAX_ITERATIONS = require( '@stdlib/constants/float64/max' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Circular buffer constructor.\n*\n* @constructor\n* @param {(PositiveInteger|Collection)} buffer - buffer size or an array-like object to use as the underlying buffer\n* @throws {TypeError} must provide either a valid buffer size or an array-like object\n* @returns {CircularBuffer} circular buffer instance\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer...\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\nfunction CircularBuffer( buffer ) {\n\tvar buf;\n\tvar i;\n\tif ( !(this instanceof CircularBuffer) ) {\n\t\treturn new CircularBuffer( buffer );\n\t}\n\tif ( isPositiveInteger( buffer ) ) {\n\t\tbuf = [];\n\t\tfor ( i = 0; i < buffer; i++ ) {\n\t\t\tbuf.push( 0.0 ); // initialize with zeros, but could be any value (we're just ensuring a contiguous block of memory)\n\t\t}\n\t} else if ( isCollection( buffer ) ) {\n\t\tbuf = buffer;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide either a valid buffer size (i.e., a positive integer) or an array-like object which can serve as the underlying buffer. Value: `%s`.', buffer ) );\n\t}\n\tthis._buffer = arraylike2object( buf );\n\tthis._length = buf.length;\n\tthis._count = 0;\n\tthis._i = -1;\n\treturn this;\n}\n\n/**\n* Clears the buffer.\n*\n* @name clear\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {CircularBuffer} circular buffer instance\n*\n* @example\n* var b = new CircularBuffer( 2 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Get the number of elements currently in the buffer:\n* var n = b.count;\n* // returns 2\n*\n* // Clear the buffer:\n* b.clear();\n*\n* // Get the number of buffer values:\n* n = b.count;\n* // returns 0\n*/\nsetReadOnly( CircularBuffer.prototype, 'clear', function clear() {\n\tthis._count = 0;\n\tthis._i = -1; // this ensures that we always fill the buffer starting at index `0`.\n\treturn this;\n});\n\n/**\n* Number of elements currently in the buffer.\n*\n* @name count\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var b = new CircularBuffer( 4 );\n*\n* // Get the value count:\n* var n = b.count;\n* // returns 0\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n*\n* // Get the value count:\n* n = b.count;\n* // returns 2\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'count', function get() {\n\treturn this._count;\n});\n\n/**\n* Boolean indicating whether a circular buffer is full.\n*\n* @name full\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {boolean}\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Determine if the buffer is full:\n* var bool = b.full;\n* // returns false\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Determine if the buffer is full:\n* bool = b.full;\n* // returns true\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'full', function get() {\n\treturn this._count === this._length;\n});\n\n/**\n* Returns an iterator for iterating over a circular buffer.\n*\n* ## Notes\n*\n* - An iterator does not iterate over partially full buffers.\n*\n* @name iterator\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @param {NonNegativeInteger} [niters] - number of iterations\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Iterator} iterator\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Create an iterator:\n* var it = b.iterator( b.length );\n*\n* // Iterate over the buffer...\n* var v = it.next().value;\n* // returns 'bar'\n*\n* v = it.next().value;\n* // returns 'beep'\n*\n* v = it.next().value;\n* // returns 'boop'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( CircularBuffer.prototype, 'iterator', function iterator( niters ) {\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length ) {\n\t\tif ( !isNonNegativeInteger( niters ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', niters ) );\n\t\t}\n\t\tN = niters;\n\t} else {\n\t\tN = MAX_ITERATIONS;\n\t}\n\tself = this;\n\n\t// Initialize the iteration index and counter:\n\ti = this._i;\n\tn = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\tn += 1;\n\t\tif ( FLG || n > N ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\t// If the buffer is only partially full, don't allow iteration over \"undefined\" elements (this ensures similar behavior with `toArray()`)...\n\t\tif ( self._count !== self._length ) {\n\t\t\tFLG = true;\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\ti = (i+1) % self._length;\n\t\treturn {\n\t\t\t'value': self._buffer.accessors[ 0 ]( self._buffer.data, i ),\n\t\t\t'done': false\n\t\t};\n\n\t\t/* eslint-enable no-underscore-dangle */\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator( N );\n\t}\n});\n\n/**\n* Circular buffer length (i.e., capacity).\n*\n* @name length\n* @memberof CircularBuffer.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var b = new CircularBuffer( 4 );\n*\n* // Get the buffer capacity:\n* var len = b.length;\n* // returns 4\n*/\nsetReadOnlyAccessor( CircularBuffer.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Adds a value to the circular buffer.\n*\n* @name push\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @param {*} value - value to add\n* @returns {(*|void)} removed element or undefined\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer:\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\nsetReadOnly( CircularBuffer.prototype, 'push', function push( value ) {\n\tvar set;\n\tvar get;\n\tvar buf;\n\tvar v;\n\n\tbuf = this._buffer.data;\n\tget = this._buffer.accessors[ 0 ];\n\tset = this._buffer.accessors[ 1 ];\n\n\t// Compute the next buffer index:\n\tthis._i = (this._i+1) % this._length;\n\n\t// Check if we are still filling the buffer...\n\tif ( this._count < this._length ) {\n\t\tset( buf, this._i, value );\n\t\tthis._count += 1;\n\t\treturn;\n\t}\n\t// Replace an existing buffer element...\n\tv = get( buf, this._i );\n\tset( buf, this._i, value );\n\treturn v;\n});\n\n/**\n* Returns an array of circular buffer values.\n*\n* @name toArray\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {Array} circular buffer values\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Get an array of buffer values:\n* var vals = b.toArray();\n* // returns [ 'bar', 'beep', 'boop' ]\n*/\nsetReadOnly( CircularBuffer.prototype, 'toArray', function toArray() {\n\tvar buf;\n\tvar get;\n\tvar out;\n\tvar k;\n\tvar i;\n\n\tbuf = this._buffer.data;\n\tget = this._buffer.accessors[ 0 ];\n\n\tout = [];\n\tfor ( i = 1; i <= this._count; i++ ) {\n\t\t// Note: in a full buffer, `count == length`; in a partially full buffer, we need to ensure we always start at index `0`\n\t\tk = (this._i+i) % this._count;\n\t\tout.push( get( buf, k ) );\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a circular buffer as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `CircularBuffer` instance.\n*\n* @name toJSON\n* @memberof CircularBuffer.prototype\n* @type {Function}\n* @returns {Object} serialized circular buffer\n*\n* @example\n* var b = new CircularBuffer( 3 );\n*\n* // Add values to the buffer:\n* b.push( 'foo' );\n* b.push( 'bar' );\n* b.push( 'beep' );\n* b.push( 'boop' );\n*\n* // Serialize to JSON:\n* var o = b.toJSON();\n* // returns { 'type': 'circular-buffer', 'length': 3, 'data': [ 'bar', 'beep', 'boop' ] }\n*/\nsetReadOnly( CircularBuffer.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'circular-buffer';\n\tout.length = this._length;\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = CircularBuffer;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Circular buffer.\n*\n* @module @stdlib/utils/circular-buffer\n*\n* @example\n* var CircularBuffer = require( '@stdlib/utils/circular-buffer' );\n*\n* var b = new CircularBuffer( 3 );\n*\n* // Fill the buffer...\n* var v = b.push( 'foo' );\n* // returns undefined\n*\n* v = b.push( 'bar' );\n* // returns undefined\n*\n* v = b.push( 'beep' );\n* // returns undefined\n*\n* // Add another value to the buffer and return the removed element:\n* v = b.push( 'boop' );\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns the common own property names of two or more objects.\n*\n* @param {*} obj1 - first object\n* @param {*} obj2 - second object\n* @param {...*} [obj] - additional objects\n* @throws {Error} must provide at least two objects\n* @returns {(StringArray|EmptyArray)} common keys\n*\n* @example\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeys( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj3 = {\n* 'a': 1,\n* };\n*\n* var keys = commonKeys( obj1, obj2, obj3 );\n* // returns [ 'a' ]\n*/\nfunction commonKeys() {\n\tvar nargs;\n\tvar keys;\n\tvar arg;\n\tvar ptr;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tnargs = arguments.length;\n\tif ( nargs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least two objects.' );\n\t}\n\tkeys = objectKeys( arguments[ 0 ] );\n\tN = keys.length;\n\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\targ = arguments[ i ];\n\t\tptr = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tif ( hasOwnProp( arg, keys[ j ] ) ) {\n\t\t\t\tkeys[ ptr ] = keys[ j ];\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t}\n\t\tN = ptr;\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = commonKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the common own property names of two or more objects.\n*\n* @module @stdlib/utils/common-keys\n*\n* @example\n* var commonKeys = require( '@stdlib/utils/common-keys' );\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeys( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property names.\n*\n* @param {ObjectLike} obj - input object\n* @returns {Array} key array\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = keysIn( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keysIn( obj ) {\n\tvar out;\n\tvar key;\n\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( key );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keysIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property names.\n*\n* @module @stdlib/utils/keys-in\n*\n* @example\n* var keysIn = require( '@stdlib/utils/keys-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = keysIn( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keysIn = require( './../../keys-in' );\nvar hasProp = require( '@stdlib/assert/has-property' );\n\n\n// MAIN //\n\n/**\n* Returns the common own and inherited property names of two or more objects.\n*\n* @param {*} obj1 - first object\n* @param {*} obj2 - second object\n* @param {...*} [obj] - additional objects\n* @throws {Error} must provide at least two objects\n* @returns {(StringArray|EmptyArray)} common keys\n*\n* @example\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeysIn( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj3 = {\n* 'a': 1,\n* };\n*\n* var keys = commonKeysIn( obj1, obj2, obj3 );\n* // returns [ 'a' ]\n*/\nfunction commonKeysIn() {\n\tvar nargs;\n\tvar keys;\n\tvar arg;\n\tvar ptr;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tnargs = arguments.length;\n\tif ( nargs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least two objects.' );\n\t}\n\tkeys = keysIn( arguments[ 0 ] );\n\tN = keys.length;\n\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\targ = arguments[ i ];\n\t\tptr = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tif ( hasProp( arg, keys[ j ] ) ) {\n\t\t\t\tkeys[ ptr ] = keys[ j ];\n\t\t\t\tptr += 1;\n\t\t\t}\n\t\t}\n\t\tN = ptr;\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = commonKeysIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the common own and inherited property names of two or more objects.\n*\n* @module @stdlib/utils/common-keys-in\n*\n* @example\n* var commonKeysIn = require( '@stdlib/utils/common-keys-in' );\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3\n* };\n*\n* var obj2 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var keys = commonKeysIn( obj, obj2 );\n* // returns [ 'a', 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\ti += 1;\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tz = clbk.call( thisArg, z, i );\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Callback must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\ti += 1;\n\t\tv = it.next();\n\t\tz = v.value;\n\t\tif ( z ) {\n\t\t\tz = clbk.call( thisArg, z, i );\n\t\t\tif ( !isCollection( z ) ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Callback must return an array-like object containing vertices. Value: `%s`.', z ) );\n\t\t\t}\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t}\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Sets a bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to set\n* @returns {integer32} updated integer value\n*\n* @example\n* var v = setBit( 0, 2 );\n* // returns 4\n*/\nfunction setBit( value, i ) {\n\tvalue |= 1 << i;\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setBit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Clears a bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to clear\n* @returns {integer32} updated integer value\n*\n* @example\n* var v = clearBit( 5, 2 );\n* // returns 1\n*/\nfunction clearBit( value, i ) {\n\tvalue &= ~( 1 << i );\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clearBit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Boolean = require( '@stdlib/boolean/ctor' );\n\n\n// MAIN //\n\n/**\n* Checks whether a bit is set.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit to check\n* @returns {boolean} boolean indicating whether a bit is set\n*\n* @example\n* var bool = isSet( 4, 2 );\n* // returns true\n*\n* bool = isSet( 4, 0 );\n* // returns false\n*/\nfunction isSet( value, i ) {\n\treturn Boolean( ( value >> i ) & 1 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the value (either `0` or `1`) of a specified bit.\n*\n* @private\n* @param {integer32} value - integer value\n* @param {NonNegativeInteger} i - bit number\n* @returns {NonNegativeInteger} bit value\n*\n* @example\n* var b = bitValue( 4, 2 );\n* // returns 1\n*\n* b = bitValue( 4, 0 );\n* // returns 0\n*/\nfunction bitValue( value, i ) {\n\treturn ( value >> i ) & 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bitValue;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Int8Array = require( '@stdlib/array/int8' );\nvar format = require( '@stdlib/string/format' );\nvar ceil = require( '@stdlib/math/base/special/ceil' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar grev = require( '@stdlib/blas/ext/base/grev' );\nvar fromIteratorAdjList = require( './from_adjacency_list_iterator.js' );\nvar fromIteratorAdjListMap = require( './from_adjacency_list_iterator_map.js' );\nvar fromIteratorEdges = require( './from_edges_iterator.js' );\nvar fromIteratorEdgesMap = require( './from_edges_iterator_map.js' );\nvar setBit = require( './set_bit.js' );\nvar clearBit = require( './clear_bit.js' );\nvar isSet = require( './is_set.js' );\nvar bitValue = require( './bit_value.js' );\n\n\n// VARIABLES //\n\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\nvar NBITS = Int32Array.BYTES_PER_ELEMENT * 8; // 8 bits per byte\n\n\n// MAIN //\n\n/**\n* Compact adjacency matrix constructor.\n*\n* @constructor\n* @param {NonNegativeInteger} N - number of vertices\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*/\nfunction CompactAdjacencyMatrix( N ) {\n\tif ( !( this instanceof CompactAdjacencyMatrix ) ) {\n\t\treturn new CompactAdjacencyMatrix( N );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tthis._N = N; // number of vertices\n\tthis._M = 0; // number of edges\n\tthis._buffer = new Int32Array( ceil( N*N/NBITS ) ); // square matrix\n\treturn this;\n}\n\n/**\n* Creates a compact adjacency matrix from an adjacency list.\n*\n* @name fromAdjacencyList\n* @memberof CompactAdjacencyMatrix\n* @type {Function}\n* @param {(ArrayLikeObject|Iterable)} list - adjacency list\n* @param {Function} [clbk] - callback to invoke for each list element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a compact adjacency matrix\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} each element of a provided adjacency list must be an array-like object\n* @throws {TypeError} an iterator must return an array-like object containing vertices\n* @throws {TypeError} when provided an iterator, a callback must return an array-like object containing vertices\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var list = [ [ 1, 2 ], [ 2 ], [ 3 ], [] ];\n*\n* var adj = CompactAdjacencyMatrix.fromAdjacencyList( list );\n* // returns \n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*/\nsetReadOnly( CompactAdjacencyMatrix, 'fromAdjacencyList', function fromAdjacencyList( list ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar edges;\n\tvar clbk;\n\tvar adj;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( this !== CompactAdjacencyMatrix ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a compact adjacency matrix.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isArrayLikeObject( list ) ) {\n\t\tN = list.length;\n\t\tadj = new this( N );\n\t\tif ( clbk ) {\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tedges = clbk.call( thisArg, list[ i ], i );\n\t\t\t\tif ( !isCollection( edges ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return an array-like object. Value: `%s`.', edges ) );\n\t\t\t\t}\n\t\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn adj;\n\t\t}\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tedges = list[ i ];\n\t\t\tif ( !isCollection( edges ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of the adjacency list must be an array-like object. Value: `%s`.', list ) );\n\t\t\t}\n\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t}\n\t\t}\n\t\treturn adj;\n\t}\n\tif ( isObject( list ) && HAS_ITERATOR_SYMBOL && isFunction( list[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\ttmp = list[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( tmp.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', list ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorAdjListMap( tmp, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIteratorAdjList( tmp );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length;\n\t\tadj = new this( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tedges = tmp[ i ];\n\t\t\tfor ( j = 0; j < edges.length; j++ ) {\n\t\t\t\tadj.addEdge( i, edges[ j ] );\n\t\t\t}\n\t\t}\n\t\treturn adj;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', list ) );\n});\n\n/**\n* Creates a compact adjacency matrix from a list of edges.\n*\n* @name fromEdges\n* @memberof CompactAdjacencyMatrix\n* @type {Function}\n* @param {NonNegativeInteger} N - number of vertices\n* @param {(ArrayLikeObject|Iterable)} edges - list of edges\n* @param {Function} [clbk] - callback to invoke for each list element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a compact adjacency matrix\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be an array-like object\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} each element of a provided list of edges must be a two-element array-like object containing vertices\n* @throws {TypeError} an iterator must return a two-element array-like object containing vertices\n* @throws {TypeError} when provided an iterator, a callback must return a two-element array-like object containing vertices\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var edges = [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ], [ 2, 3 ] ];\n*\n* var adj = CompactAdjacencyMatrix.fromEdges( 4, edges );\n* // returns \n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*/\nsetReadOnly( CompactAdjacencyMatrix, 'fromEdges', function fromEdges( N, edges ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar edge;\n\tvar adj;\n\tvar tmp;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( this !== CompactAdjacencyMatrix ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a compact adjacency matrix.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( isArrayLikeObject( edges ) ) {\n\t\tif ( clbk ) {\n\t\t\tadj = new this( N );\n\t\t\tfor ( i = 0; i < edges.length; i++ ) {\n\t\t\t\tedge = clbk.call( thisArg, edges[ i ], i );\n\t\t\t\tif ( !isArrayLikeObject( edge ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return an array-like object. Value: `%s`.', edge ) );\n\t\t\t\t}\n\t\t\t\tadj.addEdge( edge[ 0 ], edge[ 1 ] );\n\t\t\t}\n\t\t\treturn adj;\n\t\t}\n\t\tadj = new this( N );\n\t\tfor ( i = 0; i < edges.length; i++ ) {\n\t\t\tedge = edges[ i ];\n\t\t\tif ( !isArrayLikeObject( edge ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of the edge list must be an array-like object. Value: `%s`.', edge ) );\n\t\t\t}\n\t\t\tadj.addEdge( edge[ 0 ], edge[ 1 ] );\n\t\t}\n\t\treturn adj;\n\t}\n\n\tif ( isObject( edges ) && HAS_ITERATOR_SYMBOL && isFunction( edges[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\ttmp = edges[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( tmp.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', edges ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorEdgesMap( tmp, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIteratorEdges( tmp );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length;\n\t\tadj = new this( len/2 );\n\t\tfor ( i = 0; i < len; i += 2 ) {\n\t\t\tadj.addEdge( tmp[ i ], tmp[ i+1 ] );\n\t\t}\n\t\treturn adj;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', edges ) );\n});\n\n/**\n* Returns indices (\"bucket\" and bit offset) for an `(i,j)` vertex pair.\n*\n* @private\n* @name _loc\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @param {Array} out - output array\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {Array} output array\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, '_loc', function loc( i, j, out ) {\n\tvar bucket;\n\tvar bit;\n\tvar idx;\n\n\t// Compute a strided index for the desired bit:\n\tidx = ( i*this._N ) + j;\n\n\t// Compute the index of the buffer element (bucket) containing the bit:\n\tbucket = floor( idx / NBITS );\n\n\t// Compute the bit offset:\n\tbit = idx - ( bucket*NBITS );\n\n\t// Set the output values:\n\tout[ 0 ] = bucket;\n\tout[ 1 ] = bit;\n\n\treturn out;\n});\n\n/**\n* Adds a directed edge between two vertices.\n*\n* @name addEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'addEdge', function addEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Set the bit for the edge:\n\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) === false ) {\n\t\tthis._buffer[ idx[0] ] = setBit( this._buffer[ idx[0] ], idx[1] );\n\t\tthis._M += 1;\n\t}\n\treturn this;\n});\n\n/**\n* Returns the list of all edges.\n*\n* @name edges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Array}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var edges = adj.edges;\n* // returns [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ], [ 2, 3 ] ]\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'edges', function edges() {\n\tvar edges;\n\tvar idx;\n\tvar i;\n\tvar j;\n\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\tfor ( j = 0; j < this._N; j++ ) {\n\t\t\t// Resolve the `(i,j)` pair:\n\t\t\tidx = this._loc( i, j, idx );\n\n\t\t\t// Check for an edge:\n\t\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\t\tedges.push( [ i, j ] );\n\t\t\t}\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Checks whether a directed edge exists between two vertices.\n*\n* @name hasEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {boolean} boolean indicating if an edge exists\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*\n* var bool = adj.hasEdge( 0, 1 );\n* // returns true\n*\n* bool = adj.hasEdge( 0, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 2 );\n* // returns true\n*\n* bool = adj.hasEdge( 2, 3 );\n* // returns true\n*\n* bool = adj.hasEdge( 1, 3 );\n* // returns false\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'hasEdge', function hasEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Check for an edge:\n\treturn isSet( this._buffer[ idx[0] ], idx[1] );\n});\n\n/**\n* Returns the indegree of a vertex (i.e., number of edges ending at a vertex).\n*\n* @name inDegree\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} j - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {NonNegativeInteger} indegree\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var d = adj.inDegree( 2 );\n* // returns 2\n*\n* d = adj.inDegree( 3 );\n* // returns 1\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'inDegree', function inDegree( j ) {\n\tvar deg;\n\tvar idx;\n\tvar i;\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Iterate over the rows and add up the number of edges...\n\tdeg = 0;\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tdeg += bitValue( this._buffer[ idx[0] ], idx[1] );\n\t}\n\treturn deg;\n});\n\n/**\n* Returns a list of vertices having edges ending at a specified vertex.\n*\n* @name inEdges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} j - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {Array} list of vertices\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var e = adj.inEdges( 2 );\n* // returns [ 0, 1 ]\n*\n* e = adj.inEdges( 3 );\n* // returns [ 2 ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'inEdges', function inEdges( j ) {\n\tvar edges;\n\tvar idx;\n\tvar i;\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Iterate over the rows and retrieve edges...\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\tedges.push( i );\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Returns the total number of edges.\n*\n* @name nedges\n* @memberof CompactAdjacencyMatrix.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n*\n* // ...\n*\n* var M = adj.nedges;\n* // returns 3\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'nedges', function nedges() {\n\treturn this._M;\n});\n\n/**\n* Returns the number of vertices.\n*\n* @name nvertices\n* @memberof CompactAdjacencyMatrix.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* var N = adj.nvertices;\n* // returns 4\n*/\nsetReadOnlyAccessor( CompactAdjacencyMatrix.prototype, 'nvertices', function nvertices() {\n\treturn this._N;\n});\n\n/**\n* Returns the outdegree of a vertex (i.e., number of edges starting from a vertex).\n*\n* @name outDegree\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {NonNegativeInteger} outdegree\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var d = adj.outDegree( 2 );\n* // returns 1\n*\n* d = adj.outDegree( 0 );\n* // returns 2\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'outDegree', function outDegree( i ) {\n\tvar deg;\n\tvar idx;\n\tvar j;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', i ) );\n\t}\n\t// Iterate over the columns and add up the number of edges...\n\tdeg = 0;\n\tidx = [ 0, 0 ];\n\tfor ( j = 0; j < this._N; j++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tdeg += bitValue( this._buffer[ idx[0] ], idx[1] );\n\t}\n\treturn deg;\n});\n\n/**\n* Returns a list of vertices having edges starting at a specified vertex.\n*\n* @name outEdges\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - vertex\n* @throws {TypeError} must provide a nonnegative integer\n* @throws {RangeError} must not exceed matrix dimensions\n* @returns {Array} list of vertices\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var e = adj.outEdges( 2 );\n* // returns [ 3 ]\n*\n* e = adj.outEdges( 0 );\n* // returns [ 1, 2 ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'outEdges', function outEdges( i ) {\n\tvar edges;\n\tvar idx;\n\tvar j;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Vertex cannot exceed matrix dimensions. Value: `%u`.', i ) );\n\t}\n\t// Iterate over the rows and retrieve edges...\n\tedges = [];\n\tidx = [ 0, 0 ];\n\tfor ( j = 0; j < this._N; j++ ) {\n\t\t// Resolve the `(i,j)` pair:\n\t\tidx = this._loc( i, j, idx );\n\n\t\t// Check for an edge:\n\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\tedges.push( j );\n\t\t}\n\t}\n\treturn edges;\n});\n\n/**\n* Removes a directed edge between two vertices.\n*\n* @name removeEdge\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @param {NonNegativeInteger} i - starting vertex\n* @param {NonNegativeInteger} j - ending vertex\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {RangeError} first argument must not exceed matrix dimensions\n* @throws {RangeError} second argument must not exceed matrix dimensions\n* @returns {CompactAdjacencyMatrix} adjacency matrix instance\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*\n* adj.removeEdge( 0, 1 );\n* adj.removeEdge( 0, 2 );\n* adj.removeEdge( 1, 2 );\n* adj.removeEdge( 2, 3 );\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'removeEdge', function removeEdge( i, j ) {\n\tvar idx;\n\tif ( !isNonNegativeInteger( i ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', i ) );\n\t}\n\tif ( !isNonNegativeInteger( j ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', j ) );\n\t}\n\tif ( i >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. First argument exceeds matrix dimensions. Value: `%u`.', i ) );\n\t}\n\tif ( j >= this._N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds matrix dimensions. Value: `%u`.', j ) );\n\t}\n\t// Resolve the `(i,j)` pair:\n\tidx = this._loc( i, j, [ 0, 0 ] );\n\n\t// Clear the bit for the edge:\n\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\tthis._buffer[ idx[0] ] = clearBit( this._buffer[ idx[0] ], idx[1] );\n\t\tthis._M -= 1;\n\t}\n\treturn this;\n});\n\n/**\n* Returns an adjacency list representation.\n*\n* @name toAdjacencyList\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @returns {Array} adjacency list representation\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var list = adj.toAdjacencyList();\n* // returns [ [ 1, 2 ], [ 2 ], [ 3 ], [] ]\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'toAdjacencyList', function toAdjacencyList() {\n\tvar list;\n\tvar idx;\n\tvar tmp;\n\tvar i;\n\tvar j;\n\n\tlist = [];\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < this._N; i++ ) {\n\t\ttmp = [];\n\t\tfor ( j = 0; j < this._N; j++ ) {\n\t\t\t// Resolve the `(i,j)` pair:\n\t\t\tidx = this._loc( i, j, idx );\n\n\t\t\t// Check for an edge:\n\t\t\tif ( isSet( this._buffer[ idx[0] ], idx[1] ) ) {\n\t\t\t\ttmp.push( j );\n\t\t\t}\n\t\t}\n\t\tlist.push( tmp );\n\t}\n\treturn list;\n});\n\n/**\n* Returns a topological ordering of the directed graph.\n*\n* ## Notes\n*\n* - The function returns a two-element array.\n* - If the function is able to compute a topological ordering, the first array element is the topological ordering and the second element is `null`.\n* - If a topological ordering cannot be achieved (e.g., due to the graph not being a directed acyclic graph (DAG)), the first array element is `null` and the second element is the first encountered cycle.\n*\n* @name toposort\n* @memberof CompactAdjacencyMatrix.prototype\n* @type {Function}\n* @returns {Array} topological ordering\n*\n* @example\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* adj.addEdge( 1, 0 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 2, 3 );\n*\n* var results = adj.toposort();\n* // returns \n*\n* var order = results[ 0 ];\n* // returns [ 1, 0, 2, 3 ]\n*\n* var cycle = results[ 1 ];\n* // returns null\n*/\nsetReadOnly( CompactAdjacencyMatrix.prototype, 'toposort', function toposort() {\n\tvar marks;\n\tvar self;\n\tvar out;\n\tvar idx;\n\tvar err;\n\tvar N;\n\tvar s;\n\tvar i;\n\n\tself = this;\n\tN = this._N;\n\n\t// Initialize an empty list that will contain the sorted vertices:\n\tout = [];\n\n\t// If the graph is empty, nothing to sort...\n\tif ( this._N === 0 ) {\n\t\treturn [ out, null ];\n\t}\n\t// Initialize an array for keeping track of whether a vertex has been \"visited\":\n\tmarks = new Int8Array( N );\n\n\t// Initialize a stack for keeping track of cycles:\n\ts = [];\n\n\t// Process vertices using depth-first-search...\n\tidx = [ 0, 0 ];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( marks[ i ] === 0 ) {\n\t\t\terr = visit( i );\n\t\t\tif ( err !== 0 ) {\n\t\t\t\t// Found a cycle...\n\t\t\t\ts.push( i );\n\t\t\t\treturn [ null, s ];\n\t\t\t}\n\t\t}\n\t}\n\t// Reverse the output array as the leaves were added first, followed the by the roots, via depth-first-search:\n\tgrev( out.length, out, 1 );\n\n\treturn [ out, null ];\n\n\t/**\n\t* Visits a graph vertex and follows edges until finding a leaf vertex (if one exists).\n\t*\n\t* ## Notes\n\t*\n\t* - If the function is able to successfully perform a depth-first-search, the functions returns `0`; otherwise, the function returns `-1` in the event of a cycle.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} i - vertex\n\t* @returns {integer} error code\n\t*/\n\tfunction visit( i ) {\n\t\tvar err;\n\t\tvar j;\n\n\t\t// Check if we've already processed/visited this vertex...\n\t\tif ( marks[ i ] === 2 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t// Check if we've seen this vertex before and the vertex is still being processed...\n\t\tif ( marks[ i ] === 1 ) {\n\t\t\t// We've found a cycle...\n\t\t\treturn -1;\n\t\t}\n\t\t// Mark the current vertex as currently being processed:\n\t\tmarks[ i ] = 1;\n\n\t\t// Follow all edges from the current vertex...\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tidx = self._loc( i, j, idx ); // eslint-disable-line no-underscore-dangle\n\t\t\tif ( isSet( self._buffer[ idx[0] ], idx[1] ) ) { // eslint-disable-line no-underscore-dangle\n\t\t\t\terr = visit( j );\n\t\t\t\tif ( err !== 0 ) {\n\t\t\t\t\t// This vertex is part of a cycle, so add to cycle stack...\n\t\t\t\t\ts.push( j );\n\t\t\t\t\treturn err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Mark the current vertex as processed:\n\t\tmarks[ i ] = 2;\n\n\t\t// Add to the output array now that all subsequent vertices (relative to this vertex) in the graph have already been added to the output array:\n\t\tout.push( i );\n\n\t\treturn 0;\n\t}\n});\n\n\n// EXPORTS //\n\nmodule.exports = CompactAdjacencyMatrix;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compact adjacency matrix.\n*\n* @module @stdlib/utils/compact-adjacency-matrix\n*\n* @example\n* var CompactAdjacencyMatrix = require( '@stdlib/utils/compact-adjacency-matrix' );\n*\n* var adj = new CompactAdjacencyMatrix( 4 );\n* // returns \n*\n* // ...\n*\n* adj.addEdge( 0, 1 );\n* adj.addEdge( 0, 2 );\n* adj.addEdge( 1, 2 );\n* adj.addEdge( 2, 3 );\n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function composition.\n*\n* @param {...Function} f - functions to compose\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} composite function\n*\n* @example\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = compose( c, b, a );\n*\n* var z = f( 6 );\n* // returns 3\n*/\nfunction compose() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to compose.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn composite;\n\n\t/**\n\t* Composite function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} result\n\t*/\n\tfunction composite() {\n\t\tvar args;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\targs = f[ nFuncs-1 ].apply( null, args );\n\t\tfor ( i = nFuncs-2; i >= 0; i-- ) {\n\t\t\targs = f[ i ]( args );\n\t\t}\n\t\treturn args;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = compose;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function composition.\n*\n* @module @stdlib/utils/compose\n*\n* @example\n* var compose = require( '@stdlib/utils/compose' );\n*\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = compose( c, b, a );\n*\n* var z = f( 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Creates a function which always returns the same value.\n*\n* @param {*} [value] - value to always return\n* @returns {Function} constant function\n*\n* @example\n* var fcn = wrap( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\nfunction wrap( value ) {\n\treturn constantFunction;\n\n\t/**\n\t* Constant function.\n\t*\n\t* @private\n\t* @returns {*} constant value\n\t*/\n\tfunction constantFunction() {\n\t\treturn value;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a constant function.\n*\n* @module @stdlib/utils/constant-function\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var fcn = constantFunction( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' );\nvar lowercase = require( '@stdlib/string/base/lowercase' );\nvar replace = require( '@stdlib/string/replace' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RE_WIN_DEVICE_ROOT = /^([A-Za-z]):[\\\\\\/]+/; // eslint-disable-line no-useless-escape\nvar RE_POSIX_DEVICE_ROOT =/^\\/([A-Za-z])\\//;\n\n\n// MAIN //\n\n/**\n* Converts between POSIX and Windows paths.\n*\n* @param {string} from - path to convert\n* @param {string} to - output path convention\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} second argument must be a string\n* @throws {RangeError} second argument must be a recognized output path convention\n* @throws {Error} cannot convert a Windows extended-length path to a non-Windows path convention\n* @returns {string} converted path\n*\n* @example\n* var p = convertPath( '/c/foo/bar/beep.c', 'win32' );\n* // returns 'c:\\foo\\bar\\beep.c'\n*\n* @example\n* var p = convertPath( '/c/foo/bar/beep.c', 'mixed' );\n* // returns 'c:/foo/bar/beep.c'\n*\n* @example\n* var p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'posix' );\n* // returns '/c/foo/bar/beep.c'\n*\n* @example\n* var p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'mixed' );\n* // returns 'C:/foo/bar/beep.c'\n*/\nfunction convertPath( from, to ) {\n\tvar device;\n\tvar parts;\n\tvar out;\n\tif ( !isString( from ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', from ) );\n\t}\n\tif ( !isString( to ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', to ) );\n\t}\n\tif (\n\t\tto !== 'win32' &&\n\t\tto !== 'mixed' &&\n\t\tto !== 'posix'\n\t) {\n\t\tthrow new Error( format( 'invalid argument. Second argument must be a recognized output path convention. Value: `%s`.', to ) );\n\t}\n\tout = from;\n\n\t// Convert to a Windows path convention by transforming a POSIX device root (if present) and using a Windows path separator...\n\tif ( to === 'win32' ) {\n\t\tparts = RE_POSIX_DEVICE_ROOT.exec( out );\n\t\tif ( parts ) {\n\t\t\tdevice = parts[ 1 ]+':\\\\';\n\t\t\tout = replace( out, RE_POSIX_DEVICE_ROOT, device );\n\t\t}\n\t\treturn replace( out, '/', '\\\\' );\n\t}\n\t// Check for Windows extended-length paths...\n\tif ( reExtendedLengthPath.REGEXP.test( from ) ) {\n\t\tthrow new Error( format( 'invalid argument. Cannot convert Windows extended-length paths to POSIX paths. Value: `%s`.', from ) );\n\t}\n\t// Convert to a mixed path convention by combining a Windows drive letter convention with a POSIX path separator...\n\tif ( to === 'mixed' ) {\n\t\tparts = RE_POSIX_DEVICE_ROOT.exec( out );\n\t\tif ( parts ) {\n\t\t\tdevice = parts[ 1 ]+':/';\n\t\t\tout = replace( out, RE_POSIX_DEVICE_ROOT, device );\n\t\t} else {\n\t\t\tparts = RE_WIN_DEVICE_ROOT.exec( out );\n\t\t\tif ( parts ) {\n\t\t\t\tdevice = parts[ 1 ]+':/';\n\t\t\t\tout = replace( out, RE_WIN_DEVICE_ROOT, device );\n\t\t\t}\n\t\t}\n\t\treturn replace( out, '\\\\', '/' );\n\t}\n\t// Convert to a POSIX path convention by transforming a Windows device root (if present) and using a POSIX path separator...\n\tparts = RE_WIN_DEVICE_ROOT.exec( out );\n\tif ( parts ) {\n\t\tdevice = '/'+lowercase( parts[ 1 ] )+'/';\n\t\tout = replace( out, RE_WIN_DEVICE_ROOT, device );\n\t}\n\treturn replace( out, '\\\\', '/' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = convertPath;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert between POSIX and Windows paths.\n*\n* @module @stdlib/utils/convert-path\n*\n* @example\n* var convertPath = require( '@stdlib/utils/convert-path' );\n*\n* var p = convertPath( '/c/foo/bar/beep.c', 'win32' );\n* // returns 'c:\\foo\\bar\\beep.c'\n*\n* p = convertPath( '/c/foo/bar/beep.c', 'mixed' );\n* // returns 'c:/foo/bar/beep.c'\n*\n* p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'posix' );\n* // returns '/c/foo/bar/beep.c'\n*\n* p = convertPath( 'C:\\\\foo\\\\bar\\\\beep.c', 'mixed' );\n* // returns 'C:/foo/bar/beep.c'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar reRegExp = require( '@stdlib/regexp/regexp' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Parses a regular expression string and returns a new regular expression.\n*\n* @param {string} str - regular expression string\n* @throws {TypeError} must provide a regular expression string\n* @returns {(RegExp|null)} regular expression or null\n*\n* @example\n* var re = reFromString( '/beep/' );\n* // returns /beep/\n*/\nfunction reFromString( str ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a regular expression string. Value: `%s`.', str ) );\n\t}\n\t// Capture the regular expression pattern and any flags:\n\tstr = reRegExp().exec( str );\n\n\t// Create a new regular expression:\n\treturn ( str ) ? new RegExp( str[1], str[2] ) : null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reFromString;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a regular expression from a regular expression string.\n*\n* @module @stdlib/utils/regexp-from-string\n*\n* @example\n* var reFromString = require( '@stdlib/utils/regexp-from-string' );\n*\n* var re = reFromString( '/beep/' );\n* // returns /beep/\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertyNames = Object.getOwnPropertyNames;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn propertyNames( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\nvar keys = require( './../../keys' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = getOwnPropertyNames( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction getOwnPropertyNames( value ) {\n\treturn keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/property-names\n*\n* @example\n* var getOwnPropertyNames = require( '@stdlib/utils/property-names' );\n*\n* var keys = getOwnPropertyNames({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar propertyDescriptor = Object.getOwnPropertyDescriptor;\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tvar desc;\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\tdesc = propertyDescriptor( value, property );\n\treturn ( desc === void 0 ) ? null : desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction getOwnPropertyDescriptor( value, property ) {\n\tif ( hasOwnProp( value, property ) ) {\n\t\treturn {\n\t\t\t'configurable': true,\n\t\t\t'enumerable': true,\n\t\t\t'writable': true,\n\t\t\t'value': value[ property ]\n\t\t};\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's own property.\n*\n* @module @stdlib/utils/property-descriptor\n*\n* @example\n* var getOwnPropertyDescriptor = require( '@stdlib/utils/property-descriptor' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var keys = getOwnPropertyDescriptor( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( './../../native-class' );\nvar getProto = require( './proto.js' );\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getPrototypeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar builtin = require( './native.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getProto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\nvar getProto = require( './detect.js' );\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getPrototypeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the prototype of a provided object.\n*\n* @module @stdlib/utils/get-prototype-of\n*\n* @example\n* var getPrototype = require( '@stdlib/utils/get-prototype-of' );\n*\n* var proto = getPrototype( {} );\n* // returns {}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Int8Array = require( '@stdlib/array/int8' );\nvar Uint8Array = require( '@stdlib/array/uint8' );\nvar Uint8ClampedArray = require( '@stdlib/array/uint8c' );\nvar Int16Array = require( '@stdlib/array/int16' );\nvar Uint16Array = require( '@stdlib/array/uint16' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float32Array = require( '@stdlib/array/float32' );\nvar Float64Array = require( '@stdlib/array/float64' );\n\n\n// VARIABLES //\n\nvar hash;\n\n\n// FUNCTIONS //\n\n/**\n* Copies an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - array to copy\n* @returns {Int8Array} new array\n*/\nfunction int8array( arr ) {\n\treturn new Int8Array( arr );\n}\n\n/**\n* Copies a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - array to copy\n* @returns {Uint8Array} new array\n*/\nfunction uint8array( arr ) {\n\treturn new Uint8Array( arr );\n}\n\n/**\n* Copies a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - array to copy\n* @returns {Uint8ClampedArray} new array\n*/\nfunction uint8clampedarray( arr ) {\n\treturn new Uint8ClampedArray( arr );\n}\n\n/**\n* Copies an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - array to copy\n* @returns {Int16Array} new array\n*/\nfunction int16array( arr ) {\n\treturn new Int16Array( arr );\n}\n\n/**\n* Copies a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - array to copy\n* @returns {Uint16Array} new array\n*/\nfunction uint16array( arr ) {\n\treturn new Uint16Array( arr );\n}\n\n/**\n* Copies an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - array to copy\n* @returns {Int32Array} new array\n*/\nfunction int32array( arr ) {\n\treturn new Int32Array( arr );\n}\n\n/**\n* Copies a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - array to copy\n* @returns {Uint32Array} new array\n*/\nfunction uint32array( arr ) {\n\treturn new Uint32Array( arr );\n}\n\n/**\n* Copies a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - array to copy\n* @returns {Float32Array} new array\n*/\nfunction float32array( arr ) {\n\treturn new Float32Array( arr );\n}\n\n/**\n* Copies a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - array to copy\n* @returns {Float64Array} new array\n*/\nfunction float64array( arr ) {\n\treturn new Float64Array( arr );\n}\n\n/**\n* Returns a hash of functions for copying typed arrays.\n*\n* @private\n* @returns {Object} function hash\n*/\nfunction typedarrays() {\n\tvar out = {\n\t\t'int8array': int8array,\n\t\t'uint8array': uint8array,\n\t\t'uint8clampedarray': uint8clampedarray,\n\t\t'int16array': int16array,\n\t\t'uint16array': uint16array,\n\t\t'int32array': int32array,\n\t\t'uint32array': uint32array,\n\t\t'float32array': float32array,\n\t\t'float64array': float64array\n\t};\n\treturn out;\n}\n\n\n// MAIN //\n\nhash = typedarrays();\n\n\n// EXPORTS //\n\nmodule.exports = hash;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar typeOf = require( './../../type-of' );\nvar regexp = require( './../../regexp-from-string' );\nvar indexOf = require( './../../index-of' );\nvar objectKeys = require( './../../keys' );\nvar propertyNames = require( './../../property-names' );\nvar propertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar defineProperty = require( './../../define-property' );\nvar copyBuffer = require( '@stdlib/buffer/from-buffer' );\nvar typedArrays = require( './typed_arrays.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Clones a class instance.\n*\n* ## Notes\n*\n* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.\n* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.\n*\n* @private\n* @param {Object} val - class instance\n* @returns {Object} new instance\n*/\nfunction cloneInstance( val ) {\n\tvar cache;\n\tvar names;\n\tvar name;\n\tvar refs;\n\tvar desc;\n\tvar tmp;\n\tvar ref;\n\tvar i;\n\n\tcache = [];\n\trefs = [];\n\n\tref = Object.create( getPrototypeOf( val ) );\n\tcache.push( val );\n\trefs.push( ref );\n\n\tnames = propertyNames( val );\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tname = names[ i ];\n\t\tdesc = propertyDescriptor( val, name );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( val[name] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( val[name], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( ref, name, desc );\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( ref );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( ref );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( ref );\n\t}\n\treturn ref;\n}\n\n/**\n* Copies an error object.\n*\n* @private\n* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy\n* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy\n*\n* @example\n* var err1 = new TypeError( 'beep' );\n*\n* var err2 = copyError( err1 );\n* // returns \n*/\nfunction copyError( error ) {\n\tvar cache = [];\n\tvar refs = [];\n\tvar keys;\n\tvar desc;\n\tvar tmp;\n\tvar key;\n\tvar err;\n\tvar i;\n\n\t// Create a new error...\n\terr = new error.constructor( error.message );\n\n\tcache.push( error );\n\trefs.push( err );\n\n\t// If a `stack` property is present, copy it over...\n\tif ( error.stack ) {\n\t\terr.stack = error.stack;\n\t}\n\t// Node.js specific (system errors)...\n\tif ( error.code ) {\n\t\terr.code = error.code;\n\t}\n\tif ( error.errno ) {\n\t\terr.errno = error.errno;\n\t}\n\tif ( error.syscall ) {\n\t\terr.syscall = error.syscall;\n\t}\n\t// Any enumerable properties...\n\tkeys = objectKeys( error );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tdesc = propertyDescriptor( error, key );\n\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\ttmp = ( isArray( error[ key ] ) ) ? [] : {};\n\t\t\tdesc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );\n\t\t}\n\t\tdefineProperty( err, key, desc );\n\t}\n\treturn err;\n}\n\n\n// MAIN //\n\n/**\n* Recursively performs a deep copy of an input object.\n*\n* @private\n* @param {*} val - value to copy\n* @param {(Array|Object)} copy - copy\n* @param {Array} cache - an array of visited objects\n* @param {Array} refs - an array of object references\n* @param {NonNegativeInteger} level - copy depth\n* @returns {*} deep copy\n*/\nfunction deepCopy( val, copy, cache, refs, level ) {\n\tvar parent;\n\tvar keys;\n\tvar name;\n\tvar desc;\n\tvar ctor;\n\tvar key;\n\tvar ref;\n\tvar x;\n\tvar i;\n\tvar j;\n\n\tlevel -= 1;\n\n\t// Primitives and functions...\n\tif (\n\t\ttypeof val !== 'object' ||\n\t\tval === null\n\t) {\n\t\treturn val;\n\t}\n\tif ( isBuffer( val ) ) {\n\t\treturn copyBuffer( val );\n\t}\n\tif ( isError( val ) ) {\n\t\treturn copyError( val );\n\t}\n\t// Objects...\n\tname = typeOf( val );\n\n\tif ( name === 'date' ) {\n\t\treturn new Date( +val );\n\t}\n\tif ( name === 'regexp' ) {\n\t\treturn regexp( val.toString() );\n\t}\n\tif ( name === 'set' ) {\n\t\treturn new Set( val );\n\t}\n\tif ( name === 'map' ) {\n\t\treturn new Map( val );\n\t}\n\tif (\n\t\tname === 'string' ||\n\t\tname === 'boolean' ||\n\t\tname === 'number'\n\t) {\n\t\t// If provided an `Object`, return an equivalent primitive!\n\t\treturn val.valueOf();\n\t}\n\tctor = typedArrays[ name ];\n\tif ( ctor ) {\n\t\treturn ctor( val );\n\t}\n\t// Class instances...\n\tif (\n\t\tname !== 'array' &&\n\t\tname !== 'object'\n\t) {\n\t\t// Cloning requires ES5 or higher...\n\t\tif ( typeof Object.freeze === 'function' ) {\n\t\t\treturn cloneInstance( val );\n\t\t}\n\t\treturn {};\n\t}\n\t// Arrays and plain objects...\n\tkeys = objectKeys( val );\n\tif ( level > 0 ) {\n\t\tparent = name;\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tx = val[ key ];\n\n\t\t\t// Primitive, Buffer, special class instance...\n\t\t\tname = typeOf( x );\n\t\t\tif (\n\t\t\t\ttypeof x !== 'object' ||\n\t\t\t\tx === null ||\n\t\t\t\t(\n\t\t\t\t\tname !== 'array' &&\n\t\t\t\t\tname !== 'object'\n\t\t\t\t) ||\n\t\t\t\tisBuffer( x )\n\t\t\t) {\n\t\t\t\tif ( parent === 'object' ) {\n\t\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\t\tdesc.value = deepCopy( x );\n\t\t\t\t\t}\n\t\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t\t} else {\n\t\t\t\t\tcopy[ key ] = deepCopy( x );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Circular reference...\n\t\t\ti = indexOf( cache, x );\n\t\t\tif ( i !== -1 ) {\n\t\t\t\tcopy[ key ] = refs[ i ];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Plain array or object...\n\t\t\tref = ( isArray( x ) ) ? new Array( x.length ) : {};\n\t\t\tcache.push( x );\n\t\t\trefs.push( ref );\n\t\t\tif ( parent === 'array' ) {\n\t\t\t\tcopy[ key ] = deepCopy( x, ref, cache, refs, level );\n\t\t\t} else {\n\t\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\t\tif ( hasOwnProp( desc, 'value' ) ) {\n\t\t\t\t\tdesc.value = deepCopy( x, ref, cache, refs, level );\n\t\t\t\t}\n\t\t\t\tdefineProperty( copy, key, desc );\n\t\t\t}\n\t\t}\n\t} else if ( name === 'array' ) {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tcopy[ key ] = val[ key ];\n\t\t}\n\t} else {\n\t\tfor ( j = 0; j < keys.length; j++ ) {\n\t\t\tkey = keys[ j ];\n\t\t\tdesc = propertyDescriptor( val, key );\n\t\t\tdefineProperty( copy, key, desc );\n\t\t}\n\t}\n\tif ( !Object.isExtensible( val ) ) {\n\t\tObject.preventExtensions( copy );\n\t}\n\tif ( Object.isSealed( val ) ) {\n\t\tObject.seal( copy );\n\t}\n\tif ( Object.isFrozen( val ) ) {\n\t\tObject.freeze( copy );\n\t}\n\treturn copy;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepCopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar deepCopy = require( './deep_copy.js' );\n\n\n// MAIN //\n\n/**\n* Copies or deep clones a value to an arbitrary depth.\n*\n* @param {*} value - value to copy\n* @param {NonNegativeInteger} [level=+infinity] - copy depth\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {*} value copy\n*\n* @example\n* var out = copy( 'beep' );\n* // returns 'beep'\n*\n* @example\n* var value = [\n* {\n* 'a': 1,\n* 'b': true,\n* 'c': [ 1, 2, 3 ]\n* }\n* ];\n* var out = copy( value );\n* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n*\n* var bool = ( value[0].c === out[0].c );\n* // returns false\n*/\nfunction copy( value, level ) {\n\tvar out;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isNonNegativeInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', level ) );\n\t\t}\n\t\tif ( level === 0 ) {\n\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tlevel = PINF;\n\t}\n\tout = ( isArray( value ) ) ? new Array( value.length ) : {};\n\treturn deepCopy( value, out, [value], [out], level );\n}\n\n\n// EXPORTS //\n\nmodule.exports = copy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Copy or deep clone a value to an arbitrary depth.\n*\n* @module @stdlib/utils/copy\n*\n* @example\n* var copy = require( '@stdlib/utils/copy' );\n*\n* var out = copy( 'beep' );\n* // returns 'beep'\n*\n* @example\n* var copy = require( '@stdlib/utils/copy' );\n*\n* var value = [\n* {\n* 'a': 1,\n* 'b': true,\n* 'c': [ 1, 2, 3 ]\n* }\n* ];\n* var out = copy( value );\n* // returns [ {'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n*\n* var bool = ( value[0].c === out[0].c );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and returns group counts.\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} counts\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = countBy( arr, indicator );\n* // returns { 'b': 3, 'f': 1 }\n*/\nfunction countBy( collection, options, indicator ) {\n\tvar thisArg;\n\tvar opts;\n\tvar err;\n\tvar out;\n\tvar len;\n\tvar cb;\n\tvar g;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tg = cb.call( thisArg, collection[ i ], i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ] += 1;\n\t\t} else {\n\t\t\tout[ g ] = 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = countBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function and return group counts.\n*\n* @module @stdlib/utils/count-by\n*\n* @example\n* var countBy = require( '@stdlib/utils/count-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = countBy( arr, indicator );\n* // returns { 'b': 3, 'f': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a function into a sequence of functions each accepting a single argument.\n*\n* @param {Function} fcn - function to curry\n* @param {PositiveInteger} [arity=fcn.length] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must be a function having at least one parameter\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} curry function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curry( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\nfunction curry( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t} else {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t\tcontext = arity;\n\t}\n\treturn createCurried( [] );\n\n\t/**\n\t* Returns a curry function.\n\t*\n\t* @private\n\t* @param {Array} args - arguments\n\t* @returns {Function} curry function\n\t*/\n\tfunction createCurried( args ) {\n\t\treturn curried;\n\n\t\t/**\n\t\t* Curry function.\n\t\t*\n\t\t* @private\n\t\t* @param {*} v - curried function parameter\n\t\t* @returns {(Function|*)} partially applied curry function or curried function result\n\t\t*/\n\t\tfunction curried( v ) {\n\t\t\tvar cargs = args.slice();\n\t\t\tcargs.push( v );\n\t\t\tif ( cargs.length < len ) {\n\t\t\t\treturn createCurried( cargs );\n\t\t\t}\n\t\t\treturn fcn.apply( context, cargs );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = curry;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a function into a sequence of functions each accepting a single argument.\n*\n* @module @stdlib/utils/curry\n*\n* @example\n* var curry = require( '@stdlib/utils/curry' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curry( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a function into a sequence of functions each accepting a single argument.\n*\n* @param {Function} fcn - function to curry\n* @param {PositiveInteger} [arity=fcn.length] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must be a function having at least one parameter\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} curry function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curryRight( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\nfunction curryRight( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t} else if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t} else {\n\t\tlen = fcn.length;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function having at least one parameter. Value: `%s`.', len ) );\n\t\t}\n\t\tcontext = arity;\n\t}\n\treturn createCurried( [] );\n\n\t/**\n\t* Returns a curry function.\n\t*\n\t* @private\n\t* @param {Array} args - arguments\n\t* @returns {Function} curry function\n\t*/\n\tfunction createCurried( args ) {\n\t\treturn curried;\n\n\t\t/**\n\t\t* Curry function.\n\t\t*\n\t\t* @private\n\t\t* @param {*} v - curried function parameter\n\t\t* @returns {(Function|*)} partially applied curry function or curried function result\n\t\t*/\n\t\tfunction curried( v ) {\n\t\t\tvar cargs = args.slice();\n\t\t\tcargs.unshift( v );\n\t\t\tif ( cargs.length < len ) {\n\t\t\t\treturn createCurried( cargs );\n\t\t\t}\n\t\t\treturn fcn.apply( context, cargs );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = curryRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a function into a sequence of functions each accepting a single argument.\n*\n* @module @stdlib/utils/curry-right\n*\n* @example\n* var curryRight = require( '@stdlib/utils/curry-right' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var f = curryRight( add );\n*\n* var sum = f( 2 )( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Applies provided arguments to a function and passes the result to another function.\n*\n* @private\n* @param {Function} fcn - function\n* @param {Array} args - function arguments\n* @param {Function} after - function to invoke with the result of `fcn`\n* @param {*} thisArg - evaluation context for `after`\n* @returns {*} result\n*/\nfunction apply( fcn, args, after, thisArg ) {\n\tvar r1 = fcn.apply( null, args );\n\tvar r2 = after.call( thisArg, r1 );\n\treturn ( r2 === void 0 ) ? r1 : r2;\n}\n\n\n// MAIN //\n\n/**\n* Decorates a provided function such that the function's return value is provided as an argument to another function.\n*\n* @param {Function} fcn - function to decorate\n* @param {NonNegativeInteger} arity - number of parameters\n* @param {Function} after - function to invoke with the result of the decorated function\n* @param {*} [thisArg] - evaluation context for `after`\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a function\n* @returns {Function} decorator\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter( abs, 1, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, 1, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, 1, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*/\nfunction decorateAfter( fcn, arity, after, thisArg ) {\n\tvar fcns;\n\tvar f;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( after ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', after ) );\n\t}\n\t// NOTE: we select a specific signature so that `fcn.length` is preserved, thus matching the definition of a \"decorator\" where the decorator function should be transparent to external clients (i.e., have a matching signature). While more recent JavaScript environments allow `Function.prototype.length` to be configurable, older environments do not and error when attempting to manually specify the value for a function's length. We cap support for matching signature length as signatures with many parameters are likely to be exceedingly rare, especially when used in conjunction with this API...\n\tfcns = [ fN, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 ];\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tif ( arity < fcns.length ) {\n\t\tf = fcns[ arity ];\n\t} else {\n\t\tf = fN;\n\t}\n\treturn f;\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {...*} [args] - arguments\n\t* @returns {*} result\n\t*/\n\tfunction fN() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @returns {*} result\n\t*/\n\tfunction f1( x0 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\t// NOTE: the use of a `for` loop is intentional (both here and below), as JavaScript does not require that only a fixed number of arguments be provided; the number of provided arguments may be more or less than the signature specifies.\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @returns {*} result\n\t*/\n\tfunction f2( x0, x1 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @returns {*} result\n\t*/\n\tfunction f3( x0, x1, x2 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @returns {*} result\n\t*/\n\tfunction f4( x0, x1, x2, x3 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @returns {*} result\n\t*/\n\tfunction f5( x0, x1, x2, x3, x4 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @returns {*} result\n\t*/\n\tfunction f6( x0, x1, x2, x3, x4, x5 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @returns {*} result\n\t*/\n\tfunction f7( x0, x1, x2, x3, x4, x5, x6 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @returns {*} result\n\t*/\n\tfunction f8( x0, x1, x2, x3, x4, x5, x6, x7 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @param {*} x8 - ninth argument\n\t* @returns {*} result\n\t*/\n\tfunction f9( x0, x1, x2, x3, x4, x5, x6, x7, x8 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n\n\t/**\n\t* Evaluates a function and passes the result to another function.\n\t*\n\t* @private\n\t* @param {*} x0 - first argument\n\t* @param {*} x1 - second argument\n\t* @param {*} x2 - third argument\n\t* @param {*} x3 - fourth argument\n\t* @param {*} x4 - fifth argument\n\t* @param {*} x5 - sixth argument\n\t* @param {*} x6 - seventh argument\n\t* @param {*} x7 - eighth argument\n\t* @param {*} x8 - ninth argument\n\t* @param {*} x9 - tenth argument\n\t* @returns {*} result\n\t*/\n\tfunction f10( x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 ) { // eslint-disable-line no-unused-vars\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn apply( fcn, args, after, thisArg );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = decorateAfter;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar reNativeFunction = require( '@stdlib/regexp/native-function' ).REGEXP;\nvar function2string = require( '@stdlib/function/to-string' );\nvar Fcn = require( '@stdlib/function/ctor' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\n/**\n* Captures everything that is not a right parenthesis immediately after the first left parenthesis.\n*\n* Regular expression: `/^\\s*function[^(]*\\(([^)]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `\\(`\n* - Match a left parenthesis `(`\n*\n* - `()`\n* - Capture\n*\n* - `[^)]*`\n* - Match anything except a right parenthesis `)` zero or more times\n*\n* - `)`\n* - Match a right parenthesis `)`\n*\n* - `/i`\n* - Ignore case\n*\n* @private\n* @constant\n* @type {RegExp}\n* @default /^\\s*function[^(]*\\(([^)]*)/i\n*/\nvar RE_PARAMETERS = /^\\s*function[^(]*\\(([^)]*)/i;\n\n\n// MAIN //\n\n/**\n* Decorates a provided function such that the function's return value is provided as an argument to another function.\n*\n* @param {Function} fcn - function to decorate\n* @param {NonNegativeInteger} arity - number of parameters\n* @param {Function} after - function to invoke with the result of the decorated function\n* @param {*} [thisArg] - evaluation context for `after`\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a function\n* @returns {Function} decorator\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter( abs, abs.length, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, abs.length, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, abs.length, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*/\nfunction decorateAfter( fcn, arity, after, thisArg ) {\n\tvar params;\n\tvar str;\n\tvar len;\n\tvar f;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tif ( !isFunction( after ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', after ) );\n\t}\n\tstr = function2string( fcn );\n\n\t// Code generation. Start with the function definition for creating the decorator:\n\tf = 'return function make(__$$fcn$$__,__$$after$$__,__$$thisArg$$__){';\n\n\t// Include the \"use strict\" directive:\n\tf += '\"use strict\";';\n\n\t// Generate a list of function parameters:\n\tif ( reNativeFunction.test( str ) ) {\n\t\tparams = [];\n\t\tfor ( i = 0; i < arity; i++ ) {\n\t\t\tparams.push( 'x'+i );\n\t\t}\n\t} else {\n\t\tparams = str.match( RE_PARAMETERS )[ 1 ];\n\t\tif ( params ) {\n\t\t\tparams = params.split( ',' );\n\t\t} else {\n\t\t\tparams = [];\n\t\t}\n\t\tlen = params.length;\n\t\tif ( len < arity ) {\n\t\t\tfor ( i = len; i < arity; i++ ) {\n\t\t\t\tparams.push( '__$$x'+i+'$$__' );\n\t\t\t}\n\t\t} else if ( len > arity ) {\n\t\t\tparams.length = arity;\n\t\t}\n\t}\n\tparams = params.join( ',' );\n\n\t// Create the decorator definition:\n\tf += 'return function decorator(' + params + '){';\n\n\t// Initialize an array for storing provided arguments:\n\tf += 'var __$$args$$__=[];';\n\n\t// Gather provided arguments:\n\tf += 'for (var __$$i$$__=0;__$$i$$__\n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var f = decorateAfter( abs, 1, log );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function counter() {\n* this.count += 1;\n* }\n*\n* var ctx = {\n* 'count': 0\n* };\n*\n* var f = decorateAfter( abs, 1, counter, ctx );\n* // returns \n*\n* var v = f( -5 );\n* // returns 5\n*\n* v = f( 5 );\n* // returns 5\n*\n* var count = ctx.count;\n* // returns 2\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var decorateAfter = require( '@stdlib/utils/decorate-after' );\n*\n* function negate( v ) {\n* return -v;\n* }\n*\n* var f = decorateAfter.factory( abs, 1, negate );\n* // returns \n*\n* var v = f( -5 );\n* // returns -5\n*\n* v = f( 5 );\n* // returns -5\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'sep': '/'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns a nested property value.\n*\n* @private\n* @param {ObjectLike} obj - input object\n* @param {Array} props - list of properties defining a key path\n* @returns {*} nested property value\n*/\nfunction deepGet( obj, props ) {\n\tvar len = props.length;\n\tvar v = obj;\n\tvar i;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif (\n\t\t\tisObjectLike( v ) &&\n\t\t\thasOwnProp( v, props[ i ] )\n\t\t) {\n\t\t\tv = v[ props[ i ] ];\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepGet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dget = require( './dget.js' );\n\n\n// MAIN //\n\n/**\n* Returns a nested property value.\n*\n* @param {ObjectLike} obj - input object\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} second argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {*} nested property value\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, 'a.b.c' );\n* // returns 'd'\n*\n* @example\n* var arr = [\n* { 'a': [ {'x': 5} ] },\n* { 'a': [ {'x': 10} ] }\n* ];\n* var val = deepGet( arr, '1.a.0.x' );\n* // returns 10\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, ['a','b','c'] );\n* // returns 'd'\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var val = deepGet( obj, 'a/b/c', {\n* 'sep': '/'\n* });\n* // returns 'd'\n*/\nfunction deepGet( obj, path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\treturn;\n\t}\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn dget( obj, props );\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepGet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dget = require( './dget.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for retrieving a nested property value.\n*\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} first argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} deep get function\n*\n* @example\n* var dget = factory( 'a/b/c', {\n* 'sep': '/'\n* });\n*/\nfunction factory( path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn deepGet;\n\n\t/**\n\t* Returns a nested property value.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - input object\n\t* @returns {*} nested property value\n\t*\n\t* @example\n\t* var obj = { 'a': { 'b': { 'c': 'd' } } };\n\t* var val = deepGet( obj );\n\t*/\n\tfunction deepGet( obj ) {\n\t\tif ( isObjectLike( obj ) ) {\n\t\t\treturn dget( obj, props );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Get a nested property value.\n*\n* @module @stdlib/utils/deep-get\n*\n* @example\n* var deepGet = require( '@stdlib/utils/deep-get' );\n*\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* var val = deepGet( obj, 'a.b.c' );\n* // returns 'd'\n*\n* var dget = factory( 'a/b/c', {\n* 'sep': '/'\n* });\n*\n* obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* val = dget( obj );\n* // returns 'd'\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'copy': true,\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {boolean} [options.copy] - boolean indicating whether to return a new data structure\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': true,\n* 'sep': '-',\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar deepGet = require( './../../deep-get' ).factory;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Extracts a nested property value from each element of an object array.\n*\n* @param {Array} arr - source array\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=true] - boolean indicating whether to return a new data structure\n* @param {string} [options.sep=\".\"] - key path separator\n* @throws {TypeError} first argument must be an array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} destination array\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c' );\n* // returns [ 1, 2 ]\n*\n* @example\n* var arr = [\n* {'a':[0,1,2]},\n* {'a':[3,4,5]}\n* ];\n*\n* var out = deepPluck( arr, ['a',1] );\n* // returns [ 1, 4 ]\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c', {'copy':false} );\n* // returns [ 1, 2 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*\n* @example\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a|b|c', {'sep':'|'} );\n* // returns [ 1, 2 ]\n*/\nfunction deepPluck( arr, path, options ) {\n\tvar dget;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar i;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array. Value: `%s`.', arr ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.copy ) {\n\t\tout = new Array( arr.length );\n\t} else {\n\t\tout = arr;\n\t}\n\tdget = deepGet( path, {\n\t\t'sep': opts.sep\n\t});\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tout[ i ] = dget( arr[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepPluck;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Extract a nested property value from each element of an object array.\n*\n* @module @stdlib/utils/deep-pluck\n*\n* @example\n* var pluck = require( '@stdlib/utils/deep-pluck' );\n*\n* var arr = [\n* {'a':{'b':{'c':1}}},\n* {'a':{'b':{'c':2}}}\n* ];\n*\n* var out = deepPluck( arr, 'a.b.c' );\n* // returns [ 1, 2 ]\n*\n* arr = [\n* {'a':[0,1,2]},\n* {'a':[3,4,5]}\n* ];\n*\n* out = deepPluck( arr, ['a',1] );\n* // returns [ 1, 4 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {boolean} [options.create] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep] - key path separator\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'sep': '/'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'create' ) ) {\n\t\topts.create = options.create;\n\t\tif ( !isBoolean( opts.create ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'create', opts.create ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'create': false,\n\t\t'sep': '.'\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isFunction = require( '@stdlib/assert/is-function' );\n\n\n// MAIN //\n\n/**\n* Sets a nested property.\n*\n* @private\n* @param {ObjectLike} obj - input object\n* @param {Array} props - list of properties defining a key path\n* @param {boolean} create - boolean indicating whether to create a path if the key path does not already exist\n* @param {*} val - value to set\n* @returns {boolean} boolean indicating if the property was successfully set\n*/\nfunction deepSet( obj, props, create, val ) {\n\tvar bool;\n\tvar len;\n\tvar v;\n\tvar p;\n\tvar i;\n\n\tlen = props.length;\n\tbool = false;\n\tv = obj;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tp = props[ i ];\n\t\tif ( isObjectLike( v ) ) {\n\t\t\tif ( !hasOwnProp( v, p ) ) {\n\t\t\t\tif ( create ) {\n\t\t\t\t\tv[ p ] = {};\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i === len-1 ) {\n\t\t\t\tif ( isFunction( val ) ) {\n\t\t\t\t\tv[ p ] = val( v[ p ] );\n\t\t\t\t} else {\n\t\t\t\t\tv[ p ] = val;\n\t\t\t\t}\n\t\t\t\tbool = true;\n\t\t\t} else {\n\t\t\t\tv = v[ p ];\n\t\t\t}\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dset = require( './dset.js' );\n\n\n// MAIN //\n\n/**\n* Sets a nested property value.\n*\n* @param {ObjectLike} obj - input object\n* @param {(string|Array)} path - key path\n* @param {*} value - value to set\n* @param {Options} [options] - function options\n* @param {boolean} [options.create=false] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} second argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {boolean} boolean indicating if the property was successfully set\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.b.c', 'woot' );\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( null, 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* bool = deepSet( 'bap', 'a.beep.c', 'boop' );\n* // returns false\n*\n* @example\n* var arr = [\n* { 'a': [ {'x': 5} ] },\n* { 'a': [ {'x': 10} ] }\n* ];\n* var bool = deepSet( arr, '1.a.0.x', 25 );\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a/b/c', 'beep', {\n* 'sep': '/'\n* });\n* // returns true\n*\n* @example\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.e.c', 'boop', {\n* 'create': true\n* });\n* // returns true\n*/\nfunction deepSet( obj, path, value, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\treturn false;\n\t}\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn dset( obj, props, opts.create, value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepSet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar dset = require( './dset.js' );\n\n\n// MAIN //\n\n/**\n* Creates a reusable deep set function.\n*\n* @param {(string|Array)} path - key path\n* @param {Options} [options] - function options\n* @param {boolean} [options.create=false] - boolean indicating whether to create a path if the key path does not already exist\n* @param {string} [options.sep='.'] - key path separator\n* @throws {TypeError} first argument must be a string or key array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} deep set function\n*\n* @example\n* var dset = factory( 'a/b/c', {\n* 'create': true,\n* 'sep': '/'\n* });\n*/\nfunction factory( path, options ) {\n\tvar isStr;\n\tvar props;\n\tvar opts;\n\tvar err;\n\n\tisStr = isString( path );\n\tif ( !isStr && !isArray( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Key path must be a string or a key array. Value: `%s`.', path ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( isStr ) {\n\t\tprops = path.split( opts.sep );\n\t} else {\n\t\tprops = path;\n\t}\n\treturn deepSet;\n\n\t/**\n\t* Sets a nested property.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - input object\n\t* @param {*} value - value to set\n\t* @returns {boolean} boolean indicating if the property was successfully set\n\t*\n\t* @example\n\t* var obj = { 'a': { 'b': { 'c': 'd' } } };\n\t* var bool = dset( obj, 'beep' );\n\t*/\n\tfunction deepSet( obj, value ) {\n\t\tif ( isObjectLike( obj ) ) {\n\t\t\treturn dset( obj, props, opts.create, value );\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Set a nested property value.\n*\n* @module @stdlib/utils/deep-set\n*\n* @example\n* var deepSet = require( '@stdlib/utils/deep-set' );\n*\n* var obj = { 'a': { 'b': { 'c': 'd' } } };\n* var bool = deepSet( obj, 'a.b.c', 'beep' );\n* // returns true\n*\n* var dset = deepSet.factory( 'a/b/c', {\n* 'create': true,\n* 'sep': '/'\n* });\n*\n* obj = { 'a': { 'b': { 'c': 'd' } } };\n*\n* bool = dset( obj, 'beep' );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setConfigurableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setConfigurableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-only accessor.\n*\n* @module @stdlib/utils/define-configurable-read-only-accessor\n*\n* @example\n* var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setConfigurableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setConfigurableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setConfigurableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-only property.\n*\n* @module @stdlib/utils/define-configurable-read-only-property\n*\n* @example\n* var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' );\n*\n* var obj = {};\n*\n* setConfigurableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* var name = 'bar';\n* var obj = {};\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* setConfigurableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setConfigurableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable read-write accessor.\n*\n* @module @stdlib/utils/define-configurable-read-write-accessor\n*\n* @example\n* var setConfigurableReadWriteAccessor = require( '@stdlib/utils/define-configurable-read-write-accessor' );\n*\n* var name = 'bar';\n* var obj = {};\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* setConfigurableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setConfigurableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setConfigurableWriteOnlyAccessor( obj, prop, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setConfigurableWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable write-only accessor.\n*\n* @module @stdlib/utils/define-configurable-write-only-accessor\n*\n* @example\n* var setConfigurableWriteOnlyAccessor = require( '@stdlib/utils/define-configurable-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setConfigurableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a memoized object property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} desc - property descriptor\n* @param {boolean} [desc.configurable=false] - boolean indicating if the property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [desc.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [desc.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {Function} desc.value - function whose return value will be memoized\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {TypeError} property descriptor `value` property must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* defineMemoizedProperty( obj, 'foo', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': foo\n* });\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction defineMemoizedProperty( obj, prop, desc ) {\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isObject( desc ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', desc ) );\n\t}\n\tif ( !isFunction( desc.value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. The `value` property of the property descriptor must be a function. Value: `%s`.', desc.value ) );\n\t}\n\t// Copy descriptor properties to a new data descriptor object:\n\tdesc = {\n\t\t'configurable': ( desc.configurable === void 0 ) ? false : desc.configurable,\n\t\t'enumerable': ( desc.enumerable === void 0 ) ? false : desc.enumerable,\n\t\t'writable': ( desc.writable === void 0 ) ? false : desc.writable,\n\t\t'value': desc.value\n\t};\n\n\t// Define a configurable (at least temporarily) accessor property:\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': desc.enumerable,\n\t\t'get': getter,\n\t\t'set': ( desc.writable ) ? memoize : void 0\n\t});\n\n\t/**\n\t* Temporary get accessor.\n\t*\n\t* @private\n\t* @returns {*} property value\n\t*/\n\tfunction getter() {\n\t\tvar value = desc.value.call( obj );\n\t\tmemoize( value );\n\t\treturn value;\n\t}\n\n\t/**\n\t* Defines a memoized object property.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t*/\n\tfunction memoize( value ) {\n\t\tdesc.value = value;\n\t\tdefineProperty( obj, prop, desc );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineMemoizedProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a memoized object property.\n*\n* @module @stdlib/utils/define-memoized-property\n*\n* @example\n* var defineMemoizedProperty = require( '@stdlib/utils/define-memoized-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* defineMemoizedProperty( obj, 'foo', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': foo\n* });\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineMemoizedProperty = require( './../../define-memoized-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a configurable memoized read-only object property.\n*\n* ## Notes\n*\n* - Configurable read-only properties are **enumerable**.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} fcn - function whose return value will be memoized and set as the property value\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedConfigurableReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction setMemoizedConfigurableReadOnly( obj, prop, fcn ) { // eslint-disable-line id-length\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tdefineMemoizedProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': fcn\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setMemoizedConfigurableReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a configurable memoized read-only object property.\n*\n* @module @stdlib/utils/define-memoized-configurable-read-only-property\n*\n* @example\n* var setMemoizedConfigurableReadOnly = require( '@stdlib/utils/define-memoized-configurable-read-only-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedConfigurableReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar defineMemoizedProperty = require( './../../define-memoized-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines a memoized read-only object property.\n*\n* ## Notes\n*\n* - Read-only properties are **enumerable** and **non-configurable**.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} fcn - function whose return value will be memoized and set as the property value\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be a function\n*\n* @example\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\nfunction setMemoizedReadOnly( obj, prop, fcn ) {\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tdefineMemoizedProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': fcn\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setMemoizedReadOnly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a memoized read-only object property.\n*\n* @module @stdlib/utils/define-memoized-read-only-property\n*\n* @example\n* var setMemoizedReadOnly = require( '@stdlib/utils/define-memoized-read-only-property' );\n*\n* var obj = {};\n*\n* function foo() {\n* return 'bar';\n* }\n*\n* setMemoizedReadOnly( obj, 'foo', foo );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var objectKeys = require( '@stdlib/utils/keys' );\n*\n* var obj = {};\n*\n* setNonEnumerableProperty( obj, 'foo', 'bar' );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*\n* var keys = objectKeys( obj );\n* // returns []\n*/\nfunction setNonEnumerableProperty( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': true,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable property.\n*\n* @module @stdlib/utils/define-nonenumerable-property\n*\n* @example\n* var objectKeys = require( '@stdlib/utils/keys' );\n* var setNonEnumerableProperty = require( '@stdlib/utils/define-nonenumerable-property' );\n*\n* var obj = {};\n*\n* setNonEnumerableProperty( obj, 'foo', 'bar' );\n*\n* var v = obj.foo;\n* // returns 'bar'\n*\n* var keys = objectKeys( obj );\n* // returns []\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-write accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-read-write-accessor\n*\n* @example\n* var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setNonEnumerableWriteOnlyAccessor( obj, prop, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable write-only accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-write-only-accessor\n*\n* @example\n* var setNonEnumerableWriteOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (and/or modifies) object properties.\n*\n* @name defineProperties\n* @type {Function}\n* @param {Object} obj - object on which to define the properties\n* @param {Object} props - object with property descriptors\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be an object\n* @returns {Object} object with added and/or modified properties\n*\n* @example\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar'\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* var val = obj.foo;\n* // returns 'bar'\n*\n* val = obj.baz;\n* // returns 13\n*/\nvar defineProperties = Object.defineProperties;\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Defines (and/or modifies) properties.\n*\n* @param {Object} obj - object on which to define the properties\n* @param {Object} props - object with property descriptors\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be an object\n* @returns {Object} object with added and/or modified properties\n*\n* @example\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar'\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* var val = obj.foo;\n* // returns 'bar'\n*\n* val = obj.baz;\n* // returns 13\n*/\nfunction defineProperties( obj, props ) {\n\tvar keys;\n\tvar name;\n\tvar i;\n\n\tif ( !isObject( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isObject( props ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an object containing property descriptors. Value: `%s`.', props ) );\n\t}\n\tkeys = objectKeys( props );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tname = keys[ i ];\n\t\tdefineProperty( obj, name, props[ name ] );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (and/or modify) properties.\n*\n* @module @stdlib/utils/define-properties\n*\n* @example\n* var defineProperties = require( '@stdlib/utils/define-properties' );\n*\n* var obj = {};\n* defineProperties( obj, {\n* 'foo': {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': true\n* },\n* 'baz': {\n* 'value': 13\n* }\n* });\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.log( err.message );\n* }\n*/\n\n// MODULES //\n\nvar hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' ); // eslint-disable-line id-length\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar defineProperties;\nif ( hasDefinePropertiesSupport() ) {\n\tdefineProperties = builtin;\n} else {\n\tdefineProperties = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnlyAccessor( obj, prop, getter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-only accessor.\n*\n* @module @stdlib/utils/define-read-only-accessor\n*\n* @example\n* var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setReadWriteAccessor( obj, prop, getter, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadWriteAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-write accessor.\n*\n* @module @stdlib/utils/define-read-write-accessor\n*\n* @example\n* var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\n*\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a write-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} setter - accessor\n*\n* @example\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\nfunction setWriteOnlyAccessor( obj, prop, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setWriteOnlyAccessor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a write-only accessor.\n*\n* @module @stdlib/utils/define-write-only-accessor\n*\n* @example\n* var setWriteOnlyAccessor = require( '@stdlib/utils/define-write-only-accessor' );\n*\n* var obj = {};\n* var val = '';\n*\n* function setter( v ) {\n* val = v;\n* }\n*\n* setWriteOnlyAccessor( obj, 'foo', setter );\n*\n* obj.foo = 'beep';\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar RE_DIRNAME = require( '@stdlib/regexp/dirname' ).REGEXP;\n\n\n// MAIN //\n\n/**\n* Returns a path dirname.\n*\n* @param {string} path - path\n* @throws {TypeError} must provide a string primitive\n* @returns {string} directory name\n*\n* @example\n* var dir = dirname( './foo/bar/index.js' );\n* // returns './foo/bar'\n*/\nfunction dirname( path ) {\n\tif ( !isString( path ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Path must be a string. Value: `%s`.', path ) );\n\t}\n\treturn RE_DIRNAME.exec( path )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = dirname;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a directory name.\n*\n* @module @stdlib/utils/dirname\n*\n* @example\n* var dirname = require( '@stdlib/utils/dirname' );\n*\n* var dir = dirname( './foo/bar/index.js' );\n* // returns './foo/bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop invoking a function\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i <= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* doUntil( beep, predicate );\n*/\nfunction doUntil( fcn, predicate, thisArg ) {\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t} while ( !predicate( i ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntil;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/do-until\n*\n* @example\n* var doUntil = require( '@stdlib/utils/do-until' );\n*\n* function predicate( i ) {\n* return ( i <= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* doUntil( beep, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doUntilEach( arr, log, predicate );\n*/\nfunction doUntilEach( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t} while (\n\t\ti < len &&\n\t\t!predicate( collection[ i-1 ], i-1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/do-until-each\n*\n* @example\n* var doUntilEach = require( '@stdlib/utils/do-until-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doUntilEach( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `doUntilEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `doUntilEach()`, `[].push()` behavior is consistent with `doUntilEachRight()` `[].unshift()` behavior.\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doUntilEachRight( arr, log, predicate );\n*/\nfunction doUntilEachRight( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = len - 1;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t} while (\n\t\ti >= 0 &&\n\t\t!predicate( collection[ i+1 ], i+1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doUntilEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/do-until-each-right\n*\n* @example\n* var doUntilEachRight = require( '@stdlib/utils/do-until-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doUntilEachRight( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* doWhile( beep, predicate );\n*/\nfunction doWhile( fcn, predicate, thisArg ) {\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t} while ( predicate( i ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhile;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/do-while\n*\n* @example\n* var doWhile = require( '@stdlib/utils/do-while' );\n*\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* doWhile( beep, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection.\n*\n* ## Notes\n*\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doWhileEach( arr, log, predicate );\n*/\nfunction doWhileEach( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = 0;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t} while (\n\t\ti < len &&\n\t\tpredicate( collection[ i-1 ], i-1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/do-while-each\n*\n* @example\n* var doWhileEach = require( '@stdlib/utils/do-while-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* doWhileEach( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `doWhileEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `doWhileEach()`, `[].push()` behavior is consistent with `doWhileEachRight()` `[].unshift()` behavior.\n* - The condition is evaluated **after** executing the function to invoke; thus, the provided function **always** executes at least once.\n* - If provided an empty collection, the function invokes the provided function with the collection index set to `undefined`.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doWhileEachRight( arr, log, predicate );\n*/\nfunction doWhileEachRight( collection, fcn, predicate, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tif ( len === 0 ) {\n\t\tfcn.call( thisArg, void 0, void 0, collection );\n\t\tlen = collection.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn collection;\n\t\t}\n\t}\n\ti = len - 1;\n\tdo {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t} while (\n\t\ti >= 0 &&\n\t\tpredicate( collection[ i+1 ], i+1, collection )\n\t);\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = doWhileEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/do-while-each-right\n*\n* @example\n* var doWhileEachRight = require( '@stdlib/utils/do-while-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* doWhileEachRight( arr, log, predicate );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* List node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\t// Why getters? Because some of the list APIs will return the list \"node\", not the value. In which case, the node API is no longer private and we have to guard against users mucking about (deleting, updating, etc) with property values (in particular, the `next` and `prev` properties).\n\tdefineProperty( this, 'next', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._next;\n\t\t}\n\t});\n\tdefineProperty( this, 'prev', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._prev;\n\t\t}\n\t});\n\tthis.value = value;\n\n\tdefineProperty( this, '_next', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\tdefineProperty( this, '_prev', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Doubly linked list constructor.\n*\n* @constructor\n* @returns {DoublyLinkedList} linked list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'foo'\n*/\nfunction DoublyLinkedList() {\n\tif ( !(this instanceof DoublyLinkedList) ) {\n\t\treturn new DoublyLinkedList();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the list.\n*\n* @name clear\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*\n* // Examine the list length:\n* var len = list.length;\n* // returns 2\n*\n* // Clear all list items:\n* list.clear();\n*\n* // Peek at the first value:\n* v = list.first();\n* // returns undefined\n*\n* // Examine the list length:\n* len = list.length;\n* // returns 0\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the first list node.\n*\n* @name first\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first;\n\t}\n});\n\n/**\n* Inserts a value into the list either before or after a provided list node.\n*\n* @name insert\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {Node} node - node after which to insert the value\n* @param {*} value - value to insert\n* @param {string} [location='after'] - location\n* @throws {Error} must provide a node belonging to the list\n* @throws {Error} must provide a recognized location\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Insert a value after the second node:\n* list.insert( node, 'boop' );\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 4\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'insert', function insert( node, value, location ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar loc;\n\tvar n;\n\tif ( arguments.length > 2 ) {\n\t\tloc = location;\n\t\tif ( loc !== 'before' && loc !== 'after' ) {\n\t\t\tthrow new Error( format( 'invalid argument. Third argument must be a recognized location. Value: `%s`.', loc ) );\n\t\t}\n\t} else {\n\t\tloc = 'after';\n\t}\n\t// Case: insert after last node (equivalent to `push()`)\n\tif ( loc === 'after' && node === this._last ) {\n\t\treturn this.push( value );\n\t}\n\t// Case: insert before first node (equivalent to `unshift()`)\n\tif ( loc === 'before' && node === this._first ) {\n\t\treturn this.unshift( value );\n\t}\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously increment the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last && n !== node ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Create a new list node:\n\tn = new Node( value );\n\n\t// Update pointers...\n\tif ( loc === 'after' ) {\n\t\tnode._next._prev = n;\n\t\tn._next = node._next;\n\n\t\tnode._next = n;\n\t\tn._prev = node;\n\t} else {\n\t\tnode._prev._next = n;\n\t\tn._prev = node._prev;\n\n\t\tnode._prev = n;\n\t\tn._next = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an iterator for iterating over a list.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from list mutation during iteration, a returned iterator **always** iterates over a list \"snapshot\", which is defined as the list of elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {string} [direction=\"forward\"] - iteration direction\n* @throws {Error} must provide a recognized iteration direction\n* @returns {Iterator} iterator\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = list.iterator();\n*\n* // Iterate over the list...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'iterator', function iterator( direction ) {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar dir;\n\tvar inc;\n\tvar i;\n\tif ( arguments.length ) {\n\t\tdir = direction;\n\t\tif ( dir !== 'forward' && dir !== 'reverse' ) {\n\t\t\tthrow new Error( format( 'invalid argument. Must provide a recognized iteration direction. Value: `%s`.', dir ) );\n\t\t}\n\t} else {\n\t\tdir = 'forward';\n\t}\n\tself = this;\n\n\t// Initialize the iteration index:\n\tif ( dir === 'forward' ) {\n\t\ti = -1;\n\t\tinc = 1;\n\t} else {\n\t\ti = this._length;\n\t\tinc = -1;\n\t}\n\t// Create a copy of list values (necessary in order to \"snapshot\" the list; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += inc;\n\t\tif ( FLG || i < 0 || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the last node.\n*\n* @name last\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = list.last().value;\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last;\n\t}\n});\n\n/**\n* List length.\n*\n* @name length\n* @memberof DoublyLinkedList.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Examine the initial list length:\n* var len = list.length;\n* // returns 0\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( DoublyLinkedList.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the end of the list.\n*\n* @name pop\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'pop', function pop() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the last value:\n\t\tvalue = this._last.value;\n\n\t\t// Check whether we have a new \"tail\" or whether we have emptied the list...\n\t\tif ( this._last._prev ) {\n\t\t\tthis._last = this._last._prev;\n\t\t\tthis._last._next = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Adds a value to the end of the list.\n*\n* @name push\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous last node:\n\t\tnode._prev = this._last; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous last node to the new node:\n\t\tthis._last._next = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the last node:\n\t\tthis._last = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Removes a list node from the list.\n*\n* @name remove\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @param {Node} node - node to remove\n* @throws {Error} must provide a node belonging to the list\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Remove the second node:\n* var v = list.remove( node );\n* // returns 'bar'\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'remove', function remove( node ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tvar n;\n\n\t// Case: first node (equivalent to `shift()`)\n\tif ( node === this._first ) {\n\t\treturn this.shift();\n\t}\n\t// Case: last node (equivalent to `pop()`)\n\tif ( node === this._last ) {\n\t\treturn this.pop();\n\t}\n\t// Retrieve the node value:\n\tvalue = node.value;\n\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously decrement the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Update pointers:\n\tnode._prev._next = node._next;\n\tnode._next._prev = node._prev;\n\n\t// Decrement the list length:\n\tthis._length -= 1;\n\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Removes a value from the beginning of the list.\n*\n* @name shift\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = list.shift();\n* // returns 'foo'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'shift', function shift() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the first value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"head\" or whether we have emptied the list...\n\t\tif ( this._first._next ) {\n\t\t\tthis._first = this._first._next;\n\t\t\tthis._first._prev = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an array of list values.\n*\n* @name toArray\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {Array} list values\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of list values:\n* var vals = list.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a list as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `DoublyLinkedList` instance.\n*\n* @name toJSON\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {Object} serialized list\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = list.toJSON();\n* // returns { 'type': 'doubly-linked-list', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'doubly-linked-list';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n/**\n* Adds a value to the beginning of the list.\n*\n* @name unshift\n* @memberof DoublyLinkedList.prototype\n* @type {Function}\n* @returns {DoublyLinkedList} list instance\n*\n* @example\n* var list = new DoublyLinkedList();\n*\n* // Add values to the beginning of the list:\n* list.unshift( 'foo' ).unshift( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'foo'\n*\n* // Add a new value to the beginning of the list:\n* list.unshift( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'bar'\n*/\nsetReadOnly( DoublyLinkedList.prototype, 'unshift', function unshift( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous first node:\n\t\tnode._next = this._first; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous first node to the new node:\n\t\tthis._first._prev = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the first node:\n\t\tthis._first = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n\n// EXPORTS //\n\nmodule.exports = DoublyLinkedList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Doubly linked list.\n*\n* @module @stdlib/utils/doubly-linked-list\n*\n* @example\n* var doublyLinkedList = require( '@stdlib/utils/doubly-linked-list' );\n*\n* var list = doublyLinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first list value:\n* v = list.shift();\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RE_CHARS = /[-\\/\\\\^$*+?.()|[\\]{}]/g; // eslint-disable-line no-useless-escape\n\n\n// MAIN //\n\n/**\n* Escapes a regular expression string.\n*\n* @param {string} str - regular expression string\n* @throws {TypeError} first argument must be a string\n* @returns {string} escaped string\n*\n* @example\n* var str = rescape( '[A-Z]*' );\n* // returns '\\\\[A\\\\-Z\\\\]\\\\*'\n*/\nfunction rescape( str ) {\n\tvar len;\n\tvar s;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a regular expression string. Value: `%s`.', str ) );\n\t}\n\t// Check if the string starts with a forward slash...\n\tif ( str[ 0 ] === '/' ) {\n\t\t// Find the last forward slash...\n\t\tlen = str.length;\n\t\tfor ( i = len-1; i >= 0; i-- ) {\n\t\t\tif ( str[ i ] === '/' ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:\n\tif ( i === void 0 || i <= 0 ) {\n\t\treturn str.replace( RE_CHARS, '\\\\$&' );\n\t}\n\t// We need to de-construct the string...\n\ts = str.substring( 1, i );\n\n\t// Only escape the characters between the `/`:\n\ts = s.replace( RE_CHARS, '\\\\$&' );\n\n\t// Reassemble:\n\tstr = str[ 0 ] + s + str.substring( i );\n\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = rescape;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Escape a regular expression string or pattern.\n*\n* @module @stdlib/utils/escape-regexp-string\n*\n* @example\n* var rescape = require( '@stdlib/utils/escape-regexp-string' );\n*\n* var str = rescape( '[A-Z]*' );\n* // returns '\\\\[A\\\\-Z\\\\]\\\\*'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar noop = require( './../../../../noop' );\n\n\n// FUNCTIONS //\n\n/**\n* Throws a provided exception.\n*\n* @private\n* @param {Error} err - error object\n* @throws {Error} exception\n*/\nfunction throwError( err ) {\n\tthrow err;\n}\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Character sequence appearing at the beginning of a row which demarcates that the row content should be parsed as a commented line. A commented line ends upon encountering the first newline character sequence, regardless of whether that newline character sequence is preceded by an escape character sequence.\n\t\t'comment': '',\n\n\t\t// Character sequence separating record fields (e.g., use `','` for CSV and use `'\\t'` for TSV).\n\t\t'delimiter': ',',\n\n\t\t// Flag indicating how quote sequences should be escaped within a quoted field. When `true`, a quote sequence must be escaped by another quote sequence. When `false`, a quote sequence must be escaped by the escape sequence.\n\t\t'doublequote': true,\n\n\t\t// Character sequence for escaping character sequences having special meaning (i.e., delimiter, newline, escape, and comment outside of quoted fields, and the quote sequence within quoted fields when `doublequote` is `false`).\n\t\t'escape': '',\n\n\t\t// Flag indicating whether to trim leading whitespace from field values. If `false`, leading whitespace is not trimmed (e.g., `a, b, c` parses as `[ 'a', ' b', ' c' ]`). If `true`, leading whitespace is trimmed (e.g., `a, b, c` parses as `[ 'a', 'b', 'c' ]`).\n\t\t'ltrim': false,\n\n\t\t// Maximum number of records to process.\n\t\t'maxRows': 1e308,\n\n\t\t// Character sequence separating rows.\n\t\t'newline': '\\r\\n',\n\n\t\t// Callback to be invoked upon closing the parser.\n\t\t'onClose': noop,\n\n\t\t// Callback to be invoked upon processing a field.\n\t\t'onColumn': noop,\n\n\t\t// Callback to be invoked upon processing a commented line.\n\t\t'onComment': null,\n\n\t\t// Callback to be invoked upon encountering an unrecoverable parse error.\n\t\t'onError': throwError,\n\n\t\t// Callback to be invoked upon processing a record.\n\t\t'onRow': noop,\n\n\t\t// Callback to be invoked upon skipping a line.\n\t\t'onSkip': null,\n\n\t\t// When `strict` is `false`, a callback to be invoked upon encountering invalid DSV.\n\t\t'onWarn': null,\n\n\t\t// Character sequence demarcating the beginning and ending of a quoted field.\n\t\t'quote': '\"',\n\n\t\t// Flag indicating whether to enable special processing of quote character sequences (i.e., whether a quote sequence should demarcate a quoted field).\n\t\t'quoting': true,\n\n\t\t// Array-like object for storing the field values of the most recently processed record. This allows reusing memory and avoiding copies upon invocation of the `onRow` callback.\n\t\t'rowBuffer': [],\n\n\t\t// Flag indicating whether to trim trailing whitespace from field values. If `false`, trailing whitespace is not trimmed (e.g., `a ,b , c` parses as `[ 'a ', 'b ', ' c' ]`). If `true`, trailing whitespace is trimmed (e.g., `a ,b ,c` parses as `[ 'a', 'b', 'c' ]`).\n\t\t'rtrim': false,\n\n\t\t// Character sequence appearing at the beginning of a row which demarcates that the row content should be skipped.\n\t\t'skip': '',\n\n\t\t// Flag indicating whether to skip over rows which are either empty or containing only whitespace.\n\t\t'skipBlankRows': false,\n\n\t\t// Callback whose return value indicates whether to skip over a row.\n\t\t'skipRow': null,\n\n\t\t// Flag indicating whether to raise an exception upon encountering invalid DSV.\n\t\t'strict': true,\n\n\t\t// Flag indicating whether to trim leading whitespace in commented lines.\n\t\t'trimComment': true,\n\n\t\t// List of characters to be treated as whitespace.\n\t\t'whitespace': [ ' ' ]\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "[\n \"closed\",\n \"comment\",\n \"escape\",\n \"error\",\n \"field\",\n \"init\",\n \"invalid_quote_end\",\n \"quote_end\",\n \"quoted_escape\",\n \"quoted_field\",\n \"skip\",\n \"skipped_comment\",\n \"skipped_escape\",\n \"skipped_field\",\n \"skipped_invalid_quote_end\",\n \"skipped_quote_end\",\n \"skipped_quoted_escape\",\n \"skipped_quoted_field\"\n]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar enum2state = require( './enum2state.json' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a table mapping state names to enumeration constants.\n*\n* @private\n* @returns {Object} mapping table\n*/\nfunction table() {\n\tvar out;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < enum2state.length; i++ ) {\n\t\tout[ enum2state[ i ] ] = i;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Table mapping state names to enumeration constants.\n*\n* @private\n* @name state2enum\n* @type {Object}\n*/\nvar state2enum = table(); // eslint-disable-line vars-on-top\n\n\n// EXPORTS //\n\nmodule.exports = state2enum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\n// Possible transition states...\nvar CLOSED = state2enum[ 'closed' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for closing a parser.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next() {\n\t\tparser._changeState( CLOSED );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:comment' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a commented line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar newlineLastIndex;\n\tvar newline;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t// Check for the end of the commented line...\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for a parser error state.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next() {\n\t\tparser._changeState( ERROR );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the maximum value.\n*\n* @private\n* @param {NonNegativeInteger} x - first value\n* @param {NonNegativeInteger} y - second value\n* @returns {NonNegativeInteger} maximum value\n*\n* @example\n* var v = max( 2, 3 );\n* // returns 3\n*\n* @example\n* var v = max( 3, 2 );\n* // returns 3\n*\n* @example\n* var v = max( 2, 2 );\n* // returns 2\n*/\nfunction max( x, y ) {\n\treturn ( x < y ) ? y : x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = max;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:escape' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence.\n*\n* ## Notes\n*\n* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar skipLastIndex;\n\tvar escapeLength;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar escape;\n\tvar strict;\n\tvar skip;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescapeLength = parser._escapeLength;\n\tescape = parser._escape;\n\n\tstrict = parser._strict;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), escapeLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\td === delimiterLastIndex &&\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, delimiterLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\td === newlineLastIndex &&\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, newlineLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape sequence.\n\t\t*/\n\t\tif (\n\t\t\td === escapeLastIndex &&\n\t\t\tch === escape[ escapeLastIndex ] &&\n\t\t\tparser._scan( escape, escapeLastIndex )\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, escapeLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a comment sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Comment sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tcursor-commentLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._copyWithin( idx-commentLastIndex, idx+1, commentLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a skip sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Skip sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for a skipped line\n\t\t\tcursor-skipLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._copyWithin( idx-skipLastIndex, idx+1, skipLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In strict mode, field separators, row separators, and escaped sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the escape sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding escape sequence supposed to be escaped? was the preceding escape sequence a mistake and should be ignored? are we missing a delimiter or newline sequence? etc.).\n\t\t* - In non-strict mode, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= max ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_ESCAPE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a special character sequence.' );\n\t\t\tparser._raiseWarning( 'INVALID_ESCAPE' )._push( ch )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:field' );\n\n// Possible transition states...\nvar ESCAPE = state2enum[ 'escape' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a field.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor - parser._cidx + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n\t\t* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( parser._cidx, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\t// Rewind the cursor to point to the last character of the preceding field:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._raiseWarning( 'INVALID_OPENING_QUOTE' )\n\t\t\t\t\t._rewind( idx )\n\t\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:init' );\n\n// Possible transition states...\nvar COMMENT = state2enum[ 'comment' ];\nvar FIELD = state2enum[ 'field' ];\nvar ESCAPE = state2enum[ 'escape' ];\nvar INIT = state2enum[ 'init' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\nvar SKIP = state2enum[ 'skip' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing the initial characters of a row.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\tvar skip;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for the start of a commented line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a commented line, the comment sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tidx-commentLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential comment match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the comment character sequence:\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._rewind( commentLastIndex )._changeState( COMMENT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for the start of a skipped line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a skipped line, the skip sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for skipped lines\n\t\t\tidx-skipLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the skip character sequence:\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._rewind( skipLastIndex )._changeState( SKIP );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n\t\t* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( 0, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\t// Rewind the cursor to the beginning of the buffer:\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._raiseWarning( 'INVALID_OPENING_QUOTE' )\n\t\t\t\t\t._rewind( idx )\n\t\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:invalid_quote_end' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\n\n\n// FUNCTIONS //\n\n/**\n* Removes whitespace following a closing quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @param {NonNegativeInteger} state - next state\n* @returns {void}\n*/\nfunction removeWhitespace( parser, state ) {\n\t// Check whether the character sequence consists only of whitespace:\n\tif ( parser._isWhitespace( parser._qidx+1, parser._cursor ) ) {\n\t\t// Rewind the cursor and resume normal processing:\n\t\tparser._raiseWarning( 'INVALID_CLOSING_QUOTE' )\n\t\t\t._rewind( parser._cursor-parser._qidx )\n\t\t\t._changeState( state );\n\t\treturn;\n\t}\n\t// Non-whitespace characters came after a closing quote, leaving us in an ambiguous state: was the closing quote intended and we're missing a delimiter/newline, or was the closing quote a mistake and should have been escaped? We don't know, and so we must raise an exception:\n\tdebug( 'Error.' );\n\tparser._setErrorState( 'INVALID_CLOSING_QUOTE' )._changeState( ERROR );\n}\n\n\n// MAIN //\n\n/**\n* Returns a function for processing field characters after an ending quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar delimiter;\n\tvar newline;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex );\n\n\t\t\t// Remove whitespace and resume processing:\n\t\t\tremoveWhitespace( parser, FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex );\n\n\t\t\t// Remove whitespace and resume processing:\n\t\t\tremoveWhitespace( parser, INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quote_end' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar INVALID_QUOTE_END = state2enum[ 'invalid_quote_end' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an ending quote sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar delimiter;\n\tvar newline;\n\tvar strict;\n\tvar quote;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\tstrict = parser._strict;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), quoteLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `doublequote` is `true`, quote character sequences are escaped by a preceding quote character sequence.\n\t\t* - When `doublequote` is `false`, quote character sequences must be explicitly escaped using an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\t// Keep the escaped quote character sequence and transition back to a quoted field state:\n\t\t\tdebug( 'Double quote.' );\n\t\t\tparser._push( ch )._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the delimiter character sequence:\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._rewind( delimiterLastIndex )._changeState( FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped quote sequences must immediately follow a potential closing quote sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the quote sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding quote supposed to be escaped? was the preceding quote a mistake and should be ignored? are we missing a delimiter or newline sequence? etc.). In strict mode, we raise an exception. In non-strict mode, we only raise an exception if non-whitespace characters follow the potential closing quote sequence.\n\t\t*/\n\t\tif ( parser._cursor-parser._qidx >= max ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_CLOSING_QUOTE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebug( 'Invalid closing quote.' );\n\t\t\tparser._push( ch )._changeState( INVALID_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quoted_escape' );\n\n// Possible transition states...\nvar ERROR = state2enum[ 'error' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a quoted field.\n*\n* ## Notes\n*\n* - Within a quoted field, an escape sequence (only) escapes the quote sequence.\n* - In strict mode, if not immediately followed by a special character sequence, then the parser raises an exception.\n* - In non-strict mode, if not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar escapeLength;\n\tvar strict;\n\tvar quote;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescapeLength = parser._escapeLength;\n\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote sequence.\n\t\t*/\n\t\tif (\n\t\t\td === quoteLastIndex &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._copyWithin( idx-escapeLastIndex, idx+1, quoteLastIndex )\n\t\t\t\t._rewind( escapeLength )\n\t\t\t\t._push( ch )\n\t\t\t\t._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In strict mode, quote sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in a quote sequence, meaning that a quote sequence does not immediately follow the escape sequence which led to the current state. Once this happens, we're in an invalid state and must raise an exception, as not clear how the parser should interpret the preceding values (e.g., was the preceding escape sequence a mistake and should be ignored? are we missing a quote sequence? etc.).\n\t\t* - In non-strict mode, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= quoteLastIndex ) {\n\t\t\tif ( strict ) {\n\t\t\t\tdebug( 'Error.' );\n\t\t\t\tparser._setErrorState( 'INVALID_QUOTED_ESCAPE' )._changeState( ERROR );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a quote sequence.' );\n\t\t\tparser._raiseWarning( 'INVALID_QUOTED_ESCAPE' )._push( ch )._changeState( QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:quoted_field' );\n\n// Possible transition states...\nvar QUOTE_END = state2enum[ 'quote_end' ];\nvar QUOTED_ESCAPE = state2enum[ 'quoted_escape' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a quoted field.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar escape;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote === false && // double quoting is disabled\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( QUOTED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an ending quote character sequence.\n\t\t*/\n\t\tif (\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the quote character sequence:\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._rewind( quoteLastIndex )._changeState( QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skip' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIP = state2enum[ 'skip' ];\nvar SKIPPED_COMMENT = state2enum[ 'skipped_comment' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\tvar skip;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for the start of a commented line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a commented line, the comment sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tidx-commentLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential comment match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_COMMENT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for the start of a skipped line.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In order for a row to be considered a skipped line, the skip sequence must be the first character(s) of the field.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for skipped lines\n\t\t\tidx-skipLastIndex === 0 && // only search the first character(s) of the first field\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._push( ch )._changeState( SKIP );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tif ( quoting && parser._isWhitespace( 0, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\tparser._push( ch );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_comment' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a skipped commented line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar newlineLastIndex;\n\tvar newline;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t// Check for the end of the commented line...\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_escape' );\n\n// Possible transition states...\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a skipped line.\n*\n* ## Notes\n*\n* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n* - An escape sequence escapes comment and skip sequences in **non-quoted** fields when an escape sequence occurs at the beginning of a record.\n* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar commentLastIndex;\n\tvar escapeLastIndex;\n\tvar skipLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar comment;\n\tvar escape;\n\tvar skip;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tcommentLastIndex = parser._commentLastIndex;\n\tcomment = parser._comment;\n\n\tskipLastIndex = parser._skipLastIndex;\n\tskip = parser._skip;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), escapeLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\td === delimiterLastIndex &&\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\td === newlineLastIndex &&\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an escape sequence.\n\t\t*/\n\t\tif (\n\t\t\td === escapeLastIndex &&\n\t\t\tch === escape[ escapeLastIndex ] &&\n\t\t\tparser._scan( escape, escapeLastIndex )\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a comment sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Comment sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tcomment && // user specified a comment character sequence, so should check for comments\n\t\t\tcursor-commentLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === comment[ commentLastIndex ] && // we have a potential match\n\t\t\tparser._scan( comment, commentLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Comment.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a skip sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Skip sequences only have special meaning when appearing at the beginning of a row.\n\t\t*/\n\t\tif (\n\t\t\tskip && // user specified a skip character sequence, so should check for a skipped line\n\t\t\tcursor-skipLastIndex === 0 && // only search the first character(s) of the row\n\t\t\tch === skip[ skipLastIndex ] && // we have a potential match\n\t\t\tparser._scan( skip, skipLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Skip.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the escape sequence which led to the current state. Once this happens, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= max ) {\n\t\t\tdebug( 'Normal character sequence.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_field' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a field within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar delimiter;\n\tvar newline;\n\tvar quoting;\n\tvar escape;\n\tvar strict;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoting = parser._quoting;\n\tstrict = parser._strict;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar idx = parser._cursor - parser._cidx + 1;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - An escape sequence escapes the delimiter, newline, and escape sequences in **non-quoted** fields.\n\t\t* - When `doublequote` is `false`, the escape sequence escapes quote sequences within **quoted** fields.\n\t\t* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning.\n\t\t*/\n\t\tif (\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tidx-quoteLastIndex === 0 && // only search the first character(s) of the field\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tparser._push( ch );\n\t\t\tif ( quoting ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t* Check for a quote character sequence (non-strict mode).\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - In non-strict mode, a quote character sequence is allowed to start after whitespace (e.g., `a, \"b\", c`).\n\t\t* - When `quoting` is `true`, in order for a field to be quoted, the quote sequence must be the first character(s) of the field.\n\t\t* - When `quoting` is `false`, quote sequences do **not** have any special meaning, and we process quote sequences as normal field text.\n\t\t*/\n\t\tif (\n\t\t\tstrict === false && // non-strict mode\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tparser._push( ch );\n\t\t\tif ( quoting && parser._isWhitespace( parser._cidx, parser._cursor-quoteLastIndex ) ) {\n\t\t\t\tdebug( 'Quote.' );\n\t\t\t\tparser._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Continue processing until we can transition to a new state:\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_invalid_quote_end' );\n\n// Possible transition states...\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar INIT = state2enum[ 'init' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing field characters after an ending quote sequence within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar delimiter;\n\tvar newline;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar maximum = require( './max.js' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quote_end' );\n\n// Possible transition states...\nvar INIT = state2enum[ 'init' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_INVALID_QUOTE_END = state2enum[ 'skipped_invalid_quote_end' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an ending quote sequence within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar delimiterLastIndex;\n\tvar newlineLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar delimiter;\n\tvar newline;\n\tvar quote;\n\tvar max;\n\n\tdelimiterLastIndex = parser._delimiterLastIndex;\n\tdelimiter = parser._delimiter;\n\n\tnewlineLastIndex = parser._newlineLastIndex;\n\tnewline = parser._newline;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\tmax = maximum( maximum( delimiterLastIndex, newlineLastIndex ), quoteLastIndex ); // eslint-disable-line max-len\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - When `doublequote` is `true`, quote character sequences are escaped by a preceding quote character sequence.\n\t\t* - When `doublequote` is `false`, quote character sequences must be explicitly escaped using an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Double quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a field delimiter.\n\t\t*/\n\t\tif (\n\t\t\tch === delimiter[ delimiterLastIndex ] &&\n\t\t\tparser._scan( delimiter, delimiterLastIndex )\n\t\t) {\n\t\t\tdebug( 'Delimiter.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a row separator.\n\t\t*/\n\t\tif (\n\t\t\tch === newline[ newlineLastIndex ] &&\n\t\t\tparser._scan( newline, newlineLastIndex )\n\t\t) {\n\t\t\t// Rewind the cursor to point to the last character before the newline character sequence:\n\t\t\tdebug( 'Newline.' );\n\t\t\tparser._rewind( newlineLastIndex )._changeState( INIT );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Field separators, row separators, and escaped quote sequences must immediately follow a potential closing quote sequence. At some point, we'll have processed a greater number of characters than exists in any of the special character sequences, meaning that none of those sequences immediately follow the quote sequence which led to the current state. Once this happens, we in an invalid state.\n\t\t*/\n\t\tif ( parser._cursor-parser._qidx >= max ) {\n\t\t\tdebug( 'Invalid closing quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_INVALID_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quoted_escape' );\n\n// Possible transition states...\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing an escape sequence within a quoted field within a skipped line.\n*\n* ## Notes\n*\n* - Within a quoted field, an escape sequence (only) escapes the quote sequence.\n* - If not immediately followed by a special character sequence, then the escape sequence has no special meaning and is considered a normal character sequence.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar quoteLastIndex;\n\tvar quote;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tvar cursor = parser._cursor;\n\t\tvar idx = parser._eidx; // position of last escape character\n\t\tvar d = cursor - idx;\n\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for a quote sequence.\n\t\t*/\n\t\tif (\n\t\t\td === quoteLastIndex &&\n\t\t\tch === quote[ quoteLastIndex ] &&\n\t\t\tparser._scan( quote, quoteLastIndex )\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for a non-special character sequence.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - Quote sequences must immediately follow an escape sequence. At some point, we'll have processed a greater number of characters than exists in a quote sequence, meaning that a quote sequence does not immediately follow the escape sequence which led to the current state. Once this happens, we assume that the escape sequence is a normal character sequence.\n\t\t*/\n\t\tif ( d >= quoteLastIndex ) {\n\t\t\t// Return to normal field processing:\n\t\t\tdebug( 'Escape sequence is not followed by a quote sequence.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_FIELD );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar state2enum = require( './state2enum.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'state:skipped_quoted_field' );\n\n// Possible transition states...\nvar SKIPPED_QUOTE_END = state2enum[ 'skipped_quote_end' ];\nvar SKIPPED_QUOTED_ESCAPE = state2enum[ 'skipped_quoted_escape' ];\n\n\n// MAIN //\n\n/**\n* Returns a function for processing a quoted field within a skipped line.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Function} processing function\n*/\nfunction processor( parser ) {\n\tvar escapeLastIndex;\n\tvar quoteLastIndex;\n\tvar doublequote;\n\tvar escape;\n\tvar quote;\n\n\tescapeLastIndex = parser._escapeLastIndex;\n\tescape = parser._escape;\n\n\tquoteLastIndex = parser._quoteLastIndex;\n\tquote = parser._quote;\n\n\tdoublequote = parser._doublequote;\n\n\treturn next;\n\n\t/**\n\t* Processes a character.\n\t*\n\t* @private\n\t* @param {string} ch - character\n\t* @returns {void}\n\t*/\n\tfunction next( ch ) {\n\t\tdebug( 'Char: %s', ch );\n\n\t\t/*\n\t\t* Check for an escape character sequence.\n\t\t*/\n\t\tif (\n\t\t\tdoublequote === false && // double quoting is disabled\n\t\t\tch === escape[ escapeLastIndex ] && // we have a potential match\n\t\t\tparser._scan( escape, escapeLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Escape.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTED_ESCAPE );\n\t\t\treturn;\n\t\t}\n\t\t/*\n\t\t* Check for an ending quote character sequence.\n\t\t*/\n\t\tif (\n\t\t\tch === quote[ quoteLastIndex ] && // we have a potential match\n\t\t\tparser._scan( quote, quoteLastIndex ) // we found a match\n\t\t) {\n\t\t\tdebug( 'Quote.' );\n\t\t\tparser._push( ch )._changeState( SKIPPED_QUOTE_END );\n\t\t\treturn;\n\t\t}\n\t\t// Continue processing until we can transition to a new state:\n\t\tparser._push( ch );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = processor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar enum2state = require( './enum2state.json' );\nvar closed = require( './closed.js' ); // eslint-disable-line stdlib/no-redeclare\nvar comment = require( './comment.js' );\nvar error = require( './error.js' );\nvar escape = require( './escape.js' ); // eslint-disable-line stdlib/no-redeclare\nvar field = require( './field.js' );\nvar init = require( './init.js' );\nvar invalidQuoteEnd = require( './invalid_quote_end.js' );\nvar quoteEnd = require( './quote_end.js' );\nvar quotedEscape = require( './quoted_escape.js' );\nvar quotedField = require( './quoted_field.js' );\nvar skip = require( './skip.js' );\nvar skippedComment = require( './skipped_comment.js' );\nvar skippedEscape = require( './skipped_escape.js' );\nvar skippedField = require( './skipped_field.js' );\nvar skippedInvalidQuoteEnd = require( './skipped_invalid_quote_end.js' );\nvar skippedQuoteEnd = require( './skipped_quote_end.js' );\nvar skippedQuotedEscape = require( './skipped_quoted_escape.js' );\nvar skippedQuotedField = require( './skipped_quoted_field.js' );\n\n\n// VARIABLES //\n\nvar table = {\n\t'closed': closed,\n\t'comment': comment,\n\t'escape': escape,\n\t'error': error,\n\t'field': field,\n\t'init': init,\n\t'invalid_quote_end': invalidQuoteEnd,\n\t'quote_end': quoteEnd,\n\t'quoted_escape': quotedEscape,\n\t'quoted_field': quotedField,\n\t'skip': skip,\n\t'skipped_comment': skippedComment,\n\t'skipped_escape': skippedEscape,\n\t'skipped_field': skippedField,\n\t'skipped_invalid_quote_end': skippedInvalidQuoteEnd,\n\t'skipped_quote_end': skippedQuoteEnd,\n\t'skipped_quoted_escape': skippedQuotedEscape,\n\t'skipped_quoted_field': skippedQuotedField\n};\n\n\n// MAIN //\n\n/**\n* Returns an object mapping state enumeration constants to state functions.\n*\n* @private\n* @param {Parser} parser - parser instance\n* @returns {Array} table\n*/\nfunction states( parser ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < enum2state.length; i++ ) {\n\t\tout.push( table[ enum2state[ i ] ]( parser ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = states;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this, max-len, no-underscore-dangle, max-lines */\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar setReadOnly = require( './../../../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../../../define-nonenumerable-read-only-accessor' );\nvar Boolean = require( '@stdlib/boolean/ctor' );\nvar format = require( '@stdlib/string/format' );\nvar rescape = require( './../../../../escape-regexp-string' );\nvar replace = require( '@stdlib/string/base/replace' );\nvar defaults = require( './defaults.js' );\nvar state2enum = require( './states/state2enum.js' );\nvar enum2state = require( './states/enum2state.json' );\nvar states = require( './states' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'parser' );\n\n// Parser states:\nvar CLOSED = state2enum[ 'closed' ];\nvar COMMENT = state2enum[ 'comment' ];\nvar ERROR = state2enum[ 'error' ];\nvar ESCAPE = state2enum[ 'escape' ];\nvar FIELD = state2enum[ 'field' ];\nvar INIT = state2enum[ 'init' ];\nvar INVALID_QUOTE_END = state2enum[ 'invalid_quote_end' ];\nvar QUOTE_END = state2enum[ 'quote_end' ];\nvar QUOTED_ESCAPE = state2enum[ 'quoted_escape' ];\nvar QUOTED_FIELD = state2enum[ 'quoted_field' ];\nvar SKIP = state2enum[ 'skip' ];\nvar SKIPPED_COMMENT = state2enum[ 'skipped_comment' ];\nvar SKIPPED_ESCAPE = state2enum[ 'skipped_escape' ];\nvar SKIPPED_FIELD = state2enum[ 'skipped_field' ];\nvar SKIPPED_INVALID_QUOTE_END = state2enum[ 'skipped_invalid_quote_end' ];\nvar SKIPPED_QUOTE_END = state2enum[ 'skipped_quote_end' ];\nvar SKIPPED_QUOTED_ESCAPE = state2enum[ 'skipped_quoted_escape' ];\nvar SKIPPED_QUOTED_FIELD = state2enum[ 'skipped_quoted_field' ];\n\n\n// FUNCTIONS //\n\n/**\n* Returns a regular expression pattern which matches a list of strings.\n*\n* @private\n* @param {StringArray} list - list of strings to match\n* @returns {string} regular expression pattern\n*/\nfunction array2pattern( list ) {\n\tvar pattern;\n\tvar i;\n\n\tpattern = '(?:';\n\tfor ( i = 0; i < list.length-1; i++ ) {\n\t\tpattern += rescape( list[ i ] ) + '|';\n\t}\n\treturn pattern + rescape( list[ i ] ) + ')';\n}\n\n\n// MAIN //\n\n/**\n* Returns an incremental parser for delimiter-separated values.\n*\n* @constructor\n* @param {Options} options - options object\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\nfunction Parser( options ) {\n\tvar opts;\n\n\tif ( !( this instanceof Parser ) ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn new Parser( options );\n\t\t}\n\t\treturn new Parser();\n\t}\n\t// TODO: option validation; enforce quote, comment, skip, delimiter, escape, and newline all being different and none can be a substring of the other (i.e., no escape equal to `,,` and delimiter equal to `,`, and no delimiter equal to `,` and newline being `,,` and vice versa; is `,,` an escape or simply an empty field?); should probably require that \"whitespace\" does not conflict with any of the special character sequences; require at least one whitespace character\n\toptions = options || {};\n\topts = defaults();\n\n\t// Buffer for tracking internal state:\n\tthis._buffer = [];\n\n\t// Index of the most recently processed character:\n\tthis._cursor = -1;\n\n\t// Index marking the beginning of the current field:\n\tthis._cidx = 0;\n\n\t// Indices marking the most recent unescaped quote sequence:\n\tthis._qidx = -1;\n\n\t// Indices marking the most recent escape sequence:\n\tthis._eidx = -1;\n\n\t// Buffer for storing the field values for the current row:\n\tthis._rowBufferFLG = Boolean( options.rowBuffer );\n\tthis._rowBuffer = options.rowBuffer || opts.rowBuffer;\n\n\t// Column, row, and line counters:\n\tthis._col = 0;\n\tthis._row = 0;\n\tthis._line = 0;\n\n\t// Initialize flags indicating whether we're processing a commented/skipped line:\n\tthis._commented = false;\n\tthis._skipped = false;\n\n\t// Initialize the error state:\n\tthis._errname = '';\n\n\t// Extract various options:\n\tthis._comment = options.comment || opts.comment;\n\tthis._delimiter = options.delimiter || opts.delimiter;\n\tthis._doublequote = ( options.doublequote === void 0 ) ? opts.doublequote : options.doublequote;\n\tthis._escape = options.escape || opts.escape;\n\tthis._ltrim = ( options.ltrim === void 0 ) ? opts.ltrim : options.ltrim;\n\tthis._maxRows = ( options.maxRows === void 0 ) ? opts.maxRows : options.maxRows;\n\tthis._newline = options.newline || opts.newline;\n\tthis._quote = options.quote || opts.quote;\n\tthis._quoting = ( options.quoting === void 0 ) ? opts.quoting : options.quoting;\n\tthis._rtrim = ( options.rtrim === void 0 ) ? opts.rtrim : options.rtrim;\n\tthis._skip = options.skip || opts.skip;\n\tthis._skipBlankRows = ( options.skipBlankRows === void 0 ) ? opts.skipBlankRows : options.skipBlankRows;\n\tthis._skipRow = options.skipRow || opts.skipRow;\n\tthis._strict = ( options.strict === void 0 ) ? opts.strict : options.strict;\n\tthis._trimComment = ( options.trimComment === void 0 ) ? opts.trimComment : options.trimComment;\n\tthis._whitespace = array2pattern( options.whitespace || opts.whitespace );\n\n\tthis._reWhitespace = new RegExp( '^'+this._whitespace+'*([\\\\S\\\\s]*?)'+this._whitespace+'*$' );\n\tthis._reWhitespaceLeft = new RegExp( '^'+this._whitespace+'*' );\n\tthis._reWhitespaceRight = new RegExp( this._whitespace+'*$' );\n\n\tthis._onClose = options.onClose || opts.onClose;\n\tthis._onColumn = options.onColumn || opts.onColumn;\n\tthis._onComment = options.onComment || opts.onComment;\n\tthis._onRow = options.onRow || opts.onRow;\n\tthis._onSkip = options.onSkip || opts.onSkip;\n\n\tthis._onError = options.onError || opts.onError;\n\tthis._onWarn = options.onWarn || opts.onWarn;\n\n\tthis._commentLength = this._comment.length;\n\tthis._commentLastIndex = this._commentLength - 1;\n\n\tthis._delimiterLength = this._delimiter.length;\n\tthis._delimiterLastIndex = this._delimiterLength - 1;\n\n\tthis._escapeLength = this._escape.length;\n\tthis._escapeLastIndex = this._escapeLength - 1;\n\n\tthis._newlineLength = this._newline.length;\n\tthis._newlineLastIndex = this._newlineLength - 1;\n\n\tthis._quoteLength = this._quote.length;\n\tthis._quoteLastIndex = this._quoteLength - 1;\n\n\tthis._skipLength = this._skip.length;\n\tthis._skipLastIndex = this._skipLength - 1;\n\n\t// Initialize the state flag:\n\tif ( this._skipRow && this._skipRow( 0, 0 ) ) {\n\t\tthis._state = SKIP;\n\t\tthis._skipped = true;\n\t} else {\n\t\tthis._state = INIT;\n\t}\n\t// Initialize state processors...\n\tthis._states = states( this ); // NOTE: this should come after all other initialization!\n\n\treturn this;\n}\n\n/**\n* Updates state by adding a processed character to an internal buffer.\n*\n* @private\n* @name _push\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} ch - character\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_push', function push( ch ) {\n\tvar buf = this._buffer;\n\n\t// Increment the internal buffer pointer:\n\tthis._cursor += 1;\n\n\t// Only expand the internal buffer if we've run out of previously allocated memory...\n\tif ( this._cursor >= buf.length ) {\n\t\tbuf.push( ch );\n\t\tdebug( 'Internal buffer size increased. Length: %d.', buf.length );\n\t} else {\n\t\t// Reuse existing memory:\n\t\tbuf[ this._cursor ] = ch;\n\t}\n\tdebug( 'Cursor: %d. Push: %s', this._cursor, ch );\n\treturn this;\n});\n\n/**\n* Rewinds the internal buffer cursor by a specified amount.\n*\n* @private\n* @name _rewind\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} N - number of elements to rewind\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_rewind', function rewind( N ) {\n\tthis._cursor -= N;\n\n\tdebug( 'Rewind: %d. Cursor: %d.', N, this._cursor );\n\treturn this;\n});\n\n/**\n* Copies a sequence of internal buffer elements to an earlier position in the buffer.\n*\n* @private\n* @name _copyWithin\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} target - starting position to which to copy elements\n* @param {NonNegativeInteger} start - staring index of the elements to copy (inclusive)\n* @param {NonNegativeInteger} N - number of elements to copy\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_copyWithin', function copyWithin( target, start, N ) {\n\tvar buf;\n\tvar i;\n\n\tbuf = this._buffer;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tbuf[ target+i ] = buf[ start+i ];\n\t}\n\treturn this;\n});\n\n/**\n* Returns the contents of a buffer slice.\n*\n* @private\n* @name _slice\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {string} buffer contents\n*/\nsetReadOnly( Parser.prototype, '_slice', function slice( start, end ) {\n\treturn this._buffer.slice( start, end+1 ).join( '' );\n});\n\n/**\n* Checks whether the contents of a buffer slice consists of only whitespace.\n*\n* @private\n* @name _isWhitespace\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {boolean} boolean indicating whether a buffer slice consists of only whitespace\n*/\nsetReadOnly( Parser.prototype, '_isWhitespace', function isWhitespace( start, end ) {\n\treturn ( replace( this._slice( start, end ), this._reWhitespaceLeft, '' ) === '' );\n});\n\n/**\n* Resets the parser.\n*\n* @private\n* @name _reset\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_reset', function reset() {\n\t// Reset counters and indices:\n\tthis._col = 0;\n\tthis._cidx = 0;\n\tthis._qidx = -1;\n\tthis._eidx = -1;\n\n\t// Reset the parser state...\n\tif ( this._skipRow && this._skipRow( this._row, this._line ) ) {\n\t\tthis._state = SKIP;\n\t\tthis._skipped = true;\n\t} else {\n\t\tthis._state = INIT;\n\t\tthis._skipped = false;\n\t}\n\tthis._commented = false;\n\n\t// Reset the buffer:\n\tthis._cursor = -1;\n\n\tdebug( 'Parser reset.' );\n\treturn this;\n});\n\n/**\n* Sets a field value in an internal row buffer.\n*\n* @private\n* @name _set\n* @memberof Parser.prototype\n* @type {Function}\n* @param {*} value - field value\n* @param {NonNegativeInteger} idx - field index\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_setField', function set( value, idx ) {\n\tvar buf = this._rowBuffer;\n\n\t// FIXME: as buffer may be provided from userland, use `set` accessor and consider using `@stdlib/utils/push` to allow support of dynamically resizing fixed length buffers\n\n\t// Only expand the row buffer if we've run out of previously allocated memory...\n\tif ( idx >= buf.length ) {\n\t\tbuf.push( value );\n\t\tdebug( 'Row buffer size increased. Length: %d.', buf.length );\n\t} else {\n\t\t// Reuse existing memory:\n\t\tbuf[ idx ] = value;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a field value.\n*\n* @private\n* @name _getField\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} start - starting character index (inclusive)\n* @param {NonNegativeInteger} end - ending character index (inclusive)\n* @returns {string} field value\n*/\nsetReadOnly( Parser.prototype, '_getField', function get( start, end ) {\n\tvar v = this._slice( start, end );\n\tif ( this._ltrim ) {\n\t\tif ( this._rtrim ) {\n\t\t\treturn replace( v, this._reWhitespace, '$1' );\n\t\t}\n\t\treturn replace( v, this._reWhitespaceLeft, '' );\n\t}\n\tif ( this._rtrim ) {\n\t\treturn replace( v, this._reWhitespaceRight, '' );\n\t}\n\treturn v;\n});\n\n/**\n* Returns the current row of values.\n*\n* @private\n* @name _getRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {ArrayLikeObject} row of values\n*/\nsetReadOnly( Parser.prototype, '_getRow', function get() {\n\tif ( this._rowBufferFLG ) {\n\t\treturn this._rowBuffer;\n\t}\n\t// Return a shallow copy to avoid mutating internal state:\n\treturn this._rowBuffer.slice( 0, this._col );\n});\n\n/**\n* Scans the internal buffer for a specified character sequence.\n*\n* ## Notes\n*\n* - Given an internal buffer\n*\n* ```text\n* | ... | a | b |\n* ```\n*\n* search character sequence\n*\n* ```text\n* | a | b | c |\n* ```\n*\n* and `N` equal to `2`, the method will begin scanning from the position of `a` in the internal buffer above and compare to each element of the first `N` characters of the search character sequence.\n*\n* This method is intended to be used in scenarios where we already know that an incoming character matches the last character of the search sequence, and we want to know whether the rest of the search sequence matches the most recently added elements in the internal buffer.\n*\n* @private\n* @name _scan\n* @memberof Parser.prototype\n* @type {Function}\n* @param {StringArray} search - character sequence\n* @param {NonNegativeInteger} N - number of characters to search\n* @returns {boolean} boolean indicating whether a match was found\n*/\nsetReadOnly( Parser.prototype, '_scan', function scan( search, N ) {\n\tvar buf;\n\tvar idx;\n\tvar i;\n\n\tbuf = this._buffer;\n\tidx = this._cursor - N + 1;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( buf[ idx+i ] !== search[ i ] ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ( i === N );\n});\n\n/**\n* Processes a field.\n*\n* @private\n* @name _onField\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onField', function onField() {\n\t// Extract the field value:\n\tvar v = this._getField( this._cidx, this._cursor );\n\n\t// Insert the field value into the row buffer:\n\tthis._setField( v, this._col );\n\n\t// Invoke a callback for receiving field values:\n\tthis._onColumn( v, this._row, this._col, this._line );\n\tdebug( 'Field. Line: %d. Row: %d. Column: %d. Value: %s', this._line, this._row, this._col, v );\n\n\t// Increment the field counter to record that we've moved on to the next field:\n\tthis._col += 1;\n\n\t// Increment the index marking the beginning of the next field:\n\tthis._cidx = this._cursor + 1; // +1 as the cursor currently points to the last character in the current field, and, thus, the next field should start at the next index\n\n\t// Reset indices:\n\tthis._qidx = -1;\n\tthis._eidx = -1;\n\n\treturn this;\n});\n\n/**\n* Processes a record.\n*\n* @private\n* @name _onRecord\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onRecord', function onRecord() {\n\tvar v;\n\n\t// Extract the field value:\n\tv = this._getField( this._cidx, this._cursor );\n\n\t// Check for a blank row (i.e., a row consisting only of whitespace):\n\tif ( this._skipBlankRows && this._col === 0 ) {\n\t\tif ( v === '' || replace( v, this._reWhitespaceLeft, '' ) === '' ) {\n\t\t\treturn this._onSkippedRow();\n\t\t}\n\t}\n\t// Insert the field value into the row buffer:\n\tthis._setField( v, this._col );\n\n\t// Invoke a callback for receiving field values:\n\tthis._onColumn( v, this._row, this._col, this._line );\n\tthis._col += 1;\n\n\t// Invoke a callback for receiving rows:\n\tthis._onRow( this._getRow(), this._row, this._col, this._line );\n\tdebug( 'Record. Line: %d. Fields: %d.', this._line, this._col );\n\n\t// Increment row and line counters to indicate that we've moved on to the next row/line:\n\tthis._row += 1;\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\t// Check whether we have processed a desired number of rows...\n\tif ( this._row >= this._maxRows ) {\n\t\tthis._changeState( CLOSED );\n\t}\n\treturn this;\n});\n\n/**\n* Processes a commented row.\n*\n* @private\n* @name _onCommentedRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onCommentedRow', function onCommentedRow() {\n\tvar v;\n\n\t// Invoke a callback for receiving commented lines:\n\tif ( this._onComment ) {\n\t\tv = this._slice( 0, this._cursor );\n\t\tif ( this._trimComment ) {\n\t\t\tv = replace( v, this._reWhitespaceLeft, '' );\n\t\t}\n\t\tthis._onComment( v, this._line );\n\t\tdebug( 'Comment. Line: %d. Value: %s', this._line, v );\n\t} else {\n\t\tdebug( 'Comment. Line: %d.', this._line );\n\t}\n\t// Increment the counter for how many lines have been processed:\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\treturn this;\n});\n\n/**\n* Processes a skipped row.\n*\n* @private\n* @name _onSkippedRow\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onSkippedRow', function onSkippedRow() {\n\tvar v;\n\n\t// Invoke a callback for receiving skipped lines:\n\tif ( this._onSkip ) {\n\t\tv = this._slice( 0, this._cursor );\n\t\tthis._onSkip( v, this._line );\n\t\tdebug( 'Skipped row. Line: %d. Value: %s', this._line, v );\n\t} else {\n\t\tdebug( 'Skipped row. Line: %d.', this._line );\n\t}\n\t// Increment the counter for how many lines have been processed:\n\tthis._line += 1;\n\n\t// Reset the parser:\n\tthis._reset();\n\n\treturn this;\n});\n\n/**\n* Processes a closing quote sequence.\n*\n* @private\n* @name _onClosingQuote\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onClosingQuote', function onClosingQuote() {\n\t// Cache the cursor position marking the end of the closing quote sequence:\n\tthis._qidx = this._cursor;\n\treturn this;\n});\n\n/**\n* Processes an escape sequence.\n*\n* @private\n* @name _onEscape\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_onEscape', function onEscape() {\n\t// Cache the cursor position marking the end of the escape sequence:\n\tthis._eidx = this._cursor;\n\treturn this;\n});\n\n/**\n* Creates a parser exception.\n*\n* @private\n* @name _createException\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - exception name\n* @returns {Error} parser exception\n*/\nsetReadOnly( Parser.prototype, '_createException', function createException( name ) {\n\tvar err;\n\n\tswitch ( name ) {\n\tcase 'INVALID_CLOSING_QUOTE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains a closing quote which is not immediately followed by a delimiter or newline.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_OPENING_QUOTE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an opening quote which does not immediately follow a delimiter or newline.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_ESCAPE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence which is not immediately followed by a special character sequence.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'INVALID_QUOTED_ESCAPE':\n\t\terr = new Error( format( 'unexpected error. Encountered an invalid record. Field %d on line %d contains an escape sequence within a quoted field which is not immediately followed by a quote sequence.', this._col, this._line ) );\n\t\tbreak;\n\tcase 'CLOSED':\n\t\terr = new Error( 'invalid operation. Parser is unable to parse new chunks, as the parser has been closed. To parse new chunks, create a new parser instance.' );\n\t\tbreak;\n\tdefault:\n\t\terr = new Error( 'invalid operation. Parser is in an unrecoverable error state. To parse new chunks, create a new parser instance.' );\n\t\tbreak;\n\t}\n\treturn err;\n});\n\n/**\n* Raises a parser warning.\n*\n* @private\n* @name _raiseWarning\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - exception name\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_raiseWarning', function raiseWarning( name ) {\n\tvar err;\n\n\tif ( this._onWarn ) {\n\t\terr = this._createException( name );\n\n\t\tdebug( 'Warning: %s', err.message );\n\t\tthis._onWarn( err );\n\t}\n\treturn this;\n});\n\n/**\n* Raises a parser exception.\n*\n* @private\n* @name _raiseException\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_raiseException', function raiseException() {\n\tvar err = this._createException( this._errname );\n\n\tdebug( 'Error: %s', err.message );\n\tthis._onError( err );\n\n\treturn this;\n});\n\n/**\n* Updates the parser state.\n*\n* @private\n* @name _changeState\n* @memberof Parser.prototype\n* @type {Function}\n* @param {NonNegativeInteger} state - state enumeration constant\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_changeState', function changeState( state ) {\n\tdebug( 'State transition: %s -> %s.', enum2state[ this._state ], enum2state[ state ] );\n\n\tswitch ( state ) { // eslint-disable-line default-case\n\tcase CLOSED:\n\t\tthis._close();\n\t\tbreak;\n\tcase COMMENT:\n\t\tthis._commented = true;\n\t\tbreak;\n\tcase ERROR:\n\t\tthis._raiseException();\n\t\tbreak;\n\tcase ESCAPE:\n\t\tthis._onEscape();\n\t\tbreak;\n\tcase FIELD:\n\t\tif ( this._state !== ESCAPE ) {\n\t\t\tthis._onField();\n\t\t}\n\t\tbreak;\n\tcase INIT:\n\t\tif ( this._commented ) {\n\t\t\tthis._onCommentedRow();\n\t\t} else if ( this._skipped ) {\n\t\t\tthis._onSkippedRow();\n\t\t} else {\n\t\t\tthis._onRecord();\n\t\t}\n\t\tbreak;\n\tcase INVALID_QUOTE_END:\n\t\tbreak;\n\tcase QUOTE_END:\n\t\tthis._onClosingQuote();\n\t\tbreak;\n\tcase QUOTED_ESCAPE:\n\t\tthis._onEscape();\n\t\tbreak;\n\tcase QUOTED_FIELD:\n\t\tbreak;\n\tcase SKIP:\n\t\tthis._skipped = true;\n\t\tbreak;\n\tcase SKIPPED_COMMENT:\n\tcase SKIPPED_ESCAPE:\n\tcase SKIPPED_FIELD:\n\tcase SKIPPED_INVALID_QUOTE_END:\n\tcase SKIPPED_QUOTE_END:\n\tcase SKIPPED_QUOTED_ESCAPE:\n\tcase SKIPPED_QUOTED_FIELD:\n\t\tbreak;\n\t}\n\tthis._state = state;\n\treturn this;\n});\n\n/**\n* Sets the parser's error state.\n*\n* @private\n* @name _setErrorState\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} name - error name\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_setErrorState', function setErrorState( name ) {\n\tif ( name ) {\n\t\tdebug( 'Error: %s.', name );\n\t} else {\n\t\tdebug( 'Reset error state.' );\n\t}\n\tthis._errname = name;\n\treturn this;\n});\n\n/**\n* Closes the parser.\n*\n* @private\n* @name _close\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*/\nsetReadOnly( Parser.prototype, '_close', function close() {\n\tvar state;\n\tvar v;\n\n\tif ( this.done ) {\n\t\tthis._setErrorState( CLOSED )._changeState( ERROR );\n\t\treturn this;\n\t}\n\tif ( this._cursor >= 0 ) {\n\t\tstate = this._state;\n\t\tif ( state === INIT || state === FIELD || state === QUOTE_END ) {\n\t\t\t// If the current state is \"field\" or \"quote end\", we're in a valid state and can simply transition to our initial state to indicate that we've processed a record:\n\t\t\tthis._changeState( INIT )._onClose();\n\t\t} else {\n\t\t\t// Check if we were able to process part of a row...\n\t\t\tif ( this._col ) {\n\t\t\t\t// This may be an incomplete row!!!\n\t\t\t\tthis._onRow( this._getRow(), this._row, this._col );\n\t\t\t}\n\t\t\t// Extract however much of the current field we were able to process:\n\t\t\tv = this._slice( this._cidx, this._cursor );\n\n\t\t\t// Return the unfinished field to the client (although this may not be equal to the original character sequence, as escape sequences may have already been stripped!):\n\t\t\tdebug( 'Flush: %s', v );\n\t\t\tthis._onClose( v );\n\t\t}\n\t} else {\n\t\tthis._onClose();\n\t}\n\tdebug( 'Closed.' );\n\treturn this;\n});\n\n/**\n* Parses the next chunk.\n*\n* @name next\n* @memberof Parser.prototype\n* @type {Function}\n* @param {string} chunk - chunk\n* @throws {Error} unable to parse new chunks\n* @throws {Error} invalid field\n* @throws {Error} invalid record\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*/\nsetReadOnly( Parser.prototype, 'next', function next( chunk ) {\n\tvar states;\n\tvar i;\n\n\tdebug( 'Chunk: %s', chunk );\n\n\tif ( this.done ) {\n\t\tthis._setErrorState( CLOSED )._changeState( ERROR );\n\t\treturn this;\n\t}\n\tstates = this._states;\n\tfor ( i = 0; i < chunk.length; i++ ) {\n\t\tstates[ this._state ]( chunk[ i ] );\n\t\tif ( this._state === CLOSED || this._state === ERROR ) {\n\t\t\treturn this;\n\t\t}\n\t}\n\treturn this;\n});\n\n/**\n* Closes the parser.\n*\n* @name close\n* @memberof Parser.prototype\n* @type {Function}\n* @returns {Parser} parser instance\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*/\nsetReadOnly( Parser.prototype, 'close', function close() {\n\tif ( this.done ) {\n\t\treturn this;\n\t}\n\tthis._changeState( CLOSED );\n\treturn this;\n});\n\n/**\n* Boolean indicating whether a parser is able to process new chunks.\n*\n* @name done\n* @memberof Parser.prototype\n* @readonly\n* @type {boolean}\n*\n* @example\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\nsetReadOnlyAccessor( Parser.prototype, 'done', function get() {\n\treturn ( this._state === CLOSED ) || ( this._state === ERROR );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Parser;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Incremental parser for delimiter-separated values.\n*\n* @module @stdlib/utils/dsv/base/parse\n*\n* @example\n* var Parser = require( '@stdlib/utils/dsv/base/parse' );\n*\n* var parser = new Parser();\n*\n* // ...\n*\n* parser.next( '1,2,3,4\\n' );\n*\n* // ...\n*\n* parser.next( '5,6,7,8\\n' );\n*\n* // ...\n*\n* parser.next( '9,10,11,12\\n' );\n*\n* // ...\n*\n* parser.close();\n*\n* // ...\n*\n* var bool = parser.done;\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name parse\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/dsv/base/parse}\n*/\nsetReadOnly( ns, 'parse', require( './../../../dsv/base/parse' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/dsv/base}\n*/\nsetReadOnly( ns, 'base', require( './../../dsv/base' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property `[key, value]` pairs.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} array containing key-value pairs\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var entries = objectEntries( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\nfunction objectEntries( obj ) {\n\tvar keys;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( [ keys[i], obj[ keys[i] ] ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectEntries;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property `[key, value]` pairs.\n*\n* @module @stdlib/utils/entries\n*\n* @example\n* var objectEntries = require( '@stdlib/utils/entries' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var entries = objectEntries( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property `[key, value]` pairs.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} array containing key-value pairs\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var entries = objectEntriesIn( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\nfunction objectEntriesIn( obj ) {\n\tvar key;\n\tvar out;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( [ key, obj[ key ] ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectEntriesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property `[key, value]` pairs.\n*\n* @module @stdlib/utils/entries-in\n*\n* @example\n* var objectEntriesIn = require( '@stdlib/utils/entries-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var entries = objectEntriesIn( obj );\n* // e.g., returns [ ['beep', 'boop'], ['foo', 'bar'] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertySymbols !== 'undefined' );\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertySymbols = Object.getOwnPropertySymbols;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own symbol properties\n*\n* @example\n* var symbols = getOwnPropertySymbols( {} );\n*/\nfunction getOwnPropertySymbols( value ) {\n\treturn propertySymbols( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {EmptyArray} a list of own symbol properties\n*\n* @example\n* var symbols = getOwnPropertySymbols( {} );\n* // returns []\n*/\nfunction getOwnPropertySymbols() {\n\treturn [];\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own symbol properties.\n*\n* @module @stdlib/utils/property-symbols\n*\n* @example\n* var getOwnPropertySymbols = require( '@stdlib/utils/property-symbols' );\n*\n* var symbols = getOwnPropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar keys = require( './../../keys' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property enumerable names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = enumerableProperties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction enumerableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tout = keys( value );\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isEnumerable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names and symbols.\n*\n* @module @stdlib/utils/enumerable-properties\n*\n* @example\n* var enumerableProperties = require( '@stdlib/utils/enumerable-properties' );\n*\n* var props = enumerableProperties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited enumerable property names and symbols\n*\n* @example\n* var props = enumerablePropertiesIn( [] );\n* // returns []\n*/\nfunction enumerablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting enumerable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property names and symbols.\n*\n* @module @stdlib/utils/enumerable-properties-in\n*\n* @example\n* var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' );\n*\n* var props = enumerablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable symbol properties\n*\n* @example\n* var symbols = enumerablePropertySymbols( {} );\n*/\nfunction enumerablePropertySymbols( value ) {\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isEnumerableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable symbol properties.\n*\n* @module @stdlib/utils/enumerable-property-symbols\n*\n* @example\n* var enumerablePropertySymbols = require( '@stdlib/utils/enumerable-property-symbols' );\n*\n* var symbols = enumerablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited enumerable symbol properties\n*\n* @example\n* var symbols = enumerablePropertySymbolsIn( {} );\n*/\nfunction enumerablePropertySymbolsIn( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting enumerable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = enumerablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable symbol properties.\n*\n* @module @stdlib/utils/enumerable-property-symbols-in\n*\n* @example\n* var enumerablePropertySymbolsIn = require( '@stdlib/utils/enumerable-property-symbols-in' );\n*\n* var symbols = enumerablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Alias for `eval` global.\n*\n* @module @stdlib/utils/eval\n*\n* @example\n* var evil = require( '@stdlib/utils/eval' );\n*\n* var v = evil( '5*4*3*2*1' );\n* // returns 120\n*/\n\n// MODULES //\n\nvar evil = eval; // eslint-disable-line no-eval\n\n\n// EXPORTS //\n\nmodule.exports = evil;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar base = require( '@stdlib/array/base/every' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection are truthy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether all elements are truthy\n*\n* @example\n* var arr = [ 1, 1, 1, 1, 1 ];\n*\n* var bool = every( arr );\n* // returns true\n*/\nfunction every( collection ) {\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\treturn base( collection );\n}\n\n\n// EXPORTS //\n\nmodule.exports = every;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection are truthy.\n*\n* @module @stdlib/utils/every\n*\n* @example\n* var every = require( '@stdlib/utils/every' );\n*\n* var arr = [ 1, 1, 1, 1, 1 ];\n*\n* var bool = every( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyBy( arr, isPositive );\n* // returns true\n*/\nfunction everyBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( !out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/every-by\n*\n* @example\n* var every = require( '@stdlib/utils/every-by' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyBy( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `every` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `every()`, `[].push()` behavior is consistent with `everyByRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyByRight( arr, isPositive );\n* // returns true\n*/\nfunction everyByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( !out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/every-by-right\n*\n* @example\n* var everyByRight = require( '@stdlib/utils/every-by-right' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var bool = everyByRight( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar RE_EXTNAME = require( '@stdlib/regexp/extname' ).REGEXP;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a filename extension.\n*\n* @param {string} filename - filename\n* @throws {TypeError} must provide a string primitive\n* @returns {string} filename extension\n*\n* @example\n* var ext = extname( 'index.js' );\n* // returns '.js'\n*/\nfunction extname( filename ) {\n\tif ( !isString( filename ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Filename must be a string. Value: `%s`.', filename ) );\n\t}\n\treturn RE_EXTNAME.exec( filename )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = extname;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a filename extension.\n*\n* @module @stdlib/utils/extname\n*\n* @example\n* var extname = require( '@stdlib/utils/extname' );\n*\n* var ext = extname( 'index.js' );\n* // returns '.js'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Queue node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\tthis.next = null;\n\tthis.prev = null;\n\tthis.value = value;\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* First-in-first-out queue constructor.\n*\n* @constructor\n* @returns {FIFO} FIFO queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nfunction FIFO() {\n\tif ( !(this instanceof FIFO) ) {\n\t\treturn new FIFO();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the queue.\n*\n* @name clear\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {FIFO} queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = queue.first();\n* // returns 'foo'\n*\n* // Examine the queue length:\n* var len = queue.length;\n* // returns 2\n*\n* // Clear all queue items:\n* queue.clear();\n*\n* // Peek at the first value:\n* v = queue.first();\n* // returns undefined\n*\n* // Examine the queue length:\n* len = queue.length;\n* // returns 0\n*/\nsetReadOnly( FIFO.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the \"oldest\" queue value (i.e., the value which is \"first-out\").\n*\n* @name first\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} \"oldest\" queue value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = queue.first();\n* // returns 'foo'\n*/\nsetReadOnly( FIFO.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first.value;\n\t}\n});\n\n/**\n* Returns an iterator for iterating over a queue.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from queue mutation during iteration, a returned iterator **always** iterates over a queue \"snapshot\", which is defined as the list of queue elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = queue.iterator();\n*\n* // Iterate over the queue...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( FIFO.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = -1;\n\n\t// Create a copy of queue values (necessary in order to \"snapshot\" the queue; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the \"newest\" queue value (i.e., the value which is currently \"last-out\").\n*\n* @name last\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} \"newest\" queue value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = queue.last();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last.value;\n\t}\n});\n\n/**\n* Queue length.\n*\n* @name length\n* @memberof FIFO.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var queue = new FIFO();\n*\n* // Examine the initial queue length:\n* var len = queue.length;\n* // returns 0\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current queue length:\n* len = queue.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( FIFO.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the queue.\n*\n* @name pop\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'pop', function pop() {\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the \"first-out\" value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"first-out\" or whether we have drained the queue...\n\t\tif ( this._first.next ) {\n\t\t\tthis._first = this._first.next;\n\t\t\tthis._first.prev = null;\n\t\t} else {\n\t\t\t// Queue is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the queue length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n});\n\n/**\n* Adds a value to the queue.\n*\n* @name push\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {FIFO} queue instance\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\nsetReadOnly( FIFO.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new queue node:\n\tnode = new Node( value );\n\n\t// Check whether the queue is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only queued node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the node to the previous most \"recent\" node:\n\t\tnode.prev = this._last;\n\n\t\t// Link the previous most \"recent\" node to the new node:\n\t\tthis._last.next = node;\n\n\t\t// Update the queue pointer for the \"last\" node to the new node:\n\t\tthis._last = node;\n\t}\n\t// Increment the queue length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Returns an array of queue values.\n*\n* @name toArray\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Array} queue values\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of queue values:\n* var vals = queue.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( FIFO.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a queue as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `FIFO` instance.\n*\n* @name toJSON\n* @memberof FIFO.prototype\n* @type {Function}\n* @returns {Object} serialized queue\n*\n* @example\n* var queue = new FIFO();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = queue.toJSON();\n* // returns { 'type': 'fifo', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( FIFO.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'fifo';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = FIFO;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* First-in-first-out queue.\n*\n* @module @stdlib/utils/fifo\n*\n* @example\n* var fifo = require( '@stdlib/utils/fifo' );\n*\n* var queue = fifo();\n*\n* // Add values to the queue:\n* queue.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = queue.pop();\n* // returns 'foo'\n*\n* // Add a new value to the queue:\n* queue.push( 'beep' );\n*\n* // Remove the \"oldest\" queue value:\n* v = queue.pop();\n* // returns 'bar'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a predicate function.\n*\n* ## Notes\n*\n- The predicate function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* - Only those arguments in which the predicate function returns a truthy value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v !== 2 );\n* }\n*\n* var bar = filterArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction filterArguments( fcn, predicate, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function according to a predicate function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar v;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( predicate( v, i ) ) {\n\t\t\t\targs.push( v );\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = filterArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a predicate function.\n*\n* @module @stdlib/utils/filter-arguments\n*\n* @example\n* var filterArguments = require( '@stdlib/utils/filter-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v !== 2 );\n* }\n*\n* var bar = filterArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RETURNS = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Finds elements in an array-like object that satisfy a test condition.\n*\n* @param {(Collection|string)} arr - object from which elements will be tested\n* @param {Options} [options] - function options\n* @param {integer} [options.k=arr.length] - limits the number of returned elements\n* @param {string} [options.returns='indices'] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} clbk - function invoked for each array element. If the return value is truthy, the value is considered to have satisfied the test condition.\n* @throws {TypeError} first argument must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} `options.k` must be an integer\n* @throws {TypeError} `options.returns` must be a string equal to `values`, `indices` or `*`\n* @returns {Array} array of indices, element values, or arrays of index-value pairs\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var vals = find( data, condition );\n* // returns [ 0, 2, 3 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': 2,\n* 'returns': 'values'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ 30, 50 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var vals = find( data, condition );\n* // returns []\n*\n* function condition( val ) {\n* return val > 1000;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': -2,\n* 'returns': 'values'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ 60, 50 ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* @example\n* var data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': -2,\n* 'returns': '*'\n* };\n* var vals = find( data, opts, condition );\n* // returns [ [3, 60], [2, 50] ]\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*/\nfunction find( arr, options, clbk ) { // eslint-disable-line stdlib/no-redeclare\n\tvar count;\n\tvar mode;\n\tvar opts;\n\tvar len;\n\tvar out;\n\tvar ret;\n\tvar cb;\n\tvar i;\n\tvar k;\n\tvar v;\n\n\tmode = 0;\n\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( arguments.length < 3 ) {\n\t\topts = {};\n\t\tcb = options;\n\t} else {\n\t\topts = options;\n\t\tcb = clbk;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( !isObject( opts ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t}\n\tif ( hasOwnProp( opts, 'k' ) ) {\n\t\tk = opts.k;\n\t\tif ( !isInteger( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an integer. Option: `%s`.', 'k', k ) );\n\t\t}\n\t} else {\n\t\tk = len;\n\t}\n\tif ( hasOwnProp( opts, 'returns' ) ) {\n\t\tret = opts.returns;\n\t\tif ( !isString( ret ) || indexOf( RETURNS, ret ) === -1 ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', RETURNS.join( '\", \"' ), ret ) );\n\t\t}\n\t\tif ( ret === 'values' ) {\n\t\t\tmode = 1;\n\t\t} else if ( ret === '*' ) {\n\t\t\tmode = 2;\n\t\t}\n\t}\n\tout = [];\n\tcount = 0;\n\n\tif ( k === 0 ) {\n\t\treturn out;\n\t}\n\tif ( k > 0 ) {\n\t\t// Search moving from begin-to-end [0,1,...]:\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv = arr[ i ];\n\t\t\tif ( cb( v, i, arr ) ) { // eslint-disable-line node/callback-return\n\t\t\t\tif ( mode === 2 ) {\n\t\t\t\t\tout.push( [ i, v ] );\n\t\t\t\t} else if ( mode === 1 ) {\n\t\t\t\t\tout.push( v );\n\t\t\t\t} else {\n\t\t\t\t\tout.push( i );\n\t\t\t\t}\n\t\t\t\tcount += 1;\n\t\t\t\tif ( count === k ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\t// Search moving from end-to-begin [...,2,1,0]:\n\tk = -k;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tv = arr[ i ];\n\t\tif ( cb( v, i, arr ) ) { // eslint-disable-line node/callback-return\n\t\t\tif ( mode === 2 ) {\n\t\t\t\tout.push( [ i, v ] );\n\t\t\t} else if ( mode === 1 ) {\n\t\t\t\tout.push( v );\n\t\t\t} else {\n\t\t\t\tout.push( i );\n\t\t\t}\n\t\t\tcount += 1;\n\t\t\tif ( count === k ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = find;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Find elements in an array-like object that satisfy a test condition.\n*\n* @module @stdlib/utils/find\n*\n* @example\n* var find = require( '@stdlib/utils/find' );\n*\n* var data = [ 30, 20, 50, 60, 10 ];\n*\n* function condition( val ) {\n* return val > 20;\n* }\n*\n* var vals = find( data, condition );\n* // returns [ 0, 2, 3 ]\n*\n* data = [ 30, 20, 50, 60, 10 ];\n* var opts = {\n* 'k': 2,\n* 'returns': 'values'\n* };\n* vals = find( data, opts, condition );\n* // returns [ 30, 50 ]\n*/\n\n// MODULES //\n\nvar find = require( './find.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// EXPORTS //\n\nmodule.exports = find;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar FLOAT64_MAX = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\nvar defaults = {\n\t'copy': false,\n\t'depth': FLOAT64_MAX\n};\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - depth to flatten\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy array elements\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'depth': 10,\n* 'copy': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'depth' ) ) {\n\t\topts.depth = options.depth;\n\t\tif ( !isNonNegativeInteger( opts.depth ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'depth', opts.depth ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\n\n\n// MAIN //\n\n/**\n* Recursively flattens an array.\n*\n* @private\n* @param {Array} out - output array\n* @param {ArrayLikeObject} arr - input array\n* @param {NonNegativeInteger} depth - recursion depth\n* @returns {Array} output array\n*/\nfunction recurse( out, arr, depth ) {\n\tvar v;\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( depth && isArrayLikeObject( v ) ) {\n\t\t\trecurse( out, v, depth-1 );\n\t\t} else {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = recurse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar copy = require( './../../copy' );\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar recurse = require( './recurse.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an array.\n*\n* @param {ArrayLikeObject} arr - input array\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements\n* @throws {TypeError} first argument must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} flattened array\n*\n* @example\n* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];\n*\n* var out = flattenArray( arr );\n* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n*/\nfunction flattenArray( arr, options ) {\n\tvar opts;\n\tvar err;\n\tvar out;\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\topts = {\n\t\t'copy': defaults.copy,\n\t\t'depth': defaults.depth\n\t};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.depth === 0 ) {\n\t\tout = arr;\n\t} else {\n\t\tout = recurse( [], arr, opts.depth );\n\t}\n\tif ( opts.copy ) {\n\t\treturn copy( out );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Fcn = require( '@stdlib/function/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array containing elements all having the same dimensions.\n*\n* @private\n* @param {PositiveIntegerArray} dims - dimensions\n* @returns {Function} flatten function\n*/\nfunction genFcn( dims ) {\n\tvar len;\n\tvar n;\n\tvar f;\n\tvar i;\n\n\t// Code generation. Start with the function definition:\n\tf = 'return function flattenArray(x){';\n\n\t// Create the function body...\n\tlen = dims.length;\n\tn = len - 1;\n\n\t// Create the variables...\n\tf += 'var o=[];var ';\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += 'i' + i;\n\t\tif ( i < n ) {\n\t\t\tf += ',';\n\t\t} else {\n\t\t\tf += ';';\n\t\t}\n\t}\n\t// Create the nested for loops...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += 'for(i' + i + '=0;i' + i + '<' + dims[ i ] + ';i' + i + '++){';\n\t}\n\t// Create the code which accesses the nested array values and pushes them onto the flattened array.\n\tf += 'o.push(x';\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += '[i' + i + ']';\n\t}\n\tf += ');';\n\n\t// Closing braces...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tf += '}';\n\t}\n\tf += 'return o;';\n\n\t// Close the function:\n\tf += '}';\n\n\t// Add a source directive for debugging:\n\tf += '//# sourceURL=flatten_array.gen_fcn.js';\n\n\t// Create the function in the global scope:\n\treturn ( new Fcn( f ) )();\n\n\t/*\n\t* e.g.,\n\t*\n\t* function flattenArray( x ) {\n\t* var o = [];\n\t* var i0, i1;\n\t* for ( i0 = 0; i0 < 2; i0++ ) {\n\t* for ( i1 = 0; i1 < 2; i1++ ) {\n\t* o.push( x[i0][i1] );\n\t* }\n\t* }\n\t* return o;\n\t* }\n\t*/\n}\n\n\n// EXPORTS //\n\nmodule.exports = genFcn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array.\n*\n* @private\n* @param {Function} flatten - flatten function\n* @returns {Function} wrapped flatten function\n*/\nfunction wrap( flatten ) {\n\treturn flattenArray;\n\n\t/**\n\t* Flattens an array.\n\t*\n\t* @private\n\t* @param {ArrayLikeObject} arr - array to flatten\n\t* @throws {TypeError} must provide an array-like object\n\t* @returns {Array} flattened array\n\t*/\n\tfunction flattenArray( arr ) {\n\t\tif ( !isArrayLikeObject( arr ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t\t}\n\t\treturn flatten( arr );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar format = require( '@stdlib/string/format' );\nvar copy = require( './../../copy' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an array and deep copy.\n*\n* @private\n* @param {Function} flatten - flatten function\n* @returns {Function} wrapped flatten function\n*/\nfunction wrap( flatten ) {\n\treturn flattenArray;\n\n\t/**\n\t* Flattens an array and deep copies array elements.\n\t*\n\t* @private\n\t* @param {ArrayLikeObject} arr - array to flatten\n\t* @throws {TypeError} must provide an array-like object\n\t* @returns {Array} flattened array\n\t*/\n\tfunction flattenArray( arr ) {\n\t\tif ( !isArrayLikeObject( arr ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );\n\t\t}\n\t\treturn copy( flatten( arr ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' ).primitives;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar genFcn = require( './gen_fcn.js' );\nvar wrapFlatten = require( './wrap_flatten.js' );\nvar wrapFlattenCopy = require( './wrap_flatten_copy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for flattening arrays having specified dimensions.\n*\n* @param {PositiveIntegerArray} dims - dimensions\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy array elements\n* @throws {TypeError} first argument must be an array of positive integers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} flatten function\n*\n* @example\n* var flatten = factory( [2,2], {\n* 'copy': false\n* });\n*\n* var out = flatten( [[1,2],[3,4]] );\n* // returns [ 1, 2, 3, 4 ]\n*\n* out = flatten( [[5,6],[7,8]] );\n* // returns [ 5, 6, 7, 8 ]\n*/\nfunction factory( dims, options ) {\n\tvar copyFLG;\n\tvar flatten;\n\tif ( !isPositiveIntegerArray( dims ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of positive integers. Value: `%s`.', dims ) );\n\t}\n\tcopyFLG = defaults.copy;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\tcopyFLG = options.copy;\n\t\t\tif ( !isBoolean( copyFLG ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', copyFLG ) );\n\t\t\t}\n\t\t}\n\t}\n\tflatten = genFcn( dims );\n\tif ( copyFLG ) {\n\t\treturn wrapFlattenCopy( flatten );\n\t}\n\treturn wrapFlatten( flatten );\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an array.\n*\n* @module @stdlib/utils/flatten-array\n*\n* @example\n* var flattenArray = require( '@stdlib/utils/flatten-array' );\n*\n* var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];\n*\n* var out = flattenArray( arr );\n* // returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n*\n* @example\n* var flattenArray = require( '@stdlib/utils/flatten-array' );\n*\n* var flatten = flattenArray.factory( [2,2], {\n* 'copy': false\n* });\n*\n* var out = flatten( [[1,2],[3,4]] );\n* // returns [ 1, 2, 3, 4 ]\n*\n* out = flatten( [[5,6],[7,8]] );\n* // returns [ 5, 6, 7, 8 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar FLOAT64_MAX = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'delimiter': '.',\n\t\t'depth': FLOAT64_MAX,\n\t\t'copy': false\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for function options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - depth to flatten\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter] - key path delimiter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'depth': 10,\n* 'copy': false,\n* 'delimiter': '|',\n* 'flattenArrays': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'depth' ) ) {\n\t\topts.depth = options.depth;\n\t\tif ( !isNonNegativeInteger( opts.depth ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'depth', opts.depth ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'flattenArrays' ) ) {\n\t\topts.flattenArrays = options.flattenArrays;\n\t\tif ( !isBoolean( opts.flattenArrays ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'flattenArrays', opts.flattenArrays ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'delimiter' ) ) {\n\t\topts.delimiter = options.delimiter;\n\t\tif ( !isString( opts.delimiter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'delimiter', opts.delimiter ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\n\n\n// MAIN //\n\n/**\n* Recursively flattens an object.\n*\n* @private\n* @param {Object} out - output object\n* @param {ObjectLike} obj - input object\n* @param {string} prefix - key prefix\n* @param {NonNegativeInteger} depth - recursion depth\n* @param {Options} opts - options\n* @param {boolean} opts.flattenArrays - boolean indicating whether to flatten arrays\n* @param {string} opts.delimiter - key path delimiter\n* @returns {Object} output object\n*/\nfunction recurse( out, obj, prefix, depth, opts ) {\n\tvar keys;\n\tvar val;\n\tvar key;\n\tvar i;\n\tif ( prefix ) {\n\t\tprefix += opts.delimiter;\n\t}\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tval = obj[ keys[i] ];\n\t\tkey = prefix + keys[ i ];\n\t\tif ( depth ) {\n\t\t\tif (\n\t\t\t\t(isPlainObject( val ) && objectKeys( val ).length) ||\n\t\t\t\t(opts.flattenArrays && isArray( val ))\n\t\t\t) {\n\t\t\t\trecurse( out, val, key, depth-1, opts );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tout[ key ] = val;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = recurse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar copy = require( './../../copy' );\nvar recurse = require( './recurse.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an object.\n*\n* @private\n* @param {ObjectLike} obj - object to flatten\n* @param {Object} opts - options\n* @param {NonNegativeInteger} opts.depth - maximum depth to flatten\n* @param {boolean} opts.copy - boolean indicating whether to deep copy\n* @param {boolean} opts.flattenArrays - boolean indicating whether to flatten arrays\n* @param {string} opts.delimiter - key path delimiter\n* @returns {Object} flattened object\n*/\nfunction flatten( obj, opts ) {\n\tvar out;\n\tif ( opts.depth === 0 ) {\n\t\tout = obj;\n\t} else {\n\t\tout = recurse( {}, obj, '', opts.depth, opts );\n\t}\n\tif ( opts.copy ) {\n\t\treturn copy( out );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar flatten = require( './flatten.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an object.\n*\n* @param {ObjectLike} obj - object to flatten\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays=false] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter='.'] - key path delimiter\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ObjectLike} flattened object\n*\n* @example\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flattenObject( obj );\n* // returns {'a.b.c':'d'}\n*/\nfunction flattenObject( obj, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\treturn flatten( obj, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flattenObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar flatten = require( './flatten.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to flatten an object.\n*\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.depth] - maximum depth to flatten\n* @param {boolean} [options.copy=false] - boolean indicating whether to deep copy\n* @param {boolean} [options.flattenArrays=false] - boolean indicating whether to flatten arrays\n* @param {string} [options.delimiter='.'] - key path delimiter\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} flatten function\n*\n* @example\n* var flatten = factory({\n* 'copy': true,\n* 'delimiter': '|'\n* });\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n* var out = flatten( obj );\n* // throws \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar err;\n\n\topts = defaults();\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\treturn flattenObject;\n\n\t/**\n\t* Flattens an object.\n\t*\n\t* @private\n\t* @param {ObjectLike} obj - object to flatten\n\t* @throws {TypeError} first argument must be object-like\n\t* @returns {Object} flattened object\n\t*/\n\tfunction flattenObject( obj ) {\n\t\tif ( !isObjectLike( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t\t}\n\t\treturn flatten( obj, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an object.\n*\n* @module @stdlib/utils/flatten-object\n*\n* @example\n* var flattenObject = require( '@stdlib/utils/flatten-object' );\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flattenObject( obj );\n* // returns {'a.b.c':'d'}\n*\n* @example\n* var flattenObject = require( '@stdlib/utils/flatten-object' );\n*\n* var flatten = flattenObject.factory({\n* 'depth': 2,\n* 'copy': true,\n* 'delimiter': '|'\n* });\n*\n* var obj = {'a':{'b':{'c':'d'}}};\n*\n* var out = flatten( obj );\n* // returns {'a|b':{'c':'d'}}\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEach( arr, log );\n*/\nfunction forEach( collection, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/for-each\n*\n* @example\n* var forEach = require( '@stdlib/utils/for-each' );\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEach( arr, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `forEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `forEach()`, `[].push()` behavior is consistent with `forEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEachRight( arr, log );\n*/\nfunction forEachRight( collection, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/for-each-right\n*\n* @example\n* var forEachRight = require( '@stdlib/utils/for-each-right' );\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* forEachRight( arr, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own and inherited enumerable property of an object.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n*\n* @param {Object} obj - input object\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} obj - input object\n*\n* @example\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* function Foo() {\n* this.a = 1;\n* this.b = 2;\n* return this;\n* }\n*\n* Foo.prototype.c = 3;\n* Foo.prototype.d = 4;\n*\n* var obj = new Foo();\n*\n* forIn( obj, log );\n*/\nfunction forIn( obj, fcn, thisArg ) {\n\tvar bool;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tbool = fcn.call( thisArg, obj[ key ], key, obj );\n\t\tif ( bool === false ) {\n\t\t\treturn obj;\n\t\t}\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each own and inherited enumerable property of an object.\n*\n* @module @stdlib/utils/for-in\n*\n* @example\n* var forIn = require( '@stdlib/utils/for-in' );\n*\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* function Foo() {\n* this.a = 1;\n* this.b = 2;\n* return this;\n* }\n*\n* Foo.prototype.c = 3;\n* Foo.prototype.d = 4;\n*\n* var obj = new Foo();\n*\n* forIn( obj, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each own enumerable property of an object.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n*\n* @param {Object} obj - input object\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} obj - input object\n*\n* @example\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3,\n* 'd': 4\n* };\n*\n* forOwn( obj, log );\n*/\nfunction forOwn( obj, fcn, thisArg ) {\n\tvar keys;\n\tvar bool;\n\tvar len;\n\tvar k;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tk = keys[ i ];\n\t\tbool = fcn.call( thisArg, obj[ k ], k, obj );\n\t\tif ( bool === false ) {\n\t\t\treturn obj;\n\t\t}\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = forOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each own enumerable property of an object.\n*\n* @module @stdlib/utils/for-own\n*\n* @example\n* var forOwn = require( '@stdlib/utils/for-own' );\n*\n* function log( v, key ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var obj = {\n* 'a': 1,\n* 'b': 2,\n* 'c': 3,\n* 'd': 4\n* };\n*\n* forOwn( obj, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayArray = require( '@stdlib/assert/is-array-array' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Creates an object from an array of key-value pairs.\n*\n* @param {ArrayArray} entries - input object\n* @throws {TypeError} must provide an array of arrays\n* @returns {Object} object created from `[key, value]` pairs\n*\n* @example\n* var entries = [ ['beep', 'boop'], ['foo', 'bar'] ];\n*\n* var obj = objectFromEntries( entries );\n* // returns {'beep': 'boop', 'foo': 'bar'}\n*/\nfunction objectFromEntries( entries ) {\n\tvar out;\n\tvar i;\n\tif ( !isArrayArray( entries ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array of arrays. Value: `%s`.', entries ) );\n\t}\n\tout = {};\n\tfor ( i = 0; i < entries.length; i++ ) {\n\t\tout[ entries[i][0] ] = entries[ i ][ 1 ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectFromEntries;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an object from key-value pairs.\n*\n* @module @stdlib/utils/from-entries\n*\n* @example\n* var objectFromEntries = require( '@stdlib/utils/from-entries' );\n*\n* var entries = [ ['beep', 'boop'], ['foo', 'bar'] ];\n*\n* var obj = objectFromEntries( entries );\n* // returns {'beep': 'boop', 'foo': 'bar'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );\nvar format = require( '@stdlib/string/format' );\nvar RE = require( '@stdlib/regexp/function-name' ).REGEXP;\n\n\n// VARIABLES //\n\nvar isFunctionNameSupported = hasFunctionNameSupport();\n\n\n// MAIN //\n\n/**\n* Returns the name of a function.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} function name\n*\n* @example\n* var v = functionName( Math.sqrt );\n* // returns 'sqrt'\n*\n* @example\n* var v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* @example\n* var v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*\n* @example\n* var v = functionName( String );\n* // returns 'String'\n*/\nfunction functionName( fcn ) {\n\t// TODO: add support for generator functions?\n\tif ( isFunction( fcn ) === false ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isFunctionNameSupported ) {\n\t\treturn fcn.name;\n\t}\n\treturn RE.exec( fcn.toString() )[ 1 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = functionName;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the name of a function.\n*\n* @module @stdlib/utils/function-name\n*\n* @example\n* var functionName = require( '@stdlib/utils/function-name' );\n*\n* var v = functionName( String );\n* // returns 'String'\n*\n* v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Function sequence.\n*\n* @param {...Function} f - functions to evaluate in sequential order\n* @throws {Error} must provide more than one argument\n* @throws {TypeError} must provide functions\n* @returns {Function} pipeline function\n*\n* @example\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = funseq( a, b, c );\n*\n* var z = f( 6 );\n* // returns 3\n*/\nfunction funseq() {\n\tvar nFuncs;\n\tvar f;\n\tvar i;\n\tnFuncs = arguments.length;\n\tif ( nFuncs < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' );\n\t}\n\tf = new Array( nFuncs );\n\tfor ( i = 0; i < nFuncs; i++ ) {\n\t\tf[ i ] = arguments[ i ];\n\t\tif ( !isFunction( f[ i ] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );\n\t\t}\n\t}\n\treturn pipeline;\n\n\t/**\n\t* Pipeline function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} result\n\t*/\n\tfunction pipeline() {\n\t\tvar args;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < args.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\targs = f[ 0 ].apply( null, args );\n\t\tfor ( i = 1; i < nFuncs; i++ ) {\n\t\t\targs = f[ i ]( args );\n\t\t}\n\t\treturn args;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = funseq;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Function sequence.\n*\n* @module @stdlib/utils/function-sequence\n*\n* @example\n* var funseq = require( '@stdlib/utils/function-sequence' );\n*\n* function a( x ) {\n* return 2 * x;\n* }\n*\n* function b( x ) {\n* return x + 3;\n* }\n*\n* function c( x ) {\n* return x / 5;\n* }\n*\n* var f = funseq( a, b, c );\n*\n* var z = f( 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar returnValues = require( '@stdlib/array/base/group-values' );\nvar returnIndices = require( '@stdlib/array/base/group-indices' );\nvar returnPairs = require( '@stdlib/array/base/group-entries' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Groups values as arrays associated with distinct keys.\n*\n* @param {Collection} collection - collection to group\n* @param {Options} [options] - function options\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Collection} groups - collection defining which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a collection\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} first and last arguments must be the same length\n* @returns {Object} group results\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var out = group( arr, groups );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction group( collection, options, groups ) {\n\tvar opts;\n\tvar err;\n\tvar g;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tg = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tg = groups;\n\t}\n\tif ( !isCollection( g ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a collection. Value: `%s`.', g ) );\n\t}\n\tif ( collection.length !== g.length ) {\n\t\tthrow new RangeError( 'invalid arguments. First and last arguments must be the same length.' );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, g );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, g );\n\t}\n\treturn returnPairs( collection, g );\n}\n\n\n// EXPORTS //\n\nmodule.exports = group;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values as arrays associated with distinct keys.\n*\n* @module @stdlib/utils/group\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var out = group( arr, groups );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var group = require( '@stdlib/utils/group' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n* var groups = [ 'b', 'b', 'f', 'b' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n*\n* var out = group( arr, opts, groups );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tg = indicator.call( thisArg, v, i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( v );\n\t\t} else {\n\t\t\tout[ g ] = [ v ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results according to element indices.\n*\n* ## Notes\n*\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tg = indicator.call( thisArg, collection[ i ], i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( i );\n\t\t} else {\n\t\t\tout[ g ] = [ i ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as index-element values.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - collection to group\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, {}, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction groupBy( collection, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar len;\n\tvar g;\n\tvar v;\n\tvar i;\n\n\tthisArg = opts.thisArg;\n\tlen = collection.length;\n\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tg = indicator.call( thisArg, v, i );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( [ i, v ] );\n\t\t} else {\n\t\t\tout[ g ] = [ [ i, v ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnIndices = require( './return_indices.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function.\n*\n* @param {Collection} collection - collection to group\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\nfunction groupBy( collection, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( collection, opts, cb );\n\t}\n\tif ( opts.returns === 'indices' ) {\n\t\treturn returnIndices( collection, opts, cb );\n\t}\n\treturn returnPairs( collection, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function.\n*\n* @module @stdlib/utils/group-by\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var out = groupBy( arr, indicator );\n* // returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': 'indices'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n*\n* @example\n* var groupBy = require( '@stdlib/utils/group-by' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var arr = [ 'beep', 'boop', 'foo', 'bar' ];\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupBy( arr, opts, indicator );\n* // returns { 'b': [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], 'f': [ [ 2, 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tv = obj[ key ];\n\t\tg = indicator.call( thisArg, v, key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( v );\n\t\t} else {\n\t\t\tout[ g ] = [ v ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tg = indicator.call( thisArg, obj[ key ], key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( key);\n\t\t} else {\n\t\t\tout[ g ] = [ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, {}, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupIn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tv = obj[ key ];\n\t\tg = indicator.call( thisArg, v, key );\n\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\tout[ g ].push( [ key, v ] );\n\t\t} else {\n\t\t\tout[ g ] = [ [ key, v ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups an object's own and inherited property values according to an indicator function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupIn( obj, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group an object's own and inherited property values according to an indicator function.\n*\n* @module @stdlib/utils/group-in\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var out = groupIn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* var groupIn = require( '@stdlib/utils/group-in' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n*\n* function Foo() {\n* this.a = 'beep';\n* this.b = 'boop';\n* return this;\n* }\n*\n* Foo.prototype = Object.create( null );\n* Foo.prototype.c = 'foo';\n* Foo.prototype.d = 'bar';\n*\n* var obj = new Foo();\n*\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupIn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'keys', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'returns': '*',\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as object values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tg = indicator.call( thisArg, v, key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ v ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as keys.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function specifying which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tg = indicator.call( thisArg, obj[ key ], key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( key);\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function and outputs results as key-value values.\n*\n* ## Notes\n*\n* - We need to cache the object value to prevent the edge case where, during the invocation of the indicator function, the value at key `k` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @private\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @returns {Object} results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, {}, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupOwn( obj, opts, indicator ) {\n\tvar thisArg;\n\tvar out;\n\tvar key;\n\tvar v;\n\tvar g;\n\n\tthisArg = opts.thisArg;\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tg = indicator.call( thisArg, v, key );\n\t\t\tif ( hasOwnProp( out, g ) ) {\n\t\t\t\tout[ g ].push( [ key, v ] );\n\t\t\t} else {\n\t\t\t\tout[ g ] = [ [ key, v ] ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar returnValues = require( './return_values.js' );\nvar returnKeys = require( './return_keys.js' );\nvar returnPairs = require( './return_pairs.js' );\n\n\n// MAIN //\n\n/**\n* Groups an object's own property values according to an indicator function.\n*\n* @param {(Object|Array|TypedArray)} obj - input object\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `keys`, keys are returned; if `*`, both keys and values are returned\n* @param {Function} indicator - indicator function indicating which group an element in the input object belongs to\n* @throws {TypeError} first argument must be an object, array, or typed array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} group results\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var out = groupOwn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\nfunction groupOwn( obj, options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar cb;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\topts = {\n\t\t'returns': 'values'\n\t};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tif ( opts.returns === 'values' ) {\n\t\treturn returnValues( obj, opts, cb );\n\t}\n\tif ( opts.returns === 'keys' ) {\n\t\treturn returnKeys( obj, opts, cb );\n\t}\n\treturn returnPairs( obj, opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupOwn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group an object's own property values according to an indicator function.\n*\n* @module @stdlib/utils/group-own\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var out = groupOwn( obj, indicator );\n* // e.g., returns { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n*\n* var opts = {\n* 'returns': 'keys'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ 'a', 'b', 'd' ], 'f': [ 'c' ] }\n*\n* @example\n* var groupOwn = require( '@stdlib/utils/group-own' );\n*\n* function indicator( v ) {\n* return v[ 0 ];\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop',\n* 'c': 'foo',\n* 'd': 'bar'\n* };\n* var opts = {\n* 'returns': '*'\n* };\n* var out = groupOwn( obj, opts, indicator );\n* // e.g., returns { 'b': [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], 'f': [ [ 'c', 'foo' ] ] }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Identity function.\n*\n* @param {*} x - input value\n* @returns {*} input value\n*\n* @example\n* var v = identity( 3.14 );\n* // returns 3.14\n*/\nfunction identity( x ) {\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = identity;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Identity function.\n*\n* @module @stdlib/utils/identity-function\n*\n* @example\n* var identity = require( '@stdlib/utils/identity-function' );\n*\n* var input = [];\n* var output = identity( input );\n*\n* var bool = ( input === output );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, returns `x`; otherwise, returns `y`.\n*\n* @param {boolean} bool - condition\n* @param {*} x - value to return if a condition is truthy\n* @param {*} y - value to return if a condition is falsy\n* @returns {*} either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var z = ifelse( randu() > 0.5, 1.0, -1.0 );\n* // returns \n*/\nfunction ifelse( bool, x, y ) {\n\tif ( bool ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifelse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, return `x`; otherwise, return `y`.\n*\n* @module @stdlib/utils/if-else\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifelse = require( '@stdlib/utils/if-else' );\n*\n* var z = ifelse( randu() > 0.5, 1.0, -1.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a condition is truthy, invokes `x`; otherwise, invokes `y`.\n*\n* @param {boolean} bool - condition\n* @param {Function} x - function to invoke if a condition is truthy\n* @param {Function} y - function to invoke if a condition is falsy\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {*} return value of either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* return randu() * 100.0;\n* }\n*\n* function y() {\n* return -1.0 * randu() * 100.0;\n* }\n*\n* var z = ifthen( randu() > 0.5, x, y );\n* // returns \n*/\nfunction ifthen( bool, x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', y ) );\n\t}\n\tif ( bool ) {\n\t\treturn x();\n\t}\n\treturn y();\n}\n\n\n// EXPORTS //\n\nmodule.exports = ifthen;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a condition is truthy, invoke `x`; otherwise, invoke `y`.\n*\n* @module @stdlib/utils/if-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var ifthen = require( '@stdlib/utils/if-then' );\n*\n* function x() {\n* return randu() * 100.0;\n* }\n*\n* function y() {\n* return -1.0 * randu() * 100.0;\n* }\n*\n* var z = ifthen( randu() > 0.5, x, y );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests that a value is a valid constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var ctor = function ctor() {};\n*\n* var err = validate( ctor );\n* // returns null\n*\n* err = validate( null );\n* // returns \n*/\nfunction validate( value ) {\n\tvar type = typeof value;\n\tif (\n\t\tvalue === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\treturn new TypeError( format( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.', value ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nmodule.exports = Object.create;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Ctor() {\n\t// Empty...\n}\n\n\n// MAIN //\n\n/**\n* An `Object.create` shim for older JavaScript engines.\n*\n* @private\n* @param {Object} proto - prototype\n* @returns {Object} created object\n*\n* @example\n* var obj = createObject( Object.prototype );\n* // returns {}\n*/\nfunction createObject( proto ) {\n\tCtor.prototype = proto;\n\treturn new Ctor();\n}\n\n\n// EXPORTS //\n\nmodule.exports = createObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar builtin = require( './native.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar createObject;\nif ( typeof builtin === 'function' ) {\n\tcreateObject = builtin;\n} else {\n\tcreateObject = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createObject;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar createObject = require( './detect.js' );\n\n\n// MAIN //\n\n/**\n* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.\n*\n* ## Notes\n*\n* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.\n* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).\n*\n* @param {(Object|Function)} ctor - constructor which will inherit\n* @param {(Object|Function)} superCtor - super (parent) constructor\n* @throws {TypeError} first argument must be either an object or a function which can inherit\n* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit\n* @throws {TypeError} second argument must have an inheritable prototype\n* @returns {(Object|Function)} child constructor\n*\n* @example\n* function Foo() {\n* return this;\n* }\n* Foo.prototype.beep = function beep() {\n* return 'boop';\n* };\n*\n* function Bar() {\n* Foo.call( this );\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n* var v = bar.beep();\n* // returns 'boop'\n*/\nfunction inherit( ctor, superCtor ) {\n\tvar err = validate( ctor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\terr = validate( superCtor );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( typeof superCtor.prototype === 'undefined' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.', superCtor.prototype ) );\n\t}\n\t// Create a prototype which inherits from the parent prototype:\n\tctor.prototype = createObject( superCtor.prototype );\n\n\t// Set the constructor to refer to the child constructor:\n\tdefineProperty( ctor.prototype, 'constructor', {\n\t\t'configurable': true,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': ctor\n\t});\n\n\treturn ctor;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inherit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.\n*\n* @module @stdlib/utils/inherit\n*\n* @example\n* var inherit = require( '@stdlib/utils/inherit' );\n*\n* function Foo() {\n* return this;\n* }\n* Foo.prototype.beep = function beep() {\n* return 'boop';\n* };\n*\n* function Bar() {\n* Foo.call( this );\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n* var v = bar.beep();\n* // returns 'boop'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable property names and symbols\n*\n* @example\n* var props = inheritedEnumerableProperties( {} );\n*/\nfunction inheritedEnumerableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable property names and symbols.\n*\n* @module @stdlib/utils/inherited-enumerable-properties\n*\n* @example\n* var inheritedEnumerableProperties = require( '@stdlib/utils/inherited-enumerable-properties' );\n*\n* var props = inheritedEnumerableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable symbol properties\n*\n* @example\n* var symbols = inheritedEnumerablePropertySymbols( [] );\n*/\nfunction inheritedEnumerablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable symbol properties.\n*\n* @module @stdlib/utils/inherited-enumerable-property-symbols\n*\n* @example\n* var inheritedEnumerablePropertySymbols = require( '@stdlib/utils/inherited-enumerable-property-symbols' );\n*\n* var symbols = inheritedEnumerablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isEnumerable = require( '@stdlib/assert/is-enumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable property names\n*\n* @example\n* var keys = inheritedKeys( {} );\n*/\nfunction inheritedKeys( value, level ) {\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting enumerable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable property names.\n*\n* @module @stdlib/utils/inherited-keys\n*\n* @example\n* var inheritedKeys = require( '@stdlib/utils/inherited-keys' );\n*\n* var keys = inheritedKeys( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable property names and symbols\n*\n* @example\n* var props = inheritedNonEnumerableProperties( {} );\n*/\nfunction inheritedNonEnumerableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/inherited-nonenumerable-properties\n*\n* @example\n* var inheritedNonEnumerableProperties = require( '@stdlib/utils/inherited-nonenumerable-properties' );\n*\n* var props = inheritedNonEnumerableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable property names\n*\n* @example\n* var keys = inheritedNonEnumerablePropertyNames( {} );\n*/\nfunction inheritedNonEnumerablePropertyNames( value, level ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable property names.\n*\n* @module @stdlib/utils/inherited-nonenumerable-property-names\n*\n* @example\n* var inheritedNonEnumerablePropertyNames = require( '@stdlib/utils/inherited-nonenumerable-property-names' );\n*\n* var keys = inheritedNonEnumerablePropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited non-enumerable symbol properties\n*\n* @example\n* var symbols = inheritedNonEnumerablePropertySymbols( [] );\n*/\nfunction inheritedNonEnumerablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting non-enumerable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedNonEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited non-enumerable symbol properties.\n*\n* @module @stdlib/utils/inherited-nonenumerable-property-symbols\n*\n* @example\n* var inheritedNonEnumerablePropertySymbols = require( '@stdlib/utils/inherited-nonenumerable-property-symbols' );\n*\n* var symbols = inheritedNonEnumerablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertySymbols = require( './../../property-symbols' );\nvar propertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited property names and symbols\n*\n* @example\n* var props = inheritedProperties( [] );\n* // returns [...]\n*/\nfunction inheritedProperties( value, level ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all properties...\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\ttmp = propertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited property names and symbols.\n*\n* @module @stdlib/utils/inherited-properties\n*\n* @example\n* var inheritedProperties = require( '@stdlib/utils/inherited-properties' );\n*\n* var props = inheritedProperties( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's inherited property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have an inherited provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} third argument must be a positive integer\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var desc = inheritedPropertyDescriptor( {}, 'toString' );\n* // returns {...}\n*/\nfunction inheritedPropertyDescriptor( value, property, level ) { // eslint-disable-line id-length\n\tvar desc;\n\tvar obj;\n\tvar N;\n\tvar n;\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain in search of a specified property...\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\tdesc = getOwnPropertyDescriptor( obj, property );\n\t\tif ( desc ) {\n\t\t\treturn desc;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyDescriptor;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's inherited property.\n*\n* @module @stdlib/utils/inherited-property-descriptor\n*\n* @example\n* var inheritedPropertyDescriptor = require( '@stdlib/utils/inherited-property-descriptor' );\n*\n* var desc = inheritedPropertyDescriptor( {}, 'toString' );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.getOwnPropertyDescriptors !== 'undefined' ); // eslint-disable-line node/no-unsupported-features/es-builtins\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// VARIABLES //\n\nvar propertyDescriptors = Object.getOwnPropertyDescriptors; // eslint-disable-line node/no-unsupported-features/es-builtins\n\n\n// MAIN //\n\n/**\n* Returns an object's own property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Object} property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptors( obj );\n* // returns {...}\n*/\nfunction getOwnPropertyDescriptors( value ) {\n\treturn propertyDescriptors( Object( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar propertyDescriptor = require( './../../property-descriptor' );\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Returns an object's own property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Object} property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = getOwnPropertyDescriptors( obj, 'foo' );\n* // returns {...}\n*/\nfunction getOwnPropertyDescriptors( value ) {\n\tvar symbols;\n\tvar names;\n\tvar desc;\n\tvar out;\n\tvar i;\n\n\tout = {};\n\n\t// Get the value's own enumerable and non-enumerable properties:\n\tnames = propertyNames( value );\n\n\t// For each property name, retrieve the property descriptor...\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tdesc = propertyDescriptor( value, names[ i ] );\n\t\tif ( desc ) {\n\t\t\t// The following is equivalent to `out[ names[i] ] = desc`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\tdefineProperty( out, names[ i ], {\n\t\t\t\t'configurable': true,\n\t\t\t\t'enumerable': true,\n\t\t\t\t'writable': true,\n\t\t\t\t'value': desc\n\t\t\t});\n\t\t}\n\t}\n\n\t// Get the value's symbol properties:\n\tsymbols = propertySymbols( value );\n\n\t// For each symbol property, retrieve the property descriptor...\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tdesc = propertyDescriptor( value, symbols[ i ] );\n\t\tif ( desc ) {\n\t\t\t// The following is equivalent to `out[ symbols[i] ] = desc`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\tdefineProperty( out, symbols[ i ], {\n\t\t\t\t'configurable': true,\n\t\t\t\t'enumerable': true,\n\t\t\t\t'writable': true,\n\t\t\t\t'value': desc\n\t\t\t});\n\t\t}\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOwnPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's own property descriptors.\n*\n* @module @stdlib/utils/property-descriptors\n*\n* @example\n* var getOwnPropertyDescriptors = require( '@stdlib/utils/property-descriptors' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var keys = getOwnPropertyDescriptors( obj, 'foo' );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar HAS_BUILTIN = require( './has_builtin.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( HAS_BUILTIN ) {\n\tmain = builtin;\n} else {\n\tmain = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar getOwnPropertyDescriptors = require( './../../property-descriptors' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an object's inherited property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Object} inherited property descriptors\n*\n* @example\n* var desc = inheritedPropertyDescriptors( [] );\n* // returns {...}\n*/\nfunction inheritedPropertyDescriptors( value, level ) { // eslint-disable-line id-length\n\tvar desc;\n\tvar keys;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn {};\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all property descriptors...\n\tdesc = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyDescriptors( obj );\n\t\tkeys = objectKeys( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a property name always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tkeys = getOwnPropertySymbols( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a symbol property always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\treturn desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyDescriptors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's inherited property descriptors.\n*\n* @module @stdlib/utils/inherited-property-descriptors\n*\n* @example\n* var inheritedPropertyDescriptors = require( '@stdlib/utils/inherited-property-descriptors' );\n*\n* var desc = inheritedPropertyDescriptors( [] );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited enumerable and non-enumerable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited enumerable and non-enumerable property names\n*\n* @example\n* var keys = inheritedPropertyNames( [] );\n*/\nfunction inheritedPropertyNames( value, level ) {\n\tvar names;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all enumerable and non-enumerable property names...\n\tnames = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( names, tmp[ i ] ) === false ) {\n\t\t\t\tnames.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/inherited-property-names\n*\n* @example\n* var inheritedPropertyNames = require( '@stdlib/utils/inherited-property-names' );\n*\n* var keys = inheritedPropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar propertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited symbol properties\n*\n* @example\n* var symbols = inheritedPropertySymbols( [] );\n*/\nfunction inheritedPropertySymbols( value, level ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting all symbol properties...\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = propertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedPropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited symbol properties.\n*\n* @module @stdlib/utils/inherited-property-symbols\n*\n* @example\n* var inheritedPropertySymbols = require( '@stdlib/utils/inherited-property-symbols' );\n*\n* var symbols = inheritedPropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable property names and symbols.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable property names and symbols\n*\n* @example\n* var props = inheritedWritableProperties( {} );\n*/\nfunction inheritedWritableProperties( value, level ) { // eslint-disable-line id-length\n\tvar props;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable properties...\n\tprops = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tprops.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn props;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable property names and symbols.\n*\n* @module @stdlib/utils/inherited-writable-properties\n*\n* @example\n* var inheritedWritableProperties = require( '@stdlib/utils/inherited-writable-properties' );\n*\n* var props = inheritedWritableProperties( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable property names.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable property names\n*\n* @example\n* var keys = inheritedWritablePropertyNames( {} );\n*/\nfunction inheritedWritablePropertyNames( value, level ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable property names...\n\tnames = [];\n\tcache = {};\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable property names.\n*\n* @module @stdlib/utils/inherited-writable-property-names\n*\n* @example\n* var inheritedWritablePropertyNames = require( '@stdlib/utils/inherited-writable-property-names' );\n*\n* var keys = inheritedWritablePropertyNames( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's inherited writable symbol properties.\n*\n* @param {*} value - input object\n* @param {PositiveInteger} [level] - inheritance level\n* @throws {TypeError} second argument must be a positive integer\n* @returns {Array} a list of inherited writable symbol properties\n*\n* @example\n* var symbols = inheritedWritablePropertySymbols( [] );\n*/\nfunction inheritedWritablePropertySymbols( value, level ) { // eslint-disable-line id-length\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar N;\n\tvar n;\n\tvar k;\n\tvar i;\n\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isPositiveInteger( level ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', level ) );\n\t\t}\n\t\tN = level;\n\t} else {\n\t\tN = MAX_SAFE_INTEGER;\n\t}\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Get the value's prototype:\n\tobj = getPrototypeOf( value );\n\n\t// Walk the prototype chain collecting writable symbol properties...\n\tcache = {};\n\tout = [];\n\tn = 1;\n\twhile ( obj && n <= N ) {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t\tn += 1;\n\t}\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inheritedWritablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's inherited writable symbol properties.\n*\n* @module @stdlib/utils/inherited-writable-property-symbols\n*\n* @example\n* var inheritedWritablePropertySymbols = require( '@stdlib/utils/inherited-writable-property-symbols' );\n*\n* var symbols = inheritedWritablePropertySymbols( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates the collection in-place.\n*\n* ## Notes\n*\n* - The invoked function's return value is cached prior to updating a collection. Before updating the collection, a collection must be inspected to ensure that a collection has not been resized during invocation such that an index no longer has a corresponding element in the collection. Were a return value automatically used to update a collection, an input collection could be converted into a sparse data structure. While some might consider this a feature, here, we take stance that a user should be less clever.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function scale( value, index, collection ) {\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmap( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\nfunction inmap( collection, fcn, thisArg ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = fcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\tlen = collection.length;\n\t\t}\n\t\tif ( i < len ) {\n\t\t\tcollection[ i ] = v;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update the collection in-place.\n*\n* @module @stdlib/utils/inmap\n*\n* @example\n* var inmap = require( '@stdlib/utils/inmap' );\n*\n* function scale( value, index, collection ) {\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmap( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function once for each element in a collection and updates the collection in-place, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `inmap` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `inmap()`, `[].push()` behavior is consistent with `inmapRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function scale( value, index, collection ) {\n* console.log( '%s: %d', index, value );\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmapRight( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\nfunction inmapRight( collection, fcn, thisArg ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tv = fcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\tif ( i >= 0 && i < len ) {\n\t\t\tcollection[ i ] = v;\n\t\t}\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = inmapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function once for each element in a collection and update the collection in-place, iterating from right to left.\n*\n* @module @stdlib/utils/inmap-right\n*\n* @example\n* var inmapRight = require( '@stdlib/utils/inmap-right' );\n*\n* function scale( value, index, collection ) {\n* console.log( '%s: %d', index, value );\n* return value * index;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = inmapRight( arr, scale );\n* // returns [ 0, 2, 6, 12 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts a collection to an object whose keys are determined by a provided function and whose values are the collection values.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} output object\n*\n* @example\n* function toKey( value, index ) {\n* console.log( '%d: %s', index, JSON.stringify( value ) );\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyBy( collection, toKey );\n* // returns { 'beep': { 'name': 'beep', 'a': 1 }, 'boop': { 'name': 'boop', 'b': 2 } }\n*/\nfunction keyBy( collection, fcn, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar key;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = 0; i < len; i++ ) {\n\t\tkey = fcn.call( thisArg, collection[ i ], i );\n\t\tout[ key ] = collection[ i ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keyBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a collection to an object whose keys are determined by a provided function and whose values are the collection values.\n*\n* @module @stdlib/utils/key-by\n*\n* @example\n* var keyBy = require( '@stdlib/utils/key-by' );\n*\n* function toKey( value ) {\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyBy( collection, toKey );\n* // returns { 'beep': { 'name': 'beep', 'a': 1 }, 'boop': { 'name': 'boop', 'b': 2 } }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts a collection to an object whose keys are determined by a provided function and whose values are the collection values, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} output object\n*\n* @example\n* function toKey( value, index ) {\n* console.log( '%d: %s', index, JSON.stringify( value ) );\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyByRight( collection, toKey );\n* // returns { 'boop': { 'name': 'boop', 'b': 2 }, 'beep': { 'name': 'beep', 'a': 1 } }\n*/\nfunction keyByRight( collection, fcn, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar key;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\tout = {};\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tkey = fcn.call( thisArg, collection[ i ], i );\n\t\tout[ key ] = collection[ i ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = keyByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a collection to an object whose keys are determined by a provided function and whose values are the collection values, iterating from right to left.\n*\n* @module @stdlib/utils/key-by-right\n*\n* @example\n* var keyByRight = require( '@stdlib/utils/key-by-right' );\n*\n* function toKey( value ) {\n* return value.name;\n* }\n*\n* var collection = [\n* { 'name': 'beep', 'a': 1 },\n* { 'name': 'boop', 'b': 2 }\n* ];\n*\n* var obj = keyByRight( collection, toKey );\n* // returns { 'boop': { 'name': 'boop', 'b': 2 }, 'beep': { 'name': 'beep', 'a': 1 } }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* List node constructor.\n*\n* @private\n* @constructor\n* @param {*} value - node value\n* @returns {Node} Node instance\n*\n* @example\n* var node = new Node( 'foo' );\n* // returns \n*/\nfunction Node( value ) { // eslint-disable-line stdlib/no-redeclare\n\t// Why a getter? Because some of the list APIs will return the list \"node\", not the value. In which case, the node API is no longer private and we have to guard against users mucking about (deleting, updating, etc) with property values (in particular, the `next` property).\n\tdefineProperty( this, 'next', {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': function get() { // eslint-disable-line no-restricted-syntax\n\t\t\treturn this._next;\n\t\t}\n\t});\n\tthis.value = value;\n\n\tdefineProperty( this, '_next', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\t// NOTE: strictly speaking, we should not be keeping back-references in a singly-linked list; however, doing so allows us to more efficiently add, remove, and insert list values.\n\tdefineProperty( this, '_prev', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': true,\n\t\t'value': null\n\t});\n\n\treturn this;\n}\n\n\n// EXPORTS //\n\nmodule.exports = Node;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar Node = require( './node.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Linked list constructor.\n*\n* @constructor\n* @returns {LinkedList} linked list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'foo'\n*/\nfunction LinkedList() {\n\tif ( !(this instanceof LinkedList) ) {\n\t\treturn new LinkedList();\n\t}\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n}\n\n/**\n* Clears the list.\n*\n* @name clear\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*\n* // Examine the list length:\n* var len = list.length;\n* // returns 2\n*\n* // Clear all list items:\n* list.clear();\n*\n* // Peek at the first value:\n* v = list.first();\n* // returns undefined\n*\n* // Examine the list length:\n* len = list.length;\n* // returns 0\n*/\nsetReadOnly( LinkedList.prototype, 'clear', function clear() {\n\tthis._length = 0;\n\tthis._first = null;\n\tthis._last = null;\n\treturn this;\n});\n\n/**\n* Returns the first list node.\n*\n* @name first\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the first value:\n* var v = list.first().value;\n* // returns 'foo'\n*/\nsetReadOnly( LinkedList.prototype, 'first', function first() {\n\tif ( this._length ) {\n\t\treturn this._first;\n\t}\n});\n\n/**\n* Inserts a value into the list **after** a provided list node.\n*\n* @name insert\n* @memberof LinkedList.prototype\n* @type {Function}\n* @param {Node} node - node after which to insert the value\n* @param {*} value - value to insert\n* @throws {Error} must provide a node belonging to the list\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Insert a value after the second node:\n* list.insert( node, 'boop' );\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 4\n*/\nsetReadOnly( LinkedList.prototype, 'insert', function insert( node, value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar n;\n\n\t// Case: last node (equivalent to `push()`)\n\tif ( node === this._last ) {\n\t\treturn this.push( value );\n\t}\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously increment the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Create a new list node:\n\tn = new Node( value );\n\n\t// Update pointers:\n\tnode._next._prev = n;\n\tn._next = node._next;\n\n\tnode._next = n;\n\tn._prev = node;\n\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an iterator for iterating over a list.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from list mutation during iteration, a returned iterator **always** iterates over a list \"snapshot\", which is defined as the list of elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = list.iterator();\n*\n* // Iterate over the list...\n* var v = it.next().value;\n* // returns 'foo'\n*\n* v = it.next().value;\n* // returns 'bar'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( LinkedList.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = -1;\n\n\t// Create a copy of list values (necessary in order to \"snapshot\" the list; otherwise, values could come and go between calls to `next`):\n\tvalues = this.toArray();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= values.length ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the last node.\n*\n* @name last\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(Node|void)} list node\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the last value:\n* var v = list.last().value;\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'last', function last() {\n\tif ( this._length ) {\n\t\treturn this._last;\n\t}\n});\n\n/**\n* List length.\n*\n* @name length\n* @memberof LinkedList.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var list = new LinkedList();\n*\n* // Examine the initial list length:\n* var len = list.length;\n* // returns 0\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( LinkedList.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Removes a value from the end of the list.\n*\n* @name pop\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( LinkedList.prototype, 'pop', function pop() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the last value:\n\t\tvalue = this._last.value;\n\n\t\t// Check whether we have a new \"tail\" or whether we have emptied the list...\n\t\tif ( this._last._prev ) {\n\t\t\tthis._last = this._last._prev;\n\t\t\tthis._last._next = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Adds a value to the end of the list.\n*\n* @name push\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'beep'\n*/\nsetReadOnly( LinkedList.prototype, 'push', function push( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous last node:\n\t\tnode._prev = this._last; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous last node to the new node:\n\t\tthis._last._next = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the last node:\n\t\tthis._last = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n/**\n* Removes a list node from the list.\n*\n* @name remove\n* @memberof LinkedList.prototype\n* @type {Function}\n* @param {Node} node - node to remove\n* @throws {Error} must provide a node belonging to the list\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' ).push( 'beep' );\n*\n* // Determine the list length:\n* var len = list.length;\n* // returns 3\n*\n* // Get the second node:\n* var node = list.first().next;\n*\n* // Remove the second node:\n* var v = list.remove( node );\n* // returns 'bar'\n*\n* // Determine the list length:\n* len = list.length;\n* // returns 2\n*/\nsetReadOnly( LinkedList.prototype, 'remove', function remove( node ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tvar n;\n\n\t// Case: first node (equivalent to `shift()`)\n\tif ( node === this._first ) {\n\t\treturn this.shift();\n\t}\n\t// Case: last node (equivalent to `pop()`)\n\tif ( node === this._last ) {\n\t\treturn this.pop();\n\t}\n\t// Retrieve the node value:\n\tvalue = node.value;\n\n\t// Unfortunately, we need to check whether we have been provided a node belonging to our list by walking the list. If we don't, we could erroneously decrement the list length. This means our runtime goes from the theoretical O(1) to O(N).\n\tn = this._first;\n\twhile ( n !== this._last && n !== node ) {\n\t\tn = n._next;\n\t}\n\t// Check if we iterated through the entire list:\n\tif ( n === this._last ) {\n\t\tthrow new Error( 'invalid argument. The list does not contain the provided list node.' );\n\t}\n\t// Update pointers:\n\tnode._prev._next = node._next;\n\tnode._next._prev = node._prev;\n\n\t// Decrement the list length:\n\tthis._length -= 1;\n\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Removes a value from the beginning of the list.\n*\n* @name shift\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the first value:\n* var v = list.shift();\n* // returns 'foo'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first value:\n* v = list.shift();\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'shift', function shift() {\n\t/* eslint-disable no-underscore-dangle */\n\tvar value;\n\tif ( this._length ) {\n\t\t// Retrieve the first value:\n\t\tvalue = this._first.value;\n\n\t\t// Check whether we have a new \"head\" or whether we have emptied the list...\n\t\tif ( this._first._next ) {\n\t\t\tthis._first = this._first._next;\n\t\t\tthis._first._prev = null;\n\t\t} else {\n\t\t\t// List is empty:\n\t\t\tthis._first = null;\n\t\t\tthis._last = null;\n\t\t}\n\t\t// Decrement the list length:\n\t\tthis._length -= 1;\n\t}\n\treturn value;\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Returns an array of list values.\n*\n* @name toArray\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Array} list values\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of list values:\n* var vals = list.toArray();\n* // returns [ 'foo', 'bar' ]\n*/\nsetReadOnly( LinkedList.prototype, 'toArray', function toArray() {\n\tvar node;\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tnode = this._first;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( node.value );\n\t\tnode = node.next;\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a list as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `LinkedList` instance.\n*\n* @name toJSON\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {Object} serialized list\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = list.toJSON();\n* // returns { 'type': 'linked-list', 'data': [ 'foo', 'bar' ] }\n*/\nsetReadOnly( LinkedList.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'linked-list';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n/**\n* Adds a value to the beginning of the list.\n*\n* @name unshift\n* @memberof LinkedList.prototype\n* @type {Function}\n* @returns {LinkedList} list instance\n*\n* @example\n* var list = new LinkedList();\n*\n* // Add values to the beginning of the list:\n* list.unshift( 'foo' ).unshift( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'foo'\n*\n* // Add a new value to the beginning of the list:\n* list.unshift( 'beep' );\n*\n* // Remove the last value:\n* v = list.pop();\n* // returns 'bar'\n*/\nsetReadOnly( LinkedList.prototype, 'unshift', function unshift( value ) {\n\tvar node;\n\n\t// Create a new list node:\n\tnode = new Node( value );\n\n\t// Check whether the list is currently empty...\n\tif ( this._length === 0 ) {\n\t\t// This is the only list node, making it both the first and last node:\n\t\tthis._first = node;\n\t\tthis._last = node;\n\t} else {\n\t\t// Link the new node to the previous first node:\n\t\tnode._next = this._first; // eslint-disable-line no-underscore-dangle\n\n\t\t// Link the previous first node to the new node:\n\t\tthis._first._prev = node; // eslint-disable-line no-underscore-dangle\n\n\t\t// Update the pointer for the first node:\n\t\tthis._first = node;\n\t}\n\t// Increment the list length:\n\tthis._length += 1;\n\n\treturn this;\n});\n\n\n// EXPORTS //\n\nmodule.exports = LinkedList;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Linked list.\n*\n* @module @stdlib/utils/linked-list\n*\n* @example\n* var linkedList = require( '@stdlib/utils/linked-list' );\n*\n* var list = linkedList();\n*\n* // Add values to the list:\n* list.push( 'foo' ).push( 'bar' );\n*\n* // Remove the last value:\n* var v = list.pop();\n* // returns 'bar'\n*\n* // Add a new value to the list:\n* list.push( 'beep' );\n*\n* // Remove the first list value:\n* v = list.shift();\n* // returns 'foo'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts each object key to lowercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'A': 1,\n* 'B': 2\n* };\n*\n* var obj2 = lowercaseKeys( obj1 );\n* // returns { 'a': 1, 'b': 2 }\n*/\nfunction lowercaseKeys( obj ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key.toLowerCase() ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lowercaseKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert each object key to lowercase.\n*\n* @module @stdlib/utils/lowercase-keys\n*\n* @example\n* var lowercaseKeys = require( '@stdlib/utils/lowercase-keys' );\n*\n* var obj1 = {\n* 'A': 1,\n* 'B': 2\n* };\n*\n* var obj2 = lowercaseKeys( obj1 );\n* // returns { 'a': 1, 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an ndarray and assigns the result to an element in an output ndarray.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing output ndarray meta data\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the unary function:\n* map( x, y, naryFunction( scale, 1 ) );\n*\n* var v = y.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction map( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar ref;\n\tvar shx;\n\tvar shy;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\tshy = y.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\tset( ybuf, oy, fcn.call( thisArg, get( xbuf, ox ), 0, ref ) );\n\t\treturn;\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), i, ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {Object} y - object containing output array data\n* @param {ArrayLikeObject} y.data - output array data\n* @param {Array} y.accessors - output array accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ -1, -2, -3, -4, -5, -6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map( x, y, naryFunction( abs, 1 ) );\n*\n* var data = y.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element...\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tset( ybuf, i, fcn.call( thisArg, get( xbuf, i ), i, xbuf ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( arr, fcn, thisArg ) {\n\tvar out;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tarr = ndarraylike2object( arr );\n\t\tout = ndzeros( arr.shape, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': arr.order\n\t\t});\n\t\tndarrayFcn( arr, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tout = zeros( arr.length );\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} input and output arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* map( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction map( arr, out, fcn, thisArg ) {\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\ttmp = ndarraylike2object( broadcast( arr, sh ) );\n\t\ttmp.ref = arr;\n\t\tarr = tmp;\n\n\t\tndarrayFcn( arr, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tif ( !isArrayLikeObject( out ) || isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( arr.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each element in an array and assign the result to an element in an output array.\n*\n* @module @stdlib/utils/map\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = map( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map = require( '@stdlib/utils/map' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* map.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function after transforming arguments according to a callback function.\n*\n* ## Notes\n*\n- The callback function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* @param {Function} fcn - input function\n* @param {Function} clbk - callback function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* function clbk( v ) {\n* return v * 2;\n* }\n*\n* var bar = mapArguments( foo, clbk );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 2, 4, 6 ]\n*/\nfunction mapArguments( fcn, clbk, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function after transforming arguments according to a callback function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( clbk( arguments[ i ], i ) ); // eslint-disable-line node/callback-return\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function after transforming arguments according to a callback function.\n*\n* @module @stdlib/utils/map-arguments\n*\n* @example\n* var mapArguments = require( '@stdlib/utils/map-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* function clbk( v ) {\n* return v * 2;\n* }\n*\n* var bar = mapArguments( foo, clbk );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 2, 4, 6 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function `n` times and returns an array of accumulated function return values.\n*\n* @param {Function} fcn - function to invoke\n* @param {NonNegativeInteger} n - number of function invocations\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {Array} accumulated results\n*\n* @example\n* function fcn( i ) {\n* return i;\n* }\n*\n* var arr = mapFun( fcn, 5 );\n* // returns [ 0, 1, 2, 3, 4 ]\n*/\nfunction mapFun( fcn, n, thisArg ) {\n\tvar out;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\t// Note: we explicitly do not preallocate in order to ensure \"fast\" elements for large output arrays.\n\tout = [];\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout.push( fcn.call( thisArg, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapFun;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function `n` times and return an array of accumulated function return values.\n*\n* @module @stdlib/utils/map-function\n*\n* @example\n* var mapFun = require( '@stdlib/utils/map-function' );\n*\n* function fcn( i ) {\n* return i;\n* }\n*\n* var arr = mapFun( fcn, 5 );\n* // returns [ 0, 1, 2, 3, 4 ]\n*/\n\n// MODULES //\n\nvar mapFun = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapFun;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Maps keys from one object to a new object having the same values.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - We need to cache an object value to prevent the edge case where, during the invocation of the transform function, the value corresponding to a particular key is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n*\n* @param {Object} obj - source object\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function transform( key, value ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapKeys( obj1, transform );\n* // returns { 'a1': 1, 'b2': 2 }\n*/\nfunction mapKeys( obj, transform ) {\n\tvar out;\n\tvar key;\n\tvar v;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( transform ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', transform ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tv = obj[ key ];\n\t\t\tkey = transform( key, v, obj );\n\t\t\tout[ key ] = v;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map keys from one object to a new object having the same values.\n*\n* @module @stdlib/utils/map-keys\n*\n* @example\n* var mapKeys = require( '@stdlib/utils/map-keys' );\n*\n* function transform( key, value ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapKeys( obj1, transform );\n* // returns { 'a1': 1, 'b2': 2 }\n*/\n\n// MODULES //\n\nvar mapKeys = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cceil = require( '@stdlib/math/base/special/cceil' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = mapReduce( x, new Complex64( 0.0, 0.0 ), naryFunction( cceil, 1 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 20.0\n*\n* var im = imagf( v );\n* // returns 24.0\n*/\nfunction mapReduce( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn reducer.call( thisArg, initial, mapper( get( xbuf, ox ), 0, ref ), 0, ref ); // eslint-disable-line max-len\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, ix ), i, ref ), i, ref ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum of squared values:\n* var out = mapReduce( x, 0, square, sum );\n* // returns 30\n*/\nfunction mapReduce( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, i ), i, xbuf ), i, xbuf ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array and returns the accumulated result.\n*\n* ## Notes\n*\n* - The mapping function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* - The reducing function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: result of applying the mapping function against the current array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} fourth argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduce( arr, 0, square, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduce( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction mapReduce( arr, initial, mapper, reducer, thisArg ) {\n\tif ( !isFunction( mapper ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', mapper ) );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Perform a map-reduce operation against each element in an array and return the accumulated result.\n*\n* @module @stdlib/utils/map-reduce\n*\n* @example\n* var mapReduce = require( '@stdlib/utils/map-reduce' );\n*\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduce( arr, 0, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapReduce = require( '@stdlib/utils/map-reduce' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduce( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cceil = require( '@stdlib/math/base/special/cceil' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = mapReduceRight( x, new Complex64( 0.0, 0.0 ), naryFunction( cceil, 1 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 20.0\n*\n* var im = imagf( v );\n* // returns 24.0\n*/\nfunction mapReduceRight( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn reducer.call( thisArg, initial, mapper( get( xbuf, ox ), 0, ref ), 0, ref ); // eslint-disable-line max-len\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, ix ), i, ref ), i, ref ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} thisArg - reducing function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum of squared values:\n* var out = mapReduceRight( x, 0, square, sum );\n* // returns 30\n*/\nfunction mapReduceRight( x, initial, mapper, reducer, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tacc = reducer.call( thisArg, acc, mapper( get( xbuf, i ), i, xbuf ), i, xbuf ); // eslint-disable-line max-len\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Performs a map-reduce operation against each element in an array while iterating from right to left and returns the accumulated result.\n*\n* ## Notes\n*\n* - The mapping function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* - The reducing function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: result of applying the mapping function against the current array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} mapper - mapping function\n* @param {Function} reducer - reducing function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} fourth argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduceRight( arr, 0, square, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduceRight( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction mapReduceRight( arr, initial, mapper, reducer, thisArg ) {\n\tif ( !isFunction( mapper ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', mapper ) );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, mapper, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapReduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Perform a map-reduce operation against each element in an array while iterating from right to left and return the accumulated result.\n*\n* @module @stdlib/utils/map-reduce-right\n*\n* @example\n* var mapReduceRight = require( '@stdlib/utils/map-reduce-right' );\n*\n* function square( value ) {\n* return value * value;\n* }\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = mapReduceRight( arr, 0, sum );\n* // returns 30\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapReduceRight = require( '@stdlib/utils/map-reduce-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapReduceRight( arr, 0, naryFunction( abs, 1 ), naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an ndarray and assigns the result to an element in an output ndarray, iterating from right to left.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing output ndarray meta data\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function scale( z ) {\n* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );\n* }\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': oy,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the unary function:\n* mapRight( x, y, naryFunction( scale, 1 ) );\n*\n* var v = y.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 10.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction mapRight( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar ordx;\n\tvar ordy;\n\tvar len;\n\tvar get;\n\tvar set;\n\tvar ref;\n\tvar shx;\n\tvar shy;\n\tvar sx;\n\tvar sy;\n\tvar ox;\n\tvar oy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\tshy = y.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\tset( ybuf, oy, fcn.call( thisArg, get( xbuf, ox ), 0, ref ) );\n\t\treturn;\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tset( ybuf, iy, fcn.call( thisArg, get( xbuf, ix ), i, ref ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array, iterating from right to left.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {Object} y - object containing output array data\n* @param {ArrayLikeObject} y.data - output array data\n* @param {Array} y.accessors - output array accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ -1, -2, -3, -4, -5, -6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* mapRight( x, y, naryFunction( abs, 1 ) );\n*\n* var data = y.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( x, y, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar get;\n\tvar set;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\t// Iterate over each element...\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tset( ybuf, i, fcn.call( thisArg, get( xbuf, i ), i, xbuf ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in a new array, iterating from right to left.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( arr, fcn, thisArg ) {\n\tvar out;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tarr = ndarraylike2object( arr );\n\t\tout = ndzeros( arr.shape, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': arr.order\n\t\t});\n\t\tndarrayFcn( arr, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tout = zeros( arr.length );\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each element in an array and assigns the result to an element in an output array, iterating from right to left.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @throws {TypeError} input and output arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must have be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* mapRight( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* mapRight( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\nfunction mapRight( arr, out, fcn, thisArg ) {\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an ndarray, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\ttmp = ndarraylike2object( broadcast( arr, sh ) );\n\t\ttmp.ref = arr;\n\t\tarr = tmp;\n\n\t\tndarrayFcn( arr, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\tif ( !isArrayLikeObject( out ) || isndarrayLike( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input array is an array-like object, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( arr.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( arr ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each element in an array and assign the result to an element in an output array, iterating from right to left.\n*\n* @module @stdlib/utils/map-right\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n*\n* var out = mapRight( arr, naryFunction( abs, 1 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var arr = [ -1, -2, -3, -4, -5, -6 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* mapRight.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* console.log( out );\n* // => [ 1, 2, 3, 4, 5, 6 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var array = require( '@stdlib/ndarray/array' );\n* var mapRight = require( '@stdlib/utils/map-right' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var arr = array( [ [ -1, -2, -3 ], [ -4, -5, -6 ] ], opts );\n* var out = array( opts );\n*\n* mapRight.assign( arr, out, naryFunction( abs, 1 ) );\n*\n* var data = out.data;\n* // returns [ 1, 2, 3, 4, 5, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Maps values from one object to a new object having the same keys.\n*\n* ## Notes\n*\n* - Iteration order is **not** guaranteed.\n* - The function only operates on own properties, not inherited properties.\n*\n* @param {Object} obj - source object\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function transform( value, key ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapValues( obj1, transform );\n* // returns { 'a': 'a1', 'b': 'b2' }\n*/\nfunction mapValues( obj, transform ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( transform ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', transform ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key ] = transform( obj[ key ], key, obj );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mapValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Map values from one object to a new object having the same keys.\n*\n* @module @stdlib/utils/map-values\n*\n* @example\n* var mapValues = require( '@stdlib/utils/map-values' );\n*\n* function transform( value, key ) {\n* return key + value;\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = mapValues( obj1, transform );\n* // returns { 'a': 'a1', 'b': 'b2' }\n*/\n\n// MODULES //\n\nvar mapValues = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mapValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing meta data for the first input ndarray\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing meta data for the second input ndarray\n* @param {string} y.ref - reference to original input ndarray-like object\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Object} z - object containing output ndarray meta data\n* @param {string} z.dtype - data type\n* @param {Collection} z.data - data buffer\n* @param {NonNegativeInteger} z.length - number of elements\n* @param {NonNegativeIntegerArray} z.shape - dimensions\n* @param {IntegerArray} z.strides - stride lengths\n* @param {NonNegativeInteger} z.offset - index offset\n* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} z.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/caddf' );\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var zbuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n* var sz = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n* var oz = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* y.ref = y;\n*\n* var z = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': zbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sz,\n* 'offset': oz,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the function:\n* map2( x, y, z, naryFunction( add, 2 ) );\n*\n* var v = z.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 2.0\n*\n* var im = imagf( v );\n* // returns 3.0\n*/\nfunction map2( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar ordx;\n\tvar ordy;\n\tvar ordz;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar xref;\n\tvar yref;\n\tvar shx;\n\tvar shy;\n\tvar shz;\n\tvar len;\n\tvar sx;\n\tvar sy;\n\tvar sz;\n\tvar ox;\n\tvar oy;\n\tvar oz;\n\tvar ix;\n\tvar iy;\n\tvar iz;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the array shapes:\n\tshx = x.shape;\n\tshy = y.shape;\n\tshz = z.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\tsz = z.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\toz = z.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\tordz = z.order;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Cache references to the original input arrays:\n\txref = x.ref;\n\tyref = y.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 && shy.length === 0 ) {\n\t\tzset( zbuf, oz, fcn.call( thisArg, xget( xbuf, ox ), yget( ybuf, oy ), 0, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t\treturn;\n\t}\n\t// Iterate over the arrays based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tiz = vind2bind( shz, sz, oz, ordz, i, MODE );\n\t\tzset( zbuf, iz, fcn.call( thisArg, xget( xbuf, ix ), yget( ybuf, iy ), i, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing data for the first input array\n* @param {ArrayLikeObject} x.data - array data\n* @param {Array} x.accessors - array element accessors\n* @param {Object} y - object containing data for the second input array\n* @param {ArrayLikeObject} y.data - array data\n* @param {Array} y.accessors - array element accessors\n* @param {Object} z - object containing output array data\n* @param {ArrayLikeObject} z.data - array data\n* @param {Array} z.accessors - array element accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ 1, 2, 3, 4, 5, 6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 1, 1, 1, 1, 1, 1 ],\n* 'accessors': [ getter, setter ]\n* };\n* var z = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map2( x, y, z, naryFunction( add, 2 ) );\n*\n* var data = z.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Iterate over the elements...\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tzset( zbuf, i, fcn.call( thisArg, xget( xbuf, i ), yget( ybuf, i ), i, [ xbuf, ybuf ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} input arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input arrays must have the same length\n* @throws {Error} input ndarrays must be broadcast compatible\n* @throws {TypeError} third argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar out;\n\tvar tmp;\n\tvar sh;\n\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\t// Broadcast `x` and `y` to a common shape:\n\t\tsh = broadcastShapes( [ x.shape, y.shape ] );\n\t\tif ( sh === null ) {\n\t\t\tthrow new Error( 'invalid arguments. Input ndarrays must be broadcast compatible.' );\n\t\t}\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\t// Create an output array:\n\t\tout = ndzeros( sh, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': x.order\n\t\t});\n\n\t\t// Apply the function to the input arrays:\n\t\tndarrayFcn( x, y, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( y.length !== x.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input arrays must have the same length.' );\n\t\t}\n\t\tout = zeros( x.length );\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays and assigns the results to an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be an array-like object or an ndarray\n* @throws {TypeError} fourth argument must be a function\n* @throws {TypeError} input and output arrays must be either all array-like objects or all ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2( x, y, out, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar isznd;\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tisznd = isndarrayLike( out );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( !isznd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\tndarrayFcn( x, y, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( isznd || !isArrayLikeObject( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( x.length !== y.length || y.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to elements in two input arrays and assign the results to an output array.\n*\n* @module @stdlib/utils/map2\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2( x, y. naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2 = require( '@stdlib/utils/map2' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing meta data for the first input ndarray\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {Object} y - object containing meta data for the second input ndarray\n* @param {string} y.ref - reference to original input ndarray-like object\n* @param {string} y.dtype - data type\n* @param {Collection} y.data - data buffer\n* @param {NonNegativeInteger} y.length - number of elements\n* @param {NonNegativeIntegerArray} y.shape - dimensions\n* @param {IntegerArray} y.strides - stride lengths\n* @param {NonNegativeInteger} y.offset - index offset\n* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} y.accessors - accessors for accessing data buffer elements\n* @param {Object} z - object containing output ndarray meta data\n* @param {string} z.dtype - data type\n* @param {Collection} z.data - data buffer\n* @param {NonNegativeInteger} z.length - number of elements\n* @param {NonNegativeIntegerArray} z.shape - dimensions\n* @param {IntegerArray} z.strides - stride lengths\n* @param {NonNegativeInteger} z.offset - index offset\n* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} z.accessors - accessors for accessing data buffer elements\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/caddf' );\n*\n* // Create data buffers:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var zbuf = new Complex64Array( 4 );\n*\n* // Define the shape of the input and output arrays:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n* var sy = [ 2, 1 ];\n* var sz = [ 2, 1 ];\n*\n* // Define the index offsets:\n* var ox = 0;\n* var oy = 0;\n* var oz = 0;\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* function setter( buf, idx, value ) {\n* buf.set( value, idx );\n* }\n*\n* // Create the input and output ndarray-like objects:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* x.ref = x;\n*\n* var y = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': ybuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sy,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n* y.ref = y;\n*\n* var z = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': zbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sz,\n* 'offset': oz,\n* 'order': 'row-major',\n* 'accessors': [ getter, setter ]\n* };\n*\n* // Apply the function:\n* map2Right( x, y, z, naryFunction( add, 2 ) );\n*\n* var v = z.data.get( 0 );\n*\n* var re = realf( v );\n* // returns 2.0\n*\n* var im = imagf( v );\n* // returns 3.0\n*/\nfunction map2Right( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar ordx;\n\tvar ordy;\n\tvar ordz;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar xref;\n\tvar yref;\n\tvar shx;\n\tvar shy;\n\tvar shz;\n\tvar len;\n\tvar sx;\n\tvar sy;\n\tvar sz;\n\tvar ox;\n\tvar oy;\n\tvar oz;\n\tvar ix;\n\tvar iy;\n\tvar iz;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the array shapes:\n\tshx = x.shape;\n\tshy = y.shape;\n\tshz = z.shape;\n\n\t// Cache references to the input and output ndarray data buffers:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache references to the respective stride arrays:\n\tsx = x.strides;\n\tsy = y.strides;\n\tsz = z.strides;\n\n\t// Cache the indices of the first indexed elements in the respective ndarrays:\n\tox = x.offset;\n\toy = y.offset;\n\toz = z.offset;\n\n\t// Cache the respective array orders:\n\tordx = x.order;\n\tordy = y.order;\n\tordz = z.order;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Cache references to the original input arrays:\n\txref = x.ref;\n\tyref = y.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 && shy.length === 0 ) {\n\t\tzset( zbuf, oz, fcn.call( thisArg, xget( xbuf, ox ), yget( ybuf, oy ), 0, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t\treturn;\n\t}\n\t// Iterate over the arrays based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tiy = vind2bind( shy, sy, oy, ordy, i, MODE );\n\t\tiz = vind2bind( shz, sz, oz, ordz, i, MODE );\n\t\tzset( zbuf, iz, fcn.call( thisArg, xget( xbuf, ix ), yget( ybuf, iy ), i, [ xref, yref ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* @private\n* @param {Object} x - object containing data for the first input array\n* @param {ArrayLikeObject} x.data - array data\n* @param {Array} x.accessors - array element accessors\n* @param {Object} y - object containing data for the second input array\n* @param {ArrayLikeObject} y.data - array data\n* @param {Array} y.accessors - array element accessors\n* @param {Object} z - object containing output array data\n* @param {ArrayLikeObject} z.data - array data\n* @param {Array} z.accessors - array element accessors\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {void}\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* // Define getters and setters:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* function setter( buf, idx, value ) {\n* buf[ idx ] = value;\n* }\n*\n* // Create the input and output array objects:\n* var x = {\n* 'data': [ 1, 2, 3, 4, 5, 6 ],\n* 'accessors': [ getter, setter ]\n* };\n* var y = {\n* 'data': [ 1, 1, 1, 1, 1, 1 ],\n* 'accessors': [ getter, setter ]\n* };\n* var z = {\n* 'data': [ 0, 0, 0, 0, 0, 0 ],\n* 'accessors': [ getter, setter ]\n* };\n*\n* map2Right( x, y, z, naryFunction( add, 2 ) );\n*\n* var data = z.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, z, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar zbuf;\n\tvar xget;\n\tvar yget;\n\tvar zset;\n\tvar i;\n\n\t// Cache references to the input and output data:\n\txbuf = x.data;\n\tybuf = y.data;\n\tzbuf = z.data;\n\n\t// Cache accessors:\n\txget = x.accessors[ 0 ];\n\tyget = y.accessors[ 0 ];\n\tzset = z.accessors[ 1 ];\n\n\t// Iterate over the elements...\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tzset( zbuf, i, fcn.call( thisArg, xget( xbuf, i ), yget( ybuf, i ), i, [ xbuf, ybuf ] ) ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar ndzeros = require( '@stdlib/ndarray/zeros' );\nvar broadcastShapes = require( '@stdlib/ndarray/base/broadcast-shapes' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to a new array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} input arrays must be either both array-like objects or both ndarrays\n* @throws {RangeError} input arrays must have the same length\n* @throws {Error} input ndarrays must be broadcast compatible\n* @throws {TypeError} third argument must be a function\n* @returns {(Array|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar out;\n\tvar tmp;\n\tvar sh;\n\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\t// Broadcast `x` and `y` to a common shape:\n\t\tsh = broadcastShapes( [ x.shape, y.shape ] );\n\t\tif ( sh === null ) {\n\t\t\tthrow new Error( 'invalid arguments. Input ndarrays must be broadcast compatible.' );\n\t\t}\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\t// Create an output array:\n\t\tout = ndzeros( sh, {\n\t\t\t'dtype': 'generic',\n\t\t\t'order': x.order\n\t\t});\n\n\t\t// Apply the function to the input arrays:\n\t\tndarrayFcn( x, y, ndarraylike2object( out ), fcn, thisArg );\n\t\treturn out;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( y.length !== x.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input arrays must have the same length.' );\n\t\t}\n\t\tout = zeros( x.length );\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar broadcast = require( '@stdlib/ndarray/base/maybe-broadcast-array' );\nvar isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function to elements in two input arrays while iterating from right to left and assigns the results to an output array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **v1**: element from first input array.\n* - **v2**: element from second input array.\n* - **idx**: element index.\n* - **arrays**: input arrays.\n*\n* @param {(ArrayLikeObject|ndarray)} x - first input array\n* @param {(ArrayLikeObject|ndarray)} y - second input array\n* @param {(ArrayLikeObject|ndarray)} out - output array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} second argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be an array-like object or an ndarray\n* @throws {TypeError} fourth argument must be a function\n* @throws {TypeError} input and output arrays must be either all array-like objects or all ndarrays\n* @throws {RangeError} input and output arrays must have the same length\n* @throws {Error} input and output ndarrays must be broadcast compatible\n* @throws {Error} cannot write to a read-only ndarray\n* @returns {(ArrayLikeObject|ndarray)} output array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2Right( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2Right( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\nfunction map2Right( x, y, out, fcn, thisArg ) {\n\tvar isxnd;\n\tvar isynd;\n\tvar isznd;\n\tvar tmp;\n\tvar sh;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tisxnd = isndarrayLike( x );\n\tisynd = isndarrayLike( y );\n\tisznd = isndarrayLike( out );\n\tif ( isxnd ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\tif ( !isynd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an ndarray, the second input array must also be an ndarray. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( !isznd ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are ndarrays, the output array must also be an ndarray. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( isReadOnly( out ) ) {\n\t\t\tthrow new Error( 'invalid argument. The output ndarray must be writable. Cannot write to a read-only ndarray.' );\n\t\t}\n\t\tout = ndarraylike2object( out );\n\t\tsh = out.shape;\n\n\t\t// Broadcast and wrap the input arrays and ensure that the `ref` properties point to the original input arrays...\n\t\ttmp = ndarraylike2object( broadcast( x, sh ) );\n\t\ttmp.ref = x;\n\t\tx = tmp;\n\n\t\ttmp = ndarraylike2object( broadcast( y, sh ) );\n\t\ttmp.ref = y;\n\t\ty = tmp;\n\n\t\tndarrayFcn( x, y, out, fcn, thisArg );\n\t\treturn out.ref;\n\t}\n\tif ( isArrayLikeObject( x ) ) {\n\t\tif ( isynd || !isArrayLikeObject( y ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the first input array is an array-like object, the second input array must also be an array-like object. Value: `%s`.', y ) );\n\t\t}\n\t\tif ( isznd || !isArrayLikeObject( out ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. If the input arrays are array-like objects, the output array must also be an array-like object. Value: `%s`.', out ) );\n\t\t}\n\t\tif ( x.length !== y.length || y.length !== out.length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Input and output arrays must have the same length.' );\n\t\t}\n\t\tarrayFcn( arraylike2object( x ), arraylike2object( y ), arraylike2object( out ), fcn, thisArg ); // eslint-disable-line max-len\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2Right;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to elements in two input arrays while iterating from right to left and assign the results to an output array.\n*\n* @module @stdlib/utils/map2-right\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n*\n* var out = map2Right( x, y, naryFunction( add, 2 ) );\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n*\n* var out = map2Right( x, y. naryFunction( add, 2 ) );\n* // returns \n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n* var y = [ 1, 1, 1, 1, 1, 1 ];\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* map2Right.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* console.log( out );\n* // => [ 2, 3, 4, 5, 6, 7 ]\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var map2Right = require( '@stdlib/utils/map2-right' );\n*\n* var opts = {\n* 'dtype': 'generic',\n* 'shape': [ 2, 3 ]\n* };\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n* var y = array( [ [ 1, 1, 1 ], [ 1, 1, 1 ] ], opts );\n* var out = array( opts );\n*\n* map2Right.assign( x, y, out, naryFunction( add, 2 ) );\n*\n* var data = out.data;\n* // returns [ 2, 3, 4, 5, 6, 7 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in an array of arrays and assigns the result to a nested element in a new array of arrays.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - array of arrays\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array of arrays\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} array of arrays\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ -1, -2, -3 ],\n* [ -4, -5, -6 ]\n* ];\n*\n* var out = map2d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n*/\nfunction map2d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar tmp;\n\tvar M;\n\tvar N;\n\tvar a;\n\tvar i;\n\tvar j;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tM = arr.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\ta = arr[ i ];\n\t\tif ( !isArrayLikeObject( a ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object containing array-like objects. Index: `%u`. Value: `%s`.', i, a ) );\n\t\t}\n\t\tN = a.length;\n\t\ttmp = [];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\ttmp.push( fcn.call( thisArg, a[ j ], [ i, j ], arr ) );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in an array of arrays and assign the result to a nested element in a new array of arrays.\n*\n* @module @stdlib/utils/map2d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map2d = require( '@stdlib/utils/map2d' );\n*\n* var arr = [\n* [ -1, -2, -3 ],\n* [ -4, -5, -6 ]\n* ];\n*\n* var out = map2d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a three-dimensional nested array and assigns the result to a nested element in a new three-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - three-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a three-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} three-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ -1, -2, -3 ] ],\n* [ [ -4, -5, -6 ] ]\n* ];\n*\n* var out = map3d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ]\n*/\nfunction map3d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar a1;\n\tvar a2;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a three-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a three-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tt2.push( fcn.call( thisArg, a2[ i2 ], [ i0, i1, i2 ], arr ) );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a three-dimensional nested array and assign the result to a nested element in a new three-dimensional nested array.\n*\n* @module @stdlib/utils/map3d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map3d = require( '@stdlib/utils/map3d' );\n*\n* var arr = [\n* [ [ -1, -2, -3 ] ],\n* [ [ -4, -5, -6 ] ]\n* ];\n*\n* var out = map3d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ 1, 2, 3 ] ], [ [ 4, 5, 6 ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a four-dimensional nested array and assigns the result to a nested element in a new four-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - four-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a four-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} four-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ [ -1, -2, -3 ] ] ],\n* [ [ [ -4, -5, -6 ] ] ]\n* ];\n*\n* var out = map4d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ]\n*/\nfunction map4d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Indices: (%u, %u). Value: `%s`.', i0, i1, a2 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta3 = a2[ i2 ];\n\t\t\t\tif ( !isArrayLikeObject( a3 ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a four-dimensional nested array. Indices: (%u, %u, %u). Value: `%s`.', i0, i1, i2, a3 ) );\n\t\t\t\t}\n\t\t\t\tS3 = a3.length;\n\t\t\t\tt3 = [];\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tt3.push( fcn.call( thisArg, a3[ i3 ], [ i0, i1, i2, i3 ], arr ) ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tt2.push( t3 );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a four-dimensional nested array and assign the result to a nested element in a new four-dimensional nested array.\n*\n* @module @stdlib/utils/map4d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map4d = require( '@stdlib/utils/map4d' );\n*\n* var arr = [\n* [ [ [ -1, -2, -3 ] ] ],\n* [ [ [ -4, -5, -6 ] ] ]\n* ];\n*\n* var out = map4d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ 1, 2, 3 ] ] ], [ [ [ 4, 5, 6 ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Applies a function to each nested element in a five-dimensional nested array and assigns the result to a nested element in a new five-dimensional nested array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - five-dimensional nested array\n* @param {Function} fcn - function to apply\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be a five-dimensional nested array\n* @throws {TypeError} second argument must be a function\n* @returns {ArrayArray} five-dimensional nested array\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var arr = [\n* [ [ [ [ -1, -2, -3 ] ] ] ],\n* [ [ [ [ -4, -5, -6 ] ] ] ]\n* ];\n*\n* var out = map5d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ [ 1, 2, 3 ] ] ] ], [ [ [ [ 4, 5, 6 ] ] ] ] ]\n*/\nfunction map5d( arr, fcn, thisArg ) {\n\tvar out;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar t4;\n\tvar a1;\n\tvar a2;\n\tvar a3;\n\tvar a4;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tS0 = arr.length;\n\tout = [];\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\ta1 = arr[ i0 ];\n\t\tif ( !isArrayLikeObject( a1 ) ) { // note: cannot support the more general \"collections\" here (which includes typed arrays having more than 2^32-1 elements), as the output array is limited to 2^32-1 elements; thus, we opt for the lowest common denominator: generic arrays\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Index: `%u`. Value: `%s`.', i0, a1 ) );\n\t\t}\n\t\tS1 = a1.length;\n\t\tt1 = [];\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\ta2 = a1[ i1 ];\n\t\t\tif ( !isArrayLikeObject( a2 ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u). Value: `%s`.', i0, i1, a2 ) );\n\t\t\t}\n\t\t\tS2 = a2.length;\n\t\t\tt2 = [];\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\ta3 = a2[ i2 ];\n\t\t\t\tif ( !isArrayLikeObject( a3 ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u, %u). Value: `%s`.', i0, i1, i2, a3 ) );\n\t\t\t\t}\n\t\t\t\tS3 = a3.length;\n\t\t\t\tt3 = [];\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\ta4 = a3[ i3 ];\n\t\t\t\t\tif ( !isArrayLikeObject( a4 ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a five-dimensional nested array. Indices: (%u, %u, %u, %u). Value: `%s`.', i0, i1, i2, i3, a4 ) );\n\t\t\t\t\t}\n\t\t\t\t\tS4 = a4.length;\n\t\t\t\t\tt4 = [];\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tt4.push( fcn.call( thisArg, a4[ i4 ], [ i0, i1, i2, i3, i4 ], arr ) ); // eslint-disable-line max-len\n\t\t\t\t\t}\n\t\t\t\t\tt3.push( t4 );\n\t\t\t\t}\n\t\t\t\tt2.push( t3 );\n\t\t\t}\n\t\t\tt1.push( t2 );\n\t\t}\n\t\tout.push( t1 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = map5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function to each nested element in a five-dimensional nested array and assign the result to a nested element in a new five-dimensional nested array.\n*\n* @module @stdlib/utils/map5d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var abs = require( '@stdlib/math/base/special/abs' );\n* var map5d = require( '@stdlib/utils/map5d' );\n*\n* var arr = [\n* [ [ [ [ -1, -2, -3 ] ] ] ],\n* [ [ [ [ -4, -5, -6 ] ] ] ]\n* ];\n*\n* var out = map5d( arr, naryFunction( abs, 1 ) );\n* // returns [ [ [ [ [ 1, 2, 3 ] ] ] ], [ [ [ [ 4, 5, 6 ] ] ] ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a specified mask.\n*\n* ## Notes\n*\n* - Only those arguments having a truthy mask value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Collection} mask - argument mask\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a collection\n* @returns {Function} masked function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = maskArguments( foo, [ 1, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction maskArguments( fcn, mask, thisArg ) {\n\tvar fcns;\n\tvar idx;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isCollection( mask ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', mask ) );\n\t}\n\tidx = [];\n\tfor ( i = 0; i < mask.length; i++ ) {\n\t\tif ( mask[ i ] ) {\n\t\t\tidx.push( i );\n\t\t}\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( idx.length < fcns.length ) ? fcns[ idx.length ] : nary;\n\n\t/**\n\t* Invokes a nullary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ] );\n\t}\n\n\t/**\n\t* Invokes a binary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ] );\n\t}\n\n\t/**\n\t* Invokes a ternary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quaternary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quinary function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ], arguments[ idx[4] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a function according to an argument mask.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ idx[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = maskArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a specified mask.\n*\n* @module @stdlib/utils/mask-arguments\n*\n* @example\n* var maskArguments = require( '@stdlib/utils/mask-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = maskArguments( foo, [ 1, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar identity = require( './../../identity-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a memoized function.\n*\n* @param {Function} fcn - function to memoize\n* @param {Function} [hashFunction] - function to map a set of arguments to a single value identifying that set\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} memoized function\n*\n* @example\n* function factorial( n ) {\n* var prod;\n* var i;\n* prod = 1;\n* for ( i = n; i > 1; i-- ) {\n* prod *= i;\n* }\n* return prod;\n* }\n*\n* var memoized = memoize( factorial );\n*\n* var v = memoized( 5 );\n* // returns 120\n*\n* v = memoized( 5 );\n* // returns 120\n*/\nfunction memoize( fcn, hashFunction ) {\n\tvar toKey;\n\tvar cache;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\ttoKey = identity;\n\t} else {\n\t\ttoKey = hashFunction;\n\t\tif ( !isFunction( toKey ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Hash function argument must be a function. Value: `%s`.', toKey ) );\n\t\t}\n\t}\n\tcache = {};\n\tsetReadOnly( memoized, 'cache', cache );\n\treturn memoized;\n\n\t/**\n\t* Memoized function.\n\t*\n\t* @private\n\t* @param {...*} args - function arguments\n\t* @returns {*} memoized function result\n\t*/\n\tfunction memoized() {\n\t\tvar args;\n\t\tvar out;\n\t\tvar key;\n\t\tvar i;\n\t\targs = new Array( arguments.length );\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\tkey = toKey( args ).toString();\n\t\tif ( hasOwnProp( cache, key ) ) {\n\t\t\treturn cache[ key ];\n\t\t}\n\t\tout = fcn.apply( null, args );\n\t\tcache[ key ] = out;\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = memoize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Memoize a function.\n*\n* @module @stdlib/utils/memoize\n*\n* @example\n* var memoize = require( '@stdlib/utils/memoize' );\n*\n* function factorial( n ) {\n* var prod;\n* var i;\n* prod = 1;\n* for ( i = n; i > 1; i-- ) {\n* prod *= i;\n* }\n* return prod;\n* }\n*\n* var memoized = memoize( factorial );\n*\n* var v = memoized( 5 );\n* // returns 120\n*\n* v = memoized( 5 );\n* // returns 120\n*/\n\n// MODULES //\n\nvar memoize = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = memoize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'level': PINF,\n\t\t'override': true,\n\t\t'extend': true,\n\t\t'copy': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar typeOf = require( './../../type-of' );\nvar deepCopy = require( './../../copy' );\n\n\n// MAIN //\n\n/**\n* Merges a source object into a target object.\n*\n* @private\n* @param {Object} target - target object\n* @param {Object} source - source object\n* @param {number} level - merge level\n* @param {boolean} copy - indicates whether to perform a deep copy of merged values\n* @param {(boolean|Function)} override - defines the merge strategy\n* @param {boolean} extend - indicates whether new properties can be added to the target object\n*/\nfunction deepMerge( target, source, level, copy, override, extend ) {\n\tvar hasProp;\n\tvar isFunc;\n\tvar name;\n\tvar keys;\n\tvar curr;\n\tvar key;\n\tvar val;\n\tvar tmp;\n\tvar i;\n\n\t// Determine if we were provided a custom override strategy:\n\tisFunc = isFunction( override );\n\n\t// Decrement the level:\n\tlevel -= 1;\n\n\t// Loop through the source keys and implement the merge strategy...\n\tkeys = objectKeys( source );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\thasProp = hasOwnProp( target, key );\n\n\t\t// Can we add new properties to the target?\n\t\tif ( !hasProp && !extend ) {\n\t\t\tcontinue;\n\t\t}\n\t\tval = source[ key ];\n\n\t\tif ( hasProp ) {\n\t\t\tcurr = target[ key ];\n\t\t\tname = typeOf( curr );\n\n\t\t\t// Should we recurse to perform a deep(er) merge? (only if both the current value and the proposed value are objects and the level is > 0)\n\t\t\tif (\n\t\t\t\t!isBuffer( curr ) &&\n\t\t\t\tname === 'object' &&\n\t\t\t\tisObject( val ) &&\n\t\t\t\tlevel\n\t\t\t) {\n\t\t\t\tdeepMerge( curr, val, level, copy, override, extend );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Should we apply a custom merge (override) strategy?\n\t\t\tif ( isFunc ) {\n\t\t\t\ttmp = override( curr, val, key );\n\n\t\t\t\t// WARNING: the following check does NOT prevent shared (leaky) nested references. We only check for top-level reference equality. We will assume that the user knows best, given their having provided a custom override strategy.\n\t\t\t\tif ( copy && tmp !== curr && tmp === val ) {\n\t\t\t\t\ttmp = deepCopy( tmp );\n\t\t\t\t}\n\t\t\t\ttarget[ key ] = tmp;\n\t\t\t}\n\t\t\t// Are we allowed to override an existing target value?\n\t\t\telse if ( override ) {\n\t\t\t\tif ( copy ) {\n\t\t\t\t\ttarget[ key ] = deepCopy( val );\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// New property to be added to target object. Should we deep copy the source value?\n\t\telse if ( copy ) {\n\t\t\ttarget[ key ] = deepCopy( val );\n\t\t}\n\t\t// Perform a simple assignment...\n\t\telse {\n\t\t\ttarget[ key ] = val;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = deepMerge;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-object' );\nvar format = require( '@stdlib/string/format' );\nvar deepMerge = require( './deepmerge.js' );\n\n\n// MAIN //\n\n/**\n* Returns a merge function based on provided options.\n*\n* @private\n* @param {Options} opts - function options\n* @param {number} options.level - merge level\n* @param {boolean} options.copy - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} options.override - defines the merge strategy\n* @param {boolean} options.extend - boolean indicating whether new properties can be added to the target object\n* @returns {Function} merge function\n*\n* @example\n* var merge = mergefcn({\n* 'level': Number.POSITIVE_INFINITY,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* });\n* // returns \n*/\nfunction mergefcn( opts ) {\n\treturn merge;\n\n\t/**\n\t* Merges objects into a target object. Note that the target object is mutated.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n\t* @throws {Error} must provide a target object and one or more source objects\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} source arguments must be objects\n\t* @returns {Object} merged (target) object\n\t*\n\t* @example\n\t* var target = {\n\t* 'a': 'beep'\n\t* };\n\t* var source = {\n\t* 'a': 'boop',\n\t* 'b': 'bap'\n\t* };\n\t*\n\t* var out = merge( target, source );\n\t* // returns {'a':'boop', 'b':'bap'}\n\t*/\n\tfunction merge( target ) {\n\t\tvar nargs;\n\t\tvar arg;\n\t\tvar src;\n\t\tvar i;\n\n\t\tnargs = arguments.length - 1;\n\t\tif ( nargs < 1 ) {\n\t\t\tthrow new Error( 'insufficient arguments. Must provide both a target object and one or more source objects.' );\n\t\t}\n\t\tif ( !isObject( target ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', target ) );\n\t\t}\n\t\tsrc = new Array( nargs );\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targ = arguments[ i+1 ];\n\n\t\t\t// WARNING: this is a porous check. Buffers, Numbers, Booleans, Strings, Dates, RegExp, custom class instances,... will all pass.\n\t\t\tif ( !isObject( arg ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. All arguments must be objects. Index: `%u`. Value: `%s`.', i, arg ) );\n\t\t\t}\n\t\t\tsrc[ i ] = arg;\n\t\t}\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tdeepMerge( target, src[ i ], opts.level, opts.copy, opts.override, opts.extend ); // eslint-disable-line max-len\n\t\t}\n\t\treturn target;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = mergefcn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defaults = require( './defaults.js' );\nvar mergefcn = require( './mergefcn.js' );\n\n\n// MAIN //\n\n/**\n* Merges objects into a target object. Note that the target object is mutated.\n*\n* @name merge\n* @type {Function}\n* @param {Object} target - target object\n* @param {...Object} source - source objects (i.e., objects to be merged into the target object)\n* @throws {Error} must provide a target object and one or more source objects\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} source arguments must be objects\n* @returns {Object} merged (target) object\n*\n* @example\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*/\nvar merge = mergefcn( defaults() );\n\n\n// EXPORTS //\n\nmodule.exports = merge;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {number} [options.level] - merge level\n* @param {boolean} [options.copy] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override] - defines the merge strategy\n* @param {boolean} [options.extend] - boolean indicating whether new properties can be added to the target object\n* @returns {(Error|null)} error object or null\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'level' ) ) {\n\t\topts.level = options.level;\n\t\tif ( !isPositiveInteger( opts.level ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'level', opts.level ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'override' ) ) {\n\t\topts.override = options.override;\n\t\tif (\n\t\t\t!isBoolean( opts.override ) &&\n\t\t\t!isFunction( opts.override )\n\t\t) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be either a boolean or a function. Option: `%s`.', 'override', opts.override ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'extend' ) ) {\n\t\topts.extend = options.extend;\n\t\tif ( !isBoolean( opts.extend ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'extend', opts.extend ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\nvar mergefcn = require( './mergefcn.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for merging and extending objects.\n*\n* @param {Options} options - merge options\n* @param {number} [options.level=Infinity] - merge level\n* @param {boolean} [options.copy=true] - boolean indicating whether to deep copy merged values\n* @param {(boolean|Function)} [options.override=true] - defines the merge strategy\n* @param {boolean} [options.extend=true] - boolean indicating whether new properties can be added to the target object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function which can be used to merge objects\n*\n* @example\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar err;\n\topts = defaults();\n\terr = validate( opts, options );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\treturn mergefcn( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Merge and extend objects.\n*\n* @module @stdlib/utils/merge\n*\n* @example\n* var merge = require( '@stdlib/utils/merge' );\n*\n* var target = {\n* 'a': 'beep'\n* };\n* var source = {\n* 'a': 'boop',\n* 'b': 'bap'\n* };\n*\n* var out = merge( target, source );\n* // returns {'a':'boop', 'b':'bap'}\n*\n* @example\n* var factory = require( '@stdlib/utils/merge' ).factory;\n*\n* var opts = {\n* 'level': 100,\n* 'copy': true,\n* 'override': true,\n* 'extend': true\n* };\n*\n* var merge = factory( opts );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Moves a property from one object to another object.\n*\n* @param {Object} source - source object\n* @param {string} prop - property to move\n* @param {Object} target - target object\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @returns {boolean} boolean indicating whether operation was successful\n*\n* @example\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'a', obj2 );\n* // returns true\n*\n* @example\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'c', obj2 );\n* // returns false\n*/\nfunction moveProperty( source, prop, target ) {\n\tvar desc;\n\tif ( typeof source !== 'object' || source === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Source argument must be an object. Value: `%s`.', source ) );\n\t}\n\tif ( typeof target !== 'object' || target === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Target argument must be an object. Value: `%s`.', target ) );\n\t}\n\t// TODO: handle case where gOPD is not supported\n\tdesc = Object.getOwnPropertyDescriptor( source, prop );\n\tif ( desc === void 0 ) {\n\t\treturn false;\n\t}\n\tdelete source[ prop ];\n\tdefineProperty( target, prop, desc );\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = moveProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Move a property from one object to another object.\n*\n* @module @stdlib/utils/move-property\n*\n* @example\n* var moveProperty = require( '@stdlib/utils/move-property' );\n*\n* var obj1 = { 'a': 'b' };\n* var obj2 = {};\n*\n* var bool = moveProperty( obj1, 'a', obj2 );\n* // returns true\n*\n* bool = moveProperty( obj1, 'c', obj2 );\n* // returns false\n*/\n\n// MODULES //\n\nvar moveProperty = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = moveProperty;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited property names and symbols\n*\n* @example\n* var props = propertiesIn( [] );\n* // returns [...]\n*/\nfunction propertiesIn( value ) {\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all properties...\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( out, tmp[ i ] ) === false ) {\n\t\t\t\tout.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited property names and symbols.\n*\n* @module @stdlib/utils/properties-in\n*\n* @example\n* var propertiesIn = require( '@stdlib/utils/properties-in' );\n*\n* var props = propertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = contains;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Tests if an array contains distinct elements.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {boolean} boolean indicating if an array contains distinct elements\n*/\nfunction hasDistinctElements( arr ) {\n\tvar obj;\n\tvar i;\n\n\tobj = {};\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( hasOwnProp( obj, arr[ i ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tobj[ arr[i] ] = true;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasDistinctElements;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar dtypes = require( '@stdlib/array/typed-dtypes' );\nvar format = require( '@stdlib/string/format' );\nvar contains = require( './contains.js' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - default data type\n* @param {string} [options.name] - tuple name\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64',\n* 'name': 'Complex128'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !isString( opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'dtype', opts.dtype ) );\n\t\t}\n\t\tif ( !contains( DTYPES, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', opts.dtype ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t\tif ( !isString( opts.name ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'name', opts.name ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Specifies a sort order for ordering numeric values in ascending order.\n*\n* ## Notes\n*\n* - If `a < b`, then function returns a number less than `0`, which specifies to sort `a` to an index lower than `b`.\n* - If `a > b`, then function returns a number greater than `0`, which specifies to sort `a` to an index higher than `b`.\n* - If `a == b`, then function returns `0`, which specifies that the order of `a` and `b` should remain unchanged (not guaranteed).\n*\n* @private\n* @param {number} a - first value\n* @param {number} b - second value\n* @returns {number} difference between `a` and `b`\n*/\nfunction ascending( a, b ) {\n\treturn a - b;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ascending;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( v.value );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {StringArray} fields - tuple fields\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( fields, it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i, fields[ i ] ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/* eslint-disable max-len, max-lines */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar propertiesIn = require( './../../properties-in' );\nvar typedarray = require( '@stdlib/array/typed' );\nvar Int8Array = require( '@stdlib/array/int8' );\nvar getDtype = require( '@stdlib/array/dtype' );\nvar defineProperty = require( './../../define-property' );\nvar setNonEnumerableProperty = require( './../../define-nonenumerable-property' );\nvar setNonEnumerableReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' ); // eslint-disable-line id-length\nvar setNonEnumerableReadWriteAccessor = require( './../../define-nonenumerable-read-write-accessor' ); // eslint-disable-line id-length\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\nvar contains = require( './contains.js' );\nvar hasDistinctElements = require( './has_distinct_elements.js' );\nvar validate = require( './validate.js' );\nvar ascending = require( './ascending.js' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\n\n\n// VARIABLES //\n\nvar RESERVED_PROPS = propertiesIn( new Int8Array( 0 ) );\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// MAIN //\n\n/**\n* Returns a named typed tuple factory.\n*\n* @param {StringArray} names - field (property) names\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @param {string} [options.name=\"tuple\"] - tuple name\n* @throws {TypeError} must provide an array of strings\n* @throws {TypeError} must provide distinct field names\n* @throws {Error} cannot provide a reserved field (property) name\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a recognized data type\n* @returns {Function} factory function\n*\n* @example\n* var point = factory( [ 'x', 'y' ] );\n*\n* var p = point( [ 1.0, -1.0 ] );\n*\n* var x = p[ 0 ];\n* // returns 1.0\n*\n* x = p.x;\n* // returns 1.0\n*\n* var y = p[ 1 ];\n* // returns -1.0\n*\n* y = p.y;\n* // returns -1.0\n*/\nfunction factory( names, options ) { // eslint-disable-line max-lines-per-function, stdlib/jsdoc-require-throws-tags\n\tvar nfields;\n\tvar fields;\n\tvar opts;\n\tvar err;\n\tvar i;\n\tif ( !isStringArray( names ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array of strings. Value: `%s`.', names ) );\n\t}\n\tif ( !hasDistinctElements( names ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Field names must be distinct. Value: `%s`.', names ) );\n\t}\n\tfields = names.slice();\n\tnfields = fields.length;\n\tfor ( i = 0; i < nfields; i++ ) {\n\t\tif ( contains( RESERVED_PROPS, fields[ i ] ) ) {\n\t\t\tthrow new Error( format( 'invalid argument. Provided field name is reserved. Name: `%s`.', fields[ i ] ) );\n\t\t}\n\t}\n\topts = {\n\t\t'dtype': 'float64',\n\t\t'name': 'tuple'\n\t};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/**\n\t* Returns a named typed tuple.\n\t*\n\t* @private\n\t* @param {(TypedArray|ArrayLikeObject|ArrayBuffer|Iterable)} [arg] - a typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {string} [dtype] - data type\n\t* @throws {TypeError} must provide a recognized data type\n\t* @throws {RangeError} arguments must be compatible with tuple length\n\t* @returns {TypedArray} named typed tuple\n\t*/\n\tfunction namedtypedtuple() { // eslint-disable-line max-lines-per-function\n\t\tvar indices;\n\t\tvar dtype;\n\t\tvar nargs;\n\t\tvar tuple;\n\t\tvar i;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs <= 0 ) {\n\t\t\ttuple = typedarray( nfields, opts.dtype );\n\t\t} else if ( nargs === 1 ) {\n\t\t\tif ( isString( arguments[ 0 ] ) ) {\n\t\t\t\t// Arguments: [ dtype ]\n\t\t\t\ttuple = typedarray( nfields, arguments[ 0 ] );\n\t\t\t} else if ( isArrayBuffer( arguments[ 0 ] ) ) {\n\t\t\t\t// Arguments: [ ArrayBuffer ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], 0, nfields, opts.dtype );\n\t\t\t} else {\n\t\t\t\t// Arguments: [ TypedArray|ArrayLikeObject|Iterable ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], opts.dtype );\n\t\t\t}\n\t\t} else if ( nargs === 2 ) {\n\t\t\tif ( isArrayBuffer( arguments[ 0 ] ) ) {\n\t\t\t\tif ( isString( arguments[ 1 ] ) ) {\n\t\t\t\t\t// Arguments: [ ArrayBuffer, dtype ]\n\t\t\t\t\ttuple = typedarray( arguments[ 0 ], 0, nfields, arguments[ 1 ] );\n\t\t\t\t} else {\n\t\t\t\t\t// Arguments: [ ArrayBuffer, byteOffset ]\n\t\t\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ], nfields, opts.dtype );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Arguments: [ TypedArray|ArrayLikeObject|Iterable, dtype ]\n\t\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ] );\n\t\t\t}\n\t\t} else {\n\t\t\t// Arguments: [ ArrayBuffer, byteOffset, dtype ]\n\t\t\ttuple = typedarray( arguments[ 0 ], arguments[ 1 ], nfields, arguments[ 2 ] );\n\t\t}\n\t\tif ( tuple.length !== nfields ) {\n\t\t\tthrow new RangeError( format( 'invalid arguments. Arguments are incompatible with the number of tuple fields. Number of fields: `%u`. Number of data elements: `%u`.', nfields, tuple.length ) );\n\t\t}\n\t\tdtype = getDtype( tuple );\n\n\t\tindices = []; // indirect index look-up table\n\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\tindices.push( i );\n\t\t\tsetNonEnumerableReadWriteAccessor( tuple, fields[ i ], getter( i ), setter( i ) );\n\t\t}\n\t\tsetNonEnumerableProperty( tuple, 'name', opts.name );\n\t\tsetNonEnumerableReadOnlyAccessor( tuple, 'fields', getFields );\n\t\tsetNonEnumerableReadOnlyAccessor( tuple, 'orderedFields', orderedFields );\n\n\t\t// Note: keep in alphabetical order\n\t\tsetNonEnumerableProperty( tuple, 'entries', entries );\n\t\tsetNonEnumerableProperty( tuple, 'every', every );\n\t\tsetNonEnumerableProperty( tuple, 'fieldOf', fieldOf );\n\t\tsetNonEnumerableProperty( tuple, 'filter', filter );\n\t\tsetNonEnumerableProperty( tuple, 'find', find );\n\t\tsetNonEnumerableProperty( tuple, 'findIndex', findIndex );\n\t\tsetNonEnumerableProperty( tuple, 'findField', findField );\n\t\tsetNonEnumerableProperty( tuple, 'forEach', forEach );\n\t\tsetNonEnumerableProperty( tuple, 'ind2key', ind2key );\n\t\tsetNonEnumerableProperty( tuple, 'key2ind', key2ind );\n\t\tsetNonEnumerableProperty( tuple, 'keys', keys );\n\t\tsetNonEnumerableProperty( tuple, 'lastFieldOf', lastFieldOf );\n\t\tsetNonEnumerableProperty( tuple, 'map', map );\n\t\tsetNonEnumerableProperty( tuple, 'reduce', reduce );\n\t\tsetNonEnumerableProperty( tuple, 'reduceRight', reduceRight );\n\t\tsetNonEnumerableProperty( tuple, 'reverse', reverse );\n\t\tsetNonEnumerableProperty( tuple, 'slice', slice );\n\t\tsetNonEnumerableProperty( tuple, 'some', some );\n\t\tsetNonEnumerableProperty( tuple, 'sort', sort );\n\t\tsetNonEnumerableProperty( tuple, 'subtuple', subtuple );\n\t\tsetNonEnumerableProperty( tuple, 'toJSON', toJSON );\n\t\tsetNonEnumerableProperty( tuple, 'toString', toString );\n\n\t\treturn tuple;\n\n\t\t/**\n\t\t* Returns an accessor to retrieve a tuple value.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} i - tuple index\n\t\t* @returns {Function} accessor\n\t\t*/\n\t\tfunction getter( i ) {\n\t\t\treturn get;\n\n\t\t\t/**\n\t\t\t* Returns a tuple value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {number} tuple value\n\t\t\t*/\n\t\t\tfunction get() {\n\t\t\t\treturn tuple[ indices[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns an accessor to set a tuple value.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} i - tuple index\n\t\t* @returns {Function} accessor\n\t\t*/\n\t\tfunction setter( i ) {\n\t\t\treturn set;\n\n\t\t\t/**\n\t\t\t* Sets a tuple value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {number} v - value to set\n\t\t\t*/\n\t\t\tfunction set( v ) {\n\t\t\t\ttuple[ indices[ i ] ] = v;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the list of tuple fields.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @returns {StringArray} tuple fields\n\t\t*/\n\t\tfunction getFields() {\n\t\t\treturn fields.slice();\n\t\t}\n\n\t\t/**\n\t\t* Returns the list of tuple fields in index order.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @returns {StringArray} tuple fields\n\t\t*/\n\t\tfunction orderedFields() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tout = fields.slice();\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ i ] = fields[ indices[i] ];\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// Note: keep functions which follow in alphabetical order\n\n\t\t/**\n\t\t* Returns an iterator for iterating over tuple key-value pairs.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {Iterator} iterator\n\t\t*/\n\t\tfunction entries() {\n\t\t\tvar self;\n\t\t\tvar iter;\n\t\t\tvar FLG;\n\t\t\tvar i;\n\n\t\t\tself = this; // eslint-disable-line no-invalid-this\n\t\t\tif ( self !== tuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\n\t\t\t// Initialize the iteration index:\n\t\t\ti = -1;\n\n\t\t\t// Create an iterator protocol-compliant object:\n\t\t\titer = {};\n\t\t\tdefineProperty( iter, 'next', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': next\n\t\t\t});\n\t\t\tdefineProperty( iter, 'return', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': end\n\t\t\t});\n\t\t\tif ( HAS_ITERATOR_SYMBOL ) {\n\t\t\t\tdefineProperty( iter, ITERATOR_SYMBOL, {\n\t\t\t\t\t'configurable': false,\n\t\t\t\t\t'enumerable': false,\n\t\t\t\t\t'writable': false,\n\t\t\t\t\t'value': factory\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn iter;\n\n\t\t\t/**\n\t\t\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction next() {\n\t\t\t\ti += 1;\n\t\t\t\tif ( FLG || i >= nfields ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'value': [ i, fields[ indices[ i ] ], tuple[ i ] ],\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Finishes an iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {*} [value] - value to return\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction end( value ) {\n\t\t\t\tFLG = true;\n\t\t\t\tif ( arguments.length ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'value': value,\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'done': true\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Returns a new iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Iterator} iterator\n\t\t\t*/\n\t\t\tfunction factory() {\n\t\t\t\treturn self.entries();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Tests whether all tuple elements pass a test implemented by a predicate function.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {boolean} boolean indicating if all elements pass\n\t\t*/\n\t\tfunction every( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( !bool ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the first tuple element strictly equal to a search element.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The function does not distinguish between signed and unsigned zero.\n\t\t* - If unable to locate a search element, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {*} searchElement - search element\n\t\t* @param {integer} [fromIndex=0] - tuple index from which to begin searching\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction fieldOf( searchElement ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\ti = arguments[ 0 ];\n\t\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', i ) );\n\t\t\t\t}\n\t\t\t\tif ( i >= nfields ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = nfields + i;\n\t\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\t\ti = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t\tfor ( ; i < nfields; i++ ) {\n\t\t\t\tif ( tuple[ i ] === searchElement ) {\n\t\t\t\t\treturn fields[ indices[ i ] ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Creates a new tuple which includes those elements for which a predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The returned tuple has the same data type as the host tuple.\n\t\t* - If a predicate function does not return a truthy value for any tuple element, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - filter (predicate) function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction filter( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar tmp;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\ttmp = [];\n\t\t\tf = [];\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\tf.push( fields[ indices[i] ] );\n\t\t\t\t\ttmp.push( tuple[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( f.length === nfields ) {\n\t\t\t\treturn namedtypedtuple( tmp, dtype );\n\t\t\t}\n\t\t\tif ( f.length ) {\n\t\t\t\treturn factory( f, opts )( tmp );\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t* Returns the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(number|void)} tuple element\n\t\t*/\n\t\tfunction find( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn tuple[ i ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the predicate function never returns a truthy value, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction findField( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tf = fields[ indices[ i ] ];\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, f, tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the index of the first tuple element for which a provided predicate function returns a truthy value.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the predicate function never returns a truthy value, the function returns `-1`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {integer} tuple index or `-1`\n\t\t*/\n\t\tfunction findIndex( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t* Invokes a callback for each tuple element.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - function to invoke\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t*/\n\t\tfunction forEach( fcn, thisArg ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tfcn.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Converts a tuple index to a field name.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If provided an out-of-bounds index, the function returns `undefined`.\n\t\t* - If provided a negative tuple index, the function resolves the index relative to the last tuple element.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} ind - tuple index\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} must provide an integer\n\t\t* @returns {(string|void)} field name or undefined\n\t\t*/\n\t\tfunction ind2key( ind ) {\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isInteger( ind ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', ind ) );\n\t\t\t}\n\t\t\tif ( ind < 0 ) {\n\t\t\t\tind = nfields + ind;\n\t\t\t}\n\t\t\tif ( ind < 0 || ind >= nfields ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn fields[ indices[ ind ] ];\n\t\t}\n\n\t\t/**\n\t\t* Converts a field name to a tuple index.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If provided an unknown field name, the function returns `-1`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {string} key - field name\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a string\n\t\t* @returns {integer} tuple index\n\t\t*/\n\t\tfunction key2ind( key ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isString( key ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', key ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tif ( fields[ indices[i] ] === key ) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t* Returns an iterator for iterating over tuple keys.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {Iterator} iterator\n\t\t*/\n\t\tfunction keys() {\n\t\t\tvar self;\n\t\t\tvar iter;\n\t\t\tvar FLG;\n\t\t\tvar i;\n\n\t\t\tself = this; // eslint-disable-line no-invalid-this\n\t\t\tif ( self !== tuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\n\t\t\t// Initialize the iteration index:\n\t\t\ti = -1;\n\n\t\t\t// Create an iterator protocol-compliant object:\n\t\t\titer = {};\n\t\t\tdefineProperty( iter, 'next', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': next\n\t\t\t});\n\t\t\tdefineProperty( iter, 'return', {\n\t\t\t\t'configurable': false,\n\t\t\t\t'enumerable': false,\n\t\t\t\t'writable': false,\n\t\t\t\t'value': end\n\t\t\t});\n\t\t\tif ( HAS_ITERATOR_SYMBOL ) {\n\t\t\t\tdefineProperty( iter, ITERATOR_SYMBOL, {\n\t\t\t\t\t'configurable': false,\n\t\t\t\t\t'enumerable': false,\n\t\t\t\t\t'writable': false,\n\t\t\t\t\t'value': factory\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn iter;\n\n\t\t\t/**\n\t\t\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction next() {\n\t\t\t\ti += 1;\n\t\t\t\tif ( FLG || i >= nfields ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'value': [ i, fields[ indices[ i ] ] ],\n\t\t\t\t\t'done': false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Finishes an iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {*} [value] - value to return\n\t\t\t* @returns {Object} iterator protocol-compliant object\n\t\t\t*/\n\t\t\tfunction end( value ) {\n\t\t\t\tFLG = true;\n\t\t\t\tif ( arguments.length ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'value': value,\n\t\t\t\t\t\t'done': true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t'done': true\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Returns a new iterator.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @returns {Iterator} iterator\n\t\t\t*/\n\t\t\tfunction factory() {\n\t\t\t\treturn self.keys();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Returns the field of the last tuple element strictly equal to a search element, iterating from right to left.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The function does not distinguish between signed and unsigned zero.\n\t\t* - If unable to locate a search element, the function returns `undefined`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {*} searchElement - search element\n\t\t* @param {integer} [fromIndex=-1] - tuple index from which to begin searching\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(string|void)} tuple field name or `undefined`\n\t\t*/\n\t\tfunction lastFieldOf( searchElement ) {\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\ti = arguments[ 1 ];\n\t\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', i ) );\n\t\t\t\t}\n\t\t\t\tif ( i >= nfields ) {\n\t\t\t\t\ti = nfields - 1;\n\t\t\t\t} else if ( i < 0 ) {\n\t\t\t\t\ti = nfields + i;\n\t\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ti = nfields - 1;\n\t\t\t}\n\t\t\tfor ( ; i >= 0; i-- ) {\n\t\t\t\tif ( tuple[ i ] === searchElement ) {\n\t\t\t\t\treturn fields[ indices[ i ] ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Maps each tuple element to an element in a new tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The returned tuple has the same data type as the host tuple.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - map function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {TypedArray} new tuple\n\t\t*/\n\t\tfunction map( fcn, thisArg ) {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tout = namedtypedtuple( dtype );\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ i ] = fcn.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Applies a function against an accumulator and each element in a tuple and returns the accumulated result.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - reduction function\n\t\t* @param {*} [initial] - initial value\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {*} accumulated result\n\t\t*/\n\t\tfunction reduce( fcn ) {\n\t\t\tvar acc;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\tacc = arguments[ 1 ];\n\t\t\t\ti = 0;\n\t\t\t} else {\n\t\t\t\tacc = tuple[ 0 ];\n\t\t\t\ti = 1;\n\t\t\t}\n\t\t\tfor ( ; i < nfields; i++ ) {\n\t\t\t\tacc = fcn( acc, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\n\t\t/**\n\t\t* Applies a function against an accumulator and each element in a tuple and returns the accumulated result, iterating from right to left.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} fcn - reduction function\n\t\t* @param {*} [initial] - initial value\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {*} accumulated result\n\t\t*/\n\t\tfunction reduceRight( fcn ) {\n\t\t\tvar acc;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\tacc = arguments[ 1 ];\n\t\t\t\ti = nfields - 1;\n\t\t\t} else {\n\t\t\t\tacc = tuple[ nfields-1 ];\n\t\t\t\ti = nfields - 2;\n\t\t\t}\n\t\t\tfor ( ; i >= 0; i-- ) {\n\t\t\t\tacc = fcn( acc, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}\n\n\t\t/**\n\t\t* Reverses a tuple **in-place**.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {TypedArray} reversed tuple\n\t\t*/\n\t\tfunction reverse() {\n\t\t\tvar tmp;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < floor( nfields/2 ); i++ ) {\n\t\t\t\tj = nfields - i - 1;\n\t\t\t\ttmp = tuple[ i ];\n\t\t\t\ttuple[ i ] = tuple[ j ];\n\t\t\t\ttuple[ j ] = tmp;\n\t\t\t}\n\t\t\t// Because the indices are bounded [0,nfields), we can use simple arithmetic to \"reverse\" index values in-place...\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tindices[ i ] = nfields - indices[ i ] - 1;\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\n\t\t/**\n\t\t* Copies elements to a new tuple with the same underlying data type as the host tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the function is unable to resolve indices to a non-empty tuple subsequence, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} [begin=0] - start element index (inclusive)\n\t\t* @param {integer} [end=tuple.length] - end element index (exclusive)\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be an integer\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction slice( begin, end ) {\n\t\t\tvar tmp;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tvar j;\n\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length === 0 ) {\n\t\t\t\treturn namedtypedtuple( tuple, dtype );\n\t\t\t}\n\t\t\ti = begin;\n\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t\t}\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = nfields + i;\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\tj = nfields;\n\t\t\t} else {\n\t\t\t\tj = end;\n\t\t\t\tif ( !isInteger( j ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t\t}\n\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\tj = nfields + j;\n\t\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\t\tj = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if ( j > nfields ) {\n\t\t\t\t\tj = nfields;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i >= j ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tf = [];\n\t\t\ttmp = [];\n\t\t\tfor ( ; i < j; i++ ) {\n\t\t\t\tf.push( fields[ indices[i] ] );\n\t\t\t\ttmp.push( tuple[ i ] );\n\t\t\t}\n\t\t\treturn factory( f, opts )( tmp, dtype );\n\t\t}\n\n\t\t/**\n\t\t* Tests whether at least one tuple element passes a test implemented by a predicate function.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} predicate - predicate function\n\t\t* @param {*} [thisArg] - execution context\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {boolean} boolean indicating if at least one element passes\n\t\t*/\n\t\tfunction some( predicate, thisArg ) {\n\t\t\tvar bool;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( !isFunction( predicate ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tbool = predicate.call( thisArg, tuple[ i ], i, fields[ indices[i] ], tuple );\n\t\t\t\tif ( bool ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* Sorts a tuple in-place.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - The comparison function is provided two tuple elements, `a` and `b`, per invocation, and its return value determines the sort order as follows:\n\t\t*\n\t\t* - If the comparison function returns a value **less** than zero, then the function sorts `a` to an index lower than `b` (i.e., `a` should come **before** `b`).\n\t\t* - If the comparison function returns a value **greater** than zero, then the function sorts `a` to an index higher than `b` (i.e., `b` should come **before** `a`).\n\t\t* - If the comparison function returns **zero**, then the relative order of `a` and `b` _should_ remain unchanged.\n\t\t*\n\t\t* - Invoking this method does **not** affect tuple field assignments.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {Function} [compareFunction] - function which specifies the sort order\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be a function\n\t\t* @returns {TypedArray} sorted tuple\n\t\t*/\n\t\tfunction sort( compareFunction ) {\n\t\t\tvar clbk;\n\t\t\tvar tmp;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tvar k;\n\t\t\tvar v;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length ) {\n\t\t\t\tif ( !isFunction( compareFunction ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFunction ) );\n\t\t\t\t}\n\t\t\t\tclbk = compareFunction;\n\t\t\t} else {\n\t\t\t\tclbk = ascending;\n\t\t\t}\n\t\t\tindices.sort( wrapper );\n\n\t\t\t// Create a temporary indices array which we'll reorder as we rearrange the tuple elements:\n\t\t\ttmp = indices.slice();\n\n\t\t\t// Rearrange tuple elements according to the rearranged indices (note: every \"move\" moves a tuple element to its desired position with runtime complexity O(N))...\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t// Check if we need to move a tuple element:\n\t\t\t\tif ( tmp[ i ] !== i ) {\n\t\t\t\t\tv = tuple[ i ];\n\t\t\t\t\tj = i;\n\t\t\t\t\tk = tmp[ j ];\n\n\t\t\t\t\t// Follow \"cycles\", stopping once we are back at index `i`...\n\t\t\t\t\twhile ( k !== i ) {\n\t\t\t\t\t\ttuple[ j ] = tuple[ k ];\n\t\t\t\t\t\ttmp[ j ] = j;\n\t\t\t\t\t\tj = k;\n\t\t\t\t\t\tk = tmp[ j ];\n\t\t\t\t\t}\n\t\t\t\t\ttuple[ j ] = v;\n\t\t\t\t\ttmp[ j ] = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tuple;\n\n\t\t\t/**\n\t\t\t* Wraps a comparison function to allow sorting the internal indices array rather than the tuple directly.\n\t\t\t*\n\t\t\t* @private\n\t\t\t* @param {NonNegativeInteger} ia - first index\n\t\t\t* @param {NonNegativeInteger} ib - second index\n\t\t\t* @returns {*} value specifying the sort order\n\t\t\t*/\n\t\t\tfunction wrapper( ia, ib ) {\n\t\t\t\tvar a = tuple[ indices[ ia ] ];\n\t\t\t\tvar b = tuple[ indices[ ib ] ];\n\t\t\t\treturn clbk( a, b );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t* Creates a new tuple over the same underlying `ArrayBuffer` and with the same underlying data type as the host tuple.\n\t\t*\n\t\t* ## Notes\n\t\t*\n\t\t* - If the function is unable to resolve indices to a non-empty tuple subsequence, the function returns `null`.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @param {integer} [begin=0] - start element index (inclusive)\n\t\t* @param {integer} [end=tuple.length] - end element index (exclusive)\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @throws {TypeError} first argument must be an integer\n\t\t* @throws {TypeError} second argument must be an integer\n\t\t* @returns {(TypedArray|null)} new tuple\n\t\t*/\n\t\tfunction subtuple( begin, end ) {\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tvar j;\n\t\t\tvar k;\n\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tif ( arguments.length === 0 ) {\n\t\t\t\treturn namedtypedtuple( tuple.buffer, tuple.byteOffset, dtype );\n\t\t\t}\n\t\t\ti = begin;\n\t\t\tif ( !isInteger( i ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t\t}\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = nfields + i;\n\t\t\t\tif ( i < 0 ) {\n\t\t\t\t\ti = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\tj = nfields;\n\t\t\t} else {\n\t\t\t\tj = end;\n\t\t\t\tif ( !isInteger( j ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t\t}\n\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\tj = nfields + j;\n\t\t\t\t\tif ( j < 0 ) {\n\t\t\t\t\t\tj = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if ( j > nfields ) {\n\t\t\t\t\tj = nfields;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( i >= j ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tf = [];\n\t\t\tfor ( k = i; k < j; k++ ) {\n\t\t\t\tf.push( fields[ indices[k] ] );\n\t\t\t}\n\t\t\treturn factory( f, opts )( tuple.buffer, tuple.byteOffset+(i*tuple.BYTES_PER_ELEMENT), dtype );\n\t\t}\n\n\t\t/**\n\t\t* Serializes a tuple as JSON.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {JSON} tuple JSON representation\n\t\t*/\n\t\tfunction toJSON() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tout = {};\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout[ fields[i] ] = tuple[ indices[i] ];\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// TODO: consider adding `toLocaleString()` in a manner similar to `toString()` below\n\n\t\t/**\n\t\t* Serializes a tuple as a string.\n\t\t*\n\t\t* @private\n\t\t* @memberof tuple\n\t\t* @throws {TypeError} `this` must be the host tuple\n\t\t* @returns {string} tuple string representation\n\t\t*/\n\t\tfunction toString() {\n\t\t\tvar out;\n\t\t\tvar i;\n\t\t\tif ( this !== tuple ) { // eslint-disable-line no-invalid-this\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not host tuple.' );\n\t\t\t}\n\t\t\tout = opts.name + '(';\n\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\tout += fields[ i ];\n\t\t\t\tout += '=';\n\t\t\t\tout += tuple[ indices[ i ] ];\n\t\t\t\tif ( i < nfields-1 ) {\n\t\t\t\t\tout += ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tout += ')';\n\t\t\treturn out;\n\t\t}\n\t}\n\n\t// Note: keep the following methods in alphabetical order...\n\n\t/**\n\t* Creates a new tuple from an array-like object or an iterable.\n\t*\n\t* @private\n\t* @name from\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {(ArrayLikeObject|Iterable)} src - array-like object or iterable\n\t* @param {Function} [clbk] - callback to invoke for each source element\n\t* @param {*} [thisArg] - callback execution context\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {TypeError} first argument must be an array-like object or an iterable\n\t* @throws {RangeError} source must be compatible with tuple length\n\t* @throws {TypeError} second argument must be a function\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'from', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function from( src ) { // eslint-disable-line no-restricted-syntax\n\t\t\tvar thisArg;\n\t\t\tvar nargs;\n\t\t\tvar tuple;\n\t\t\tvar clbk;\n\t\t\tvar tmp;\n\t\t\tvar it;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tnargs = arguments.length;\n\t\t\tif ( nargs > 1 ) {\n\t\t\t\tclbk = arguments[ 1 ];\n\t\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs > 2 ) {\n\t\t\t\t\tthisArg = arguments[ 2 ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isCollection( src ) ) {\n\t\t\t\tif ( src.length !== nfields ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Source is incompatible with the number of tuple fields. Number of fields: `%u`. Source length: `%u`.', nfields, src.length ) );\n\t\t\t\t}\n\t\t\t\ttuple = namedtypedtuple( nfields, opts.dtype );\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\t\ttuple[ i ] = clbk.call( thisArg, src[ i ], i, fields[ i ] );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\t\ttuple[ i ] = src[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tit = src[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( it.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t\t}\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\ttmp = fromIteratorMap( fields, it, clbk, thisArg );\n\t\t\t\t} else {\n\t\t\t\t\ttmp = fromIterator( it );\n\t\t\t\t}\n\t\t\t\ttuple = namedtypedtuple( tmp, opts.dtype );\n\t\t\t} else {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\t});\n\n\t/**\n\t* Creates a new tuple from an object containing tuple fields.\n\t*\n\t* @private\n\t* @name fromObject\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {Object} obj - source object\n\t* @param {Function} [clbk] - callback to invoke for each source object tuple field\n\t* @param {*} [thisArg] - callback execution context\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {TypeError} first argument must be an object\n\t* @throws {TypeError} second argument must be a function\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'fromObject', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function fromObject( obj ) { // eslint-disable-line no-restricted-syntax\n\t\t\tvar thisArg;\n\t\t\tvar nargs;\n\t\t\tvar tuple;\n\t\t\tvar clbk;\n\t\t\tvar f;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tif ( obj === null || typeof obj !== 'object' ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t\t\t}\n\t\t\tnargs = arguments.length;\n\t\t\tif ( nargs > 1 ) {\n\t\t\t\tclbk = arguments[ 1 ];\n\t\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs > 2 ) {\n\t\t\t\t\tthisArg = arguments[ 2 ];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttuple = namedtypedtuple( nfields, opts.dtype );\n\t\t\tif ( clbk ) {\n\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\tf = fields[ i ];\n\t\t\t\t\tif ( hasOwnProp( obj, f ) ) {\n\t\t\t\t\t\ttuple[ i ] = clbk.call( thisArg, obj[ f ], f );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i = 0; i < nfields; i++ ) {\n\t\t\t\t\tf = fields[ i ];\n\t\t\t\t\tif ( hasOwnProp( obj, f ) ) {\n\t\t\t\t\t\ttuple[ i ] = obj[ f ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tuple;\n\t\t}\n\t});\n\n\t/**\n\t* Creates a new tuple from a variable number of arguments.\n\t*\n\t* @private\n\t* @name of\n\t* @memberof namedtypedtuple\n\t* @type {Function}\n\t* @param {...number} element - tuple elements\n\t* @throws {TypeError} `this` must be the host tuple factory\n\t* @throws {RangeError} incompatible number of arguments\n\t* @returns {TypedArray} new tuple\n\t*/\n\tdefineProperty( namedtypedtuple, 'of', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': function of() { // eslint-disable-line no-restricted-syntax\n\t\t\tvar args;\n\t\t\tvar i;\n\t\t\tif ( this !== namedtypedtuple ) {\n\t\t\t\tthrow new TypeError( 'invalid invocation. `this` is not the host tuple factory.' );\n\t\t\t}\n\t\t\tif ( arguments.length !== nfields ) {\n\t\t\t\tthrow new RangeError( format( 'invalid invocation. Number of arguments is incompatible with the number of tuple fields. Number of fields: `%u`. Number of arguments: `%u`.', nfields, arguments.length ) );\n\t\t\t}\n\t\t\targs = [];\n\t\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\t\targs.push( arguments[ i ] );\n\t\t\t}\n\t\t\treturn namedtypedtuple( args );\n\t\t}\n\t});\n\n\treturn namedtypedtuple;\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Named typed tuple.\n*\n* @module @stdlib/utils/named-typed-tuple\n*\n* @example\n* var namedtypedtuple = require( '@stdlib/utils/named-typed-tuple' );\n*\n* var point = namedtypedtuple( [ 'x', 'y' ] );\n*\n* var p = point( [ 1.0, -1.0 ] );\n*\n* var x = p[ 0 ];\n* // returns 1.0\n*\n* x = p.x;\n* // returns 1.0\n*\n* var y = p[ 1 ];\n* // returns -1.0\n*\n* y = p.y;\n* // returns -1.0\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies a specified number of arguments to a provided function.\n*\n* ## Notes\n*\n* - The returned function **always** invokes the wrapped function with a specified number of arguments, even when the returned function is provided fewer arguments. The value for the missing arguments is equal to `undefined`.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeInteger} arity - number of arguments\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a nonnegative integer\n* @returns {Function} function wrapper\n*\n* @example\n* function foo() {\n* var s;\n* var i;\n*\n* s = 0;\n* for ( i = 0; i < arguments.length; i++ ) {\n* s += arguments[ i ];\n* }\n* return s;\n* }\n*\n* var bar = naryFunction( foo, 2 );\n*\n* var out = bar( 1, 2, 3, 4, 5, 6 );\n* // returns 3\n*/\nfunction naryFunction( fcn, arity, thisArg ) {\n\tvar fcns;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeInteger( arity ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', arity ) );\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( arity < fcns.length ) ? fcns[ arity ] : nary;\n\n\t/**\n\t* Invokes a nullary function.\n\t*\n\t* @private\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary( x ) {\n\t\treturn fcn.call( thisArg, x );\n\t}\n\n\t/**\n\t* Invokes a binary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary( x, y ) {\n\t\treturn fcn.call( thisArg, x, y );\n\t}\n\n\t/**\n\t* Invokes a ternary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary( x, y, z ) {\n\t\treturn fcn.call( thisArg, x, y, z );\n\t}\n\n\t/**\n\t* Invokes a quaternary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary( x, y, z, w ) {\n\t\treturn fcn.call( thisArg, x, y, z, w );\n\t}\n\n\t/**\n\t* Invokes a quinary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {*} v - input value\n\t* @param {...*} [args] - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary( x, y, z, w, v ) {\n\t\treturn fcn.call( thisArg, x, y, z, w, v );\n\t}\n\n\t/**\n\t* Invokes an n-ary function.\n\t*\n\t* @private\n\t* @param {*} x - input value\n\t* @param {*} y - input value\n\t* @param {*} z - input value\n\t* @param {*} w - input value\n\t* @param {*} v - input value\n\t* @param {*} t - input value\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary( x, y, z, w, v, t ) {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [ x, y, z, w, v, t ];\n\t\tfor ( i = 6; i < arity; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = naryFunction;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies a specified number arguments to a provided function.\n*\n* @module @stdlib/utils/nary-function\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* function foo() {\n* var s;\n* var i;\n*\n* s = 0;\n* for ( i = 0; i < arguments.length; i++ ) {\n* s += arguments[ i ];\n* }\n* return s;\n* }\n*\n* var bar = naryFunction( foo, 2 );\n*\n* var out = bar( 1, 2, 3, 4, 5, 6 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar proc = require( 'process' );\n\n\n// MAIN //\n\n/**\n* Adds a callback to the \"next tick queue\".\n*\n* ## Notes\n*\n* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.\n*\n* @param {Callback} clbk - callback\n* @param {...*} [args] - arguments to provide to the callback upon invocation\n*\n* @example\n* function beep() {\n* console.log( 'boop' );\n* }\n*\n* nextTick( beep );\n*/\nfunction nextTick( clbk ) {\n\tvar args;\n\tvar i;\n\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\tproc.nextTick( wrapper );\n\n\t/**\n\t* Callback wrapper.\n\t*\n\t* ## Notes\n\t*\n\t* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.\n\t*\n\t* @private\n\t*/\n\tfunction wrapper() {\n\t\tclbk.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = nextTick;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a callback to the \"next tick queue\".\n*\n* @module @stdlib/utils/next-tick\n*\n* @example\n* var nextTick = require( '@stdlib/utils/next-tick' );\n*\n* function beep() {\n* console.log( 'boop' );\n* }\n*\n* nextTick( beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar base = require( '@stdlib/array/base/none' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection are falsy.\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} must provide a collection\n* @returns {boolean} boolean indicating whether all elements are falsy\n*\n* @example\n* var arr = [ 0, 0, 0, 0, 0 ];\n*\n* var bool = none( arr );\n* // returns true\n*/\nfunction none( collection ) {\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );\n\t}\n\treturn base( collection );\n}\n\n\n// EXPORTS //\n\nmodule.exports = none;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection are falsy.\n*\n* @module @stdlib/utils/none\n*\n* @example\n* var none = require( '@stdlib/utils/none' );\n*\n* var arr = [ 0, 0, 0, 0, 0 ];\n*\n* var bool = none( arr );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\nfunction noneBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils/none-by\n*\n* @example\n* var none = require( '@stdlib/utils/none-by' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `noneBy` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `noneBy()`, `[].push()` behavior is consistent with `noneByRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneByRight( arr, isPositive );\n* // returns true\n*/\nfunction noneByRight( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/none-by-right\n*\n* @example\n* var noneByRight = require( '@stdlib/utils/none-by-right' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneByRight( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isNonEnumerable = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable property names and symbols\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* obj.a = 'a';\n* defineProperty( obj, 'b', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'b'\n* });\n*\n* var props = nonEnumerableProperties( obj );\n* // returns [ 'b' ]\n*/\nfunction nonEnumerableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar n;\n\tvar i;\n\n\tout = propertyNames( value );\n\tn = 0;\n\tfor ( i = 0; i < out.length; i++ ) {\n\t\tif ( isNonEnumerable( value, out[ i ] ) ) {\n\t\t\tout[ n ] = out[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tout.length = n;\n\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isNonEnumerable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/nonenumerable-properties\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerableProperties = require( '@stdlib/utils/nonenumerable-properties' );\n*\n* var obj = {};\n*\n* obj.a = 'a';\n* defineProperty( obj, 'b', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'b'\n* });\n*\n* var props = nonEnumerableProperties( obj );\n* // returns [ 'b' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isNonEnumerable = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable property names and symbols\n*\n* @example\n* var props = nonEnumerablePropertiesIn( [] );\n* // returns [...]\n*/\nfunction nonEnumerablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting non-enumerable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisNonEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisNonEnumerable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/nonenumerable-properties-in\n*\n* @example\n* var nonEnumerablePropertiesIn = require( '@stdlib/utils/nonenumerable-properties-in' );\n*\n* var props = nonEnumerablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNames( obj );\n* // returns [ 'beep' ]\n*/\nfunction nonEnumerablePropertyNames( value ) { // eslint-disable-line id-length\n\tvar names;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tnames = getOwnPropertyNames( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tif ( isNonEnumerableProperty( value, names[ i ] ) ) {\n\t\t\tnames[ n ] = names[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tnames.length = n;\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable property names.\n*\n* @module @stdlib/utils/nonenumerable-property-names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerablePropertyNames = require( '@stdlib/utils/nonenumerable-property-names' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNames( obj );\n* // returns [ 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNamesIn( obj );\n* // e.g., returns [ 'beep', ... ]\n*/\nfunction nonEnumerablePropertyNamesIn( value ) { // eslint-disable-line id-length\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting non-enumerable property names...\n\tnames = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable property names.\n*\n* @module @stdlib/utils/nonenumerable-property-names-in\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var nonEnumerablePropertyNamesIn = require( '@stdlib/utils/nonenumerable-property-names-in' );\n*\n* var obj = {};\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': false,\n* 'enumerable': false,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = nonEnumerablePropertyNamesIn( obj );\n* // e.g., returns [ 'beep', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own non-enumerable symbol properties\n*\n* @example\n* var symbols = nonEnumerablePropertySymbols( {} );\n*/\nfunction nonEnumerablePropertySymbols( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isNonEnumerableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own non-enumerable symbol properties.\n*\n* @module @stdlib/utils/nonenumerable-property-symbols\n*\n* @example\n* var nonEnumerablePropertySymbols = require( '@stdlib/utils/nonenumerable-property-symbols' );\n*\n* var symbols = nonEnumerablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited non-enumerable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited non-enumerable symbol properties\n*\n* @example\n* var symbols = nonEnumerablePropertySymbolsIn( {} );\n*/\nfunction nonEnumerablePropertySymbolsIn( value ) { // eslint-disable-line id-length\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all non-enumerable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisNonEnumerableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonEnumerablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited non-enumerable symbol properties.\n*\n* @module @stdlib/utils/nonenumerable-property-symbols-in\n*\n* @example\n* var nonEnumerablePropertySymbolsIn = require( '@stdlib/utils/nonenumerable-property-symbols-in' );\n*\n* var symbols = nonEnumerablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\n\n\n// VARIABLES //\n\nvar RE_INTEGER_INDEX = /^[0-9]+$/;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names which are not integer indices.\n*\n* @param {ObjectLike} obj - input object\n* @returns {Array} key array\n*\n* @example\n* function Foo() {\n* this[ 0 ] = 3.14;\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = nonIndexKeys( obj );\n* // e.g., returns [ 'beep' ]\n*/\nfunction nonIndexKeys( obj ) {\n\tvar keys;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tN = len;\n\tj = 0;\n\n\t// Compress the list of keys by using a lagging index and moving non-integer indices to earlier positions in the array...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( RE_INTEGER_INDEX.test( keys[ i ] ) ) {\n\t\t\tN -= 1;\n\t\t} else {\n\t\t\tkeys[ j ] = keys[ i ];\n\t\t\tj += 1;\n\t\t}\n\t}\n\tkeys.length = N;\n\treturn keys;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nonIndexKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property names which are not integer indices.\n*\n* @module @stdlib/utils/nonindex-keys\n*\n* @example\n* var nonIndexKeys = require( '@stdlib/utils/nonindex-keys' );\n*\n* function Foo() {\n* this[ 0 ] = 3.14;\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var keys = nonIndexKeys( obj );\n* // e.g., returns [ 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must an an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invert;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invert an object, such that keys become values and values become keys.\n*\n* @module @stdlib/utils/object-inverse\n*\n* @example\n* var invert = require( '@stdlib/utils/object-inverse' );\n*\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys, according to a transform function.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @param {Function} transform - transform function\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} options argument must an an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* function transform( key, value ) {\n* return key + value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'abeep': 'a', 'bboop': 'b' }\n*\n* @example\n* function transform( key, value ) {\n* return value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'beep'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* function transform( key, value ) {\n* return value;\n* }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var opts = {\n* 'duplicates': false\n* };\n* var out = invertBy( obj, opts, transform );\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invertBy( obj, opts, transform ) {\n\tvar allowDupes;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar cb;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tallowDupes = true;\n\tif ( arguments.length === 2 ) {\n\t\tcb = opts;\n\t} else {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t\tcb = transform;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = cb( key, obj[ key ], obj );\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = cb( key, obj[ key ], obj );\n\t\t\tout[ val ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invertBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invert an object, such that keys become values and values become keys, according to a transform function.\n*\n* @module @stdlib/utils/object-inverse-by\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return key + value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'boop'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'abeep': 'a', 'bboop': 'b' }\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return value;\n* }\n* var obj = {\n* 'a': 'beep',\n* 'b': 'beep'\n* };\n* var out = invertBy( obj, transform );\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var invertBy = require( '@stdlib/utils/object-inverse-by' );\n*\n* function transform( key, value ) {\n* return value;\n* }\n*\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var opts = {\n* 'duplicates': false\n* };\n* var out = invertBy( obj, opts, transform );\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy excluding specified keys.\n*\n* @param {Object} obj - source object\n* @param {(string|StringArray)} keys - keys to exclude\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be either a string or an array of strings\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omit( obj1, 'b' );\n* // returns { 'a': 1 }\n*/\nfunction omit( obj, keys ) {\n\tvar ownKeys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\townKeys = objectKeys( obj );\n\tout = {};\n\tif ( isString( keys ) ) {\n\t\tfor ( i = 0; i < ownKeys.length; i++ ) {\n\t\t\tkey = ownKeys[ i ];\n\t\t\tif ( key !== keys ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tif ( isStringArray( keys ) ) {\n\t\tfor ( i = 0; i < ownKeys.length; i++ ) {\n\t\t\tkey = ownKeys[ i ];\n\t\t\tif ( indexOf( keys, key ) === -1 ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be either a string or an array of strings. Value: `%s`.', keys ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = omit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy excluding specified keys.\n*\n* @module @stdlib/utils/omit\n*\n* @example\n* var omit = require( '@stdlib/utils/omit' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omit( obj1, 'b' );\n* // returns { 'a': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy excluding properties for which a predicate returns a truthy value.\n*\n* @param {Object} obj - source object\n* @param {Function} predicate - predicate function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omitBy( obj1, predicate );\n* // returns { 'a': 1 }\n*/\nfunction omitBy( obj, predicate ) {\n\tvar keys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tout = {};\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tif ( !predicate( key, obj[ key ] ) ) {\n\t\t\tout[ key ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = omitBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy excluding properties for which a predicate (function) returns a truthy value.\n*\n* @module @stdlib/utils/omit-by\n*\n* @example\n* var omitBy = require( '@stdlib/utils/omit-by' );\n*\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = omitBy( obj1, predicate );\n* // returns { 'a': 1 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar spawn = require( 'child_process' ).spawn;\nvar IS_WINDOWS = require( '@stdlib/assert/is-windows' );\nvar IS_DARWIN = require( '@stdlib/assert/is-darwin' );\nvar format = require( '@stdlib/string/format' );\nvar isURI = require( '@stdlib/assert/is-uri' );\n\n\n// VARIABLES //\n\nvar ARGS;\nvar CMD;\n\n// Mac:\nif ( IS_DARWIN ) {\n\tCMD = 'open';\n\tARGS = [];\n}\n// On Windows, ideally, we would use the `start` command; however, the rules regarding argument spacing and escaping are complex. Instead, we can use `cmd /c` which has built-in logic to address these rules.\nelse if ( IS_WINDOWS ) {\n\tCMD = 'cmd';\n\n\t// `cmd /c` interprets double-quoted first parameters as window titles. To work around this, we explicitly provide an empty string for the window title.\n\tARGS = [ '/c', 'start', '\"\"' ];\n}\n// All other `*nix` flavors:\nelse {\n\tCMD = 'xdg-open';\n\tARGS = [];\n}\n\n\n// MAIN //\n\n/**\n* Opens a URL.\n*\n* @param {string} url - URL to open\n* @throws {TypeError} must provide a valid URI\n* @returns {Process} spawned process (unreferenced)\n*\n* @example\n* var proc = openURL( 'https://google.com' );\n*/\nfunction openURL( url ) {\n\tvar args;\n\tvar proc;\n\tvar i;\n\tif ( !isURI( url ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a valid URI. Value: `%s`.', url ) );\n\t}\n\targs = new Array( ARGS.length );\n\tfor ( i = 0; i < ARGS.length; i++ ) {\n\t\targs[ i ] = ARGS[ i ];\n\t}\n\tif ( IS_WINDOWS ) {\n\t\t// `&` characters must be escaped when passed to `start`:\n\t\turl = url.replace( /&/g, '^&' );\n\t}\n\targs.push( url );\n\n\t// Spawn a child process to open the URL:\n\tproc = spawn( CMD, args, {} );\n\n\t// To prevent the parent process waiting on the child process, we unreference the process to remove it from the parent's reference count:\n\tproc.unref();\n\n\treturn proc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = openURL;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Open a URL.\n*\n* @module @stdlib/utils/open-url\n*\n* @example\n* var openURL = require( '@stdlib/utils/open-url' );\n*\n* var proc = openURL( 'https://google.com' );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function of smaller arity by partially applying arguments.\n*\n* @param {Function} fcn - function to partially apply\n* @param {...*} [args] - arguments to partially apply\n* @throws {TypeError} first argument must be a function\n* @returns {Function} partially applied function\n*\n* @example\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var add2 = papply( add, 2 );\n*\n* var sum = add2( 3 );\n* // returns 5\n*/\nfunction papply( fcn ) {\n\tvar pargs;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tpargs = new Array( arguments.length-1 );\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\tpargs[ i-1 ] = arguments[ i ];\n\t}\n\treturn papplied;\n\n\t/**\n\t* Partially applied function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*} partially applied function result\n\t*/\n\tfunction papplied() {\n\t\tvar args;\n\t\tvar j;\n\t\targs = pargs.slice();\n\t\tfor ( j = 0; j < arguments.length; j++ ) {\n\t\t\targs.push( arguments[ j ] );\n\t\t}\n\t\treturn fcn.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = papply;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Partially apply function arguments.\n*\n* @module @stdlib/utils/papply\n*\n* @example\n* var papply = require( '@stdlib/utils/papply' );\n*\n* function add( x, y ) {\n* return x + y;\n* }\n*\n* var add2 = papply( add, 2 );\n*\n* var sum = add2( 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function of smaller arity by partially applying arguments from the right.\n*\n* @param {Function} fcn - function to partially apply\n* @param {...*} [args] - arguments to partially apply\n* @throws {TypeError} first argument must be a function\n* @returns {Function} partially applied function\n*\n* @example\n* function say( text, name ) {\n* return text + ', ' + name + '.';\n* }\n*\n* var toGrace = papplyRight( say, 'Grace Hopper' );\n*\n* var str = toGrace( 'Hello' );\n* // returns 'Hello, Grace Hopper.'\n*\n* str = toGrace( 'Thank you' );\n* // returns 'Thank you, Grace Hopper.'\n*/\nfunction papplyRight( fcn ) {\n\tvar pargs;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = arguments.length - 1;\n\tpargs = new Array( len );\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\tpargs[ i-1 ] = arguments[ i ];\n\t}\n\treturn pappliedRight;\n\n\t/**\n\t* Partially applied function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*} partially applied function result\n\t*/\n\tfunction pappliedRight() {\n\t\tvar nargs;\n\t\tvar args;\n\t\tvar j;\n\t\tnargs = arguments.length;\n\t\targs = new Array( len+nargs );\n\t\tfor ( j = 0; j < args.length; j++ ) {\n\t\t\tif ( j >= nargs ) {\n\t\t\t\targs[ j ] = pargs[ j-nargs ];\n\t\t\t} else {\n\t\t\t\targs[ j ] = arguments[ j ];\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = papplyRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Partially apply function arguments from the right.\n*\n* @module @stdlib/utils/papply-right\n*\n* @example\n* var papplyRight = require( '@stdlib/utils/papply-right' );\n*\n* function say( text, name ) {\n* return text + ', ' + name + '.';\n* }\n*\n* var toGrace = papplyRight( say, 'Grace Hopper' );\n*\n* var str = toGrace( 'Hello' );\n* // returns 'Hello, Grace Hopper.'\n*\n* str = toGrace( 'Thank you' );\n* // returns 'Thank you, Grace Hopper.'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numCPUs = require( '@stdlib/os/num-cpus' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Number of workers:\n\t\t'workers': numCPUs - 1,\n\n\t\t// Number of scripts to execute concurrently:\n\t\t'concurrency': numCPUs - 1,\n\n\t\t// Executable file/command:\n\t\t'cmd': 'node',\n\n\t\t// Boolean indicating whether script output can be interleaved or must be ordered:\n\t\t'ordered': false,\n\n\t\t// Process user identity:\n\t\t'uid': null,\n\n\t\t// Process group identity:\n\t\t'gid': null,\n\n\t\t// `stdio` encoding:\n\t\t'encoding': 'buffer',\n\n\t\t// Max child process `stdio` buffer size:\n\t\t'maxBuffer': 200 * 1024 * 1024 // bytes\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {string} [options.cmd] - executable file/command\n* @param {PositiveInteger} [options.concurrency] - number of scripts to execute concurrently\n* @param {PositiveInteger} [options.workers] - number of workers\n* @param {boolean} [options.ordered] - boolean indicating whether to preserve the order of script output\n* @param {NonNegativeInteger} [options.uid] - process user identity\n* @param {NonNegativeInteger} [options.gid] - process group identity\n* @param {NonNegativeInteger} [options.maxBuffer] - max child process `stdio` buffer size\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'concurrency': 4,\n* 'workers': 2\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'concurrency' ) ) {\n\t\topts.concurrency = options.concurrency;\n\t\tif ( !isPositiveInteger( opts.concurrency ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'concurrency', opts.concurrency ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'workers' ) ) {\n\t\topts.workers = options.workers;\n\t\tif ( !isPositiveInteger( opts.workers ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'workers', opts.workers ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'cmd' ) ) {\n\t\topts.cmd = options.cmd;\n\t\tif ( !isString( opts.cmd ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'cmd', opts.cmd ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'ordered' ) ) {\n\t\topts.ordered = options.ordered;\n\t\tif ( !isBoolean( opts.ordered ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'ordered', opts.ordered ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'uid' ) ) {\n\t\topts.uid = options.uid;\n\t\tif ( !isNonNegativeInteger( opts.uid ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'uid', opts.uid ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'gid' ) ) {\n\t\topts.gid = options.gid;\n\t\tif ( !isNonNegativeInteger( opts.gid ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'gid', opts.gid ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'maxBuffer' ) ) {\n\t\topts.maxBuffer = options.maxBuffer;\n\t\tif ( !isNonNegativeInteger( opts.maxBuffer ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'maxBuffer', opts.maxBuffer ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../../keys' );\nvar ENV = require( '@stdlib/process/env' );\n\n\n// FUNCTIONS //\n\n/**\n* Copies `process.env`.\n*\n* ## Notes\n*\n* - This implementation accommodates `process.env` on older Node.js versions (<=v0.10.x), where `process.env` was object-like, but would show unexpected behavior when attempting to get own property descriptors.\n*\n* @private\n* @returns {Object} copy of `process.env`\n*/\nfunction copy() {\n\tvar keys;\n\tvar env;\n\tvar out;\n\tvar i;\n\n\tkeys = objectKeys( ENV );\n\tout = {};\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tenv = keys[ i ];\n\t\tout[ env ] = ENV[ env ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns worker environment variables.\n*\n* @private\n* @param {Options} opts - options\n* @param {string} opts.cmd - executable file/command\n* @param {boolean} opts.ordered - boolean indicating whether to preserve order of script output\n* @param {(NonNegativeInteger|null)} opts.uid - process user identity\n* @param {(NonNegativeInteger|null)} opts.gid - process group identity\n* @param {string} opts.encoding - `stdio` encoding\n* @param {NonNegativeInteger} opts.maxBuffer - max child process `stdio` buffer size\n* @returns {Object} environment variables\n*/\nfunction env( opts ) {\n\tvar out = copy();\n\n\tout.WORKER_CMD = opts.cmd;\n\tout.WORKER_ENCODING = opts.encoding;\n\tout.WORKER_MAX_BUFFER = opts.maxBuffer;\n\n\tif ( opts.ordered ) {\n\t\tout.WORKER_ORDERED = '1';\n\t}\n\tif ( opts.uid ) {\n\t\tout.WORKER_UID = opts.uid;\n\t}\n\tif ( opts.gid ) {\n\t\tout.WORKER_GID = opts.gid;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = env;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cwd = require( '@stdlib/process/cwd' );\nvar env = require( './env.js' );\n\n\n// MAIN //\n\n/**\n* Returns child process options.\n*\n* @private\n* @param {Options} options - worker options\n* @param {(NonNegativeInteger|null)} [options.uid] - process user identity\n* @param {(NonNegativeInteger|null)} [options.gid] - process group identity\n* @returns {Object} child process options\n*/\nfunction getOpts( options ) {\n\tvar opts = {\n\t\t'cwd': cwd(),\n\t\t'env': env( options ),\n\t\t'stdio': 'inherit' // Use stdio of parent process\n\t};\n\tif ( options.uid ) {\n\t\topts.uid = options.uid;\n\t}\n\tif ( options.gid ) {\n\t\topts.gid = options.gid;\n\t}\n\treturn opts;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getOpts;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fork = require( 'child_process' ).fork;\nvar path = require( 'path' );\nvar logger = require( 'debug' );\nvar objectKeys = require( './../../../keys' );\nvar format = require( '@stdlib/string/format' );\nvar getOpts = require( './options.js' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'parallel:exec' );\nvar WORKER_FILEPATH = path.resolve( __dirname, './worker/index.js' );\n\n\n// MAIN //\n\n/**\n* Executes scripts in parallel.\n*\n* @private\n* @param {StringArray} files - script absolute file paths\n* @param {Options} opts - options\n* @param {PositiveInteger} opts.concurrency - number of scripts to execute concurrently\n* @param {PositiveInteger} opts.workers - number of workers\n* @param {string} opts.cmd - executable file/command\n* @param {boolean} opts.ordered - boolean indicating whether to preserve order of script output\n* @param {(NonNegativeInteger|null)} opts.uid - process user identity\n* @param {(NonNegativeInteger|null)} opts.gid - process group identity\n* @param {string} opts.encoding - `stdio` encoding\n* @param {NonNegativeInteger} opts.maxBuffer - max child process `stdio` buffer size\n* @param {Callback} clbk - callback to invoke after executing all scripts\n*/\nfunction exec( files, opts, clbk ) {\n\tvar numClosed;\n\tvar workers;\n\tvar pending;\n\tvar fopts;\n\tvar args;\n\tvar proc;\n\tvar pids;\n\tvar pid;\n\tvar idx;\n\tvar err;\n\tvar i;\n\n\tdebug( 'Options: %s.', JSON.stringify( opts ) );\n\tnumClosed = 0;\n\n\tdebug( 'Creating %d workers...', opts.workers );\n\tworkers = {};\n\targs = [];\n\tfopts = getOpts( opts );\n\tfor ( i = 0; i < opts.workers; i++ ) {\n\t\tdebug( 'Creating child process...' );\n\t\tproc = fork( WORKER_FILEPATH, args, fopts );\n\n\t\tproc.on( 'error', onError( proc ) );\n\t\tproc.on( 'close', onClose( proc ) );\n\t\tproc.on( 'exit', onExit( proc ) );\n\t\tproc.on( 'disconnect', onDisconnect( proc ) );\n\t\tproc.on( 'message', onMessage( proc ) );\n\n\t\tdebug( 'Child process created. pid: %d.', proc.pid );\n\t\tworkers[ proc.pid ] = proc;\n\t}\n\tpids = objectKeys( workers );\n\tdebug( '%d workers created.', pids.length );\n\n\tdebug( 'Running %d scripts concurrently...', opts.concurrency );\n\tpending = {};\n\tidx = -1;\n\tfor ( i = 0; i < opts.concurrency; i++ ) {\n\t\tpid = pids[ i%pids.length ];\n\t\tnext( workers[ pid ] ); // eslint-disable-line node/callback-return\n\t}\n\n\t/**\n\t* Instructs a child process to run the next script.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {void}\n\t*/\n\tfunction next( child ) {\n\t\tvar numPending;\n\t\tidx += 1;\n\t\tif ( idx >= files.length ) {\n\t\t\tnumPending = objectKeys( pending ).length;\n\t\t\tif ( numPending > 0 ) {\n\t\t\t\tdebug( '%d scripts are pending.', numPending );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebug( 'All scripts have finished.' );\n\t\t\treturn close();\n\t\t}\n\t\tdebug( 'Instructing child process to run script: %s. pid: %d.', files[ idx ], child.pid );\n\t\tchild.send( files[ idx ] );\n\t\tpending[ files[ idx ] ] = true;\n\n\t\tdebug( '%d of %d scripts have been processed.', idx, files.length );\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon receiving a message from a child process.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onMessage( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon receiving a message from a child process.\n\t\t*\n\t\t* @private\n\t\t* @param {string} filepath - script filepath\n\t\t*/\n\t\tfunction listener( filepath ) {\n\t\t\tdebug( 'Child process message: %s. pid: %d.', filepath, child.pid );\n\n\t\t\t// Remove the script from the listing of pending scripts:\n\t\t\tdelete pending[ filepath ];\n\n\t\t\t// Indicate that the child process is ready for its next task:\n\t\t\tnext( child );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process close.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onClose( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process close.\n\t\t*\n\t\t* @private\n\t\t* @param {(number|null)} code - exit code\n\t\t* @param {(string|null)} signal - termination signal\n\t\t*/\n\t\tfunction listener( code, signal ) {\n\t\t\tdebug( 'Child process closed. Code: %d. Signal: %s. pid: %d.', code, signal, child.pid );\n\t\t\tprocessExit( code, signal );\n\t\t\tchildClosed();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked if a child closes.\n\t*\n\t* @private\n\t*/\n\tfunction childClosed() {\n\t\tnumClosed += 1;\n\t\tdebug( '%d of %d child processes have closed.', numClosed, opts.workers );\n\t\tif ( numClosed === opts.workers ) {\n\t\t\tdone(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process exit.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onExit( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process exit.\n\t\t*\n\t\t* @private\n\t\t* @param {(number|null)} code - exit code\n\t\t* @param {(string|null)} signal - termination signal\n\t\t*/\n\t\tfunction listener( code, signal ) {\n\t\t\tdebug( 'Child process exited. Code: %d. Signal: %s. pid: %d.', code, signal, child.pid );\n\t\t\tprocessExit( code, signal );\n\t\t}\n\t}\n\n\t/**\n\t* Closes all workers.\n\t*\n\t* @private\n\t* @param {Error} [error] - error object\n\t*/\n\tfunction close( error ) {\n\t\tvar pids;\n\t\tvar pid;\n\t\tvar i;\n\t\tif ( error && !err ) {\n\t\t\terr = error;\n\t\t}\n\t\tdebug( 'Instructing child processes to close...' );\n\t\tpids = objectKeys( workers );\n\t\tfor ( i = 0; i < pids.length; i++ ) {\n\t\t\tpid = pids[ i ];\n\t\t\tdebug( 'Instructing child process (pid: %d) to close...', pid );\n\t\t\tworkers[ pid ].send( 'close' );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon child process disconnect.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onDisconnect( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon child process disconnect.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction listener() {\n\t\t\tdebug( 'Child process disconnected. pid: %d.', child.pid );\n\t\t}\n\t}\n\n\t/**\n\t* Returns a callback to be invoked upon encountering a child process error.\n\t*\n\t* @private\n\t* @param {Object} child - child process\n\t* @returns {Callback} callback\n\t*/\n\tfunction onError( child ) {\n\t\treturn listener;\n\n\t\t/**\n\t\t* Callback invoked upon a child process error.\n\t\t*\n\t\t* @private\n\t\t* @param {Error} error - error object\n\t\t*/\n\t\tfunction listener( error ) {\n\t\t\tdebug( 'Child process error: %s. pid: %d.', error.message, child.pid );\n\t\t\tclose( error );\n\t\t}\n\t}\n\n\t/**\n\t* Processes process exit values. If provided a non-zero exit code or termination signal, instructs the process to close.\n\t*\n\t* @private\n\t* @param {(number|null)} code - exit code\n\t* @param {(string|null)} signal - termination signal\n\t* @returns {void}\n\t*/\n\tfunction processExit( code, signal ) {\n\t\tvar error;\n\t\tif ( err ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( code !== null && code !== 0 ) {\n\t\t\terror = new Error( format( 'unexpected error. Child process failed with exit code: `%u`.', code ) );\n\t\t} else if ( signal !== null ) {\n\t\t\terror = new Error( format( 'unexpected error. Child process failed due to termination signal: `%s`.', signal ) );\n\t\t}\n\t\tif ( error ) {\n\t\t\terror.code = code;\n\t\t\terror.signal = signal;\n\t\t\treturn close( error );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once all tasks are finished.\n\t*\n\t* @private\n\t* @returns {void}\n\t*/\n\tfunction done() {\n\t\tif ( err ) {\n\t\t\treturn clbk( err );\n\t\t}\n\t\tclbk();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = exec;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar exec = require( './exec.js' );\n\n\n// EXPORTS //\n\nmodule.exports = exec;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar path = require( 'path' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\nvar cwd = require( '@stdlib/process/cwd' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar exec = require( './node' );\n\n\n// MAIN //\n\n/**\n* Executes scripts in parallel.\n*\n* @param {StringArray} files - script file paths\n* @param {Options} [options] - function options\n* @param {string} [options.cmd='node'] - executable file/command\n* @param {PositiveInteger} [options.concurrency] - number of scripts to execute concurrently\n* @param {PositiveInteger} [options.workers] - number of workers\n* @param {boolean} [options.ordered=false] - boolean indicating whether to preserve the order of script output\n* @param {NonNegativeInteger} [options.uid] - process user identity\n* @param {NonNegativeInteger} [options.gid] - process group identity\n* @param {NonNegativeInteger} [options.maxBuffer=200*1024*1024] - max child process `stdio` buffer size\n* @param {Callback} clbk - callback to invoke after executing all scripts\n* @throws {TypeError} first argument must be an array of strings\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} callback argument must be a function\n*\n* @example\n* var files = [ './a.js', './b.js ' ];\n*\n* var opts = {\n* 'workers': 3,\n* 'concurrency': 3\n* };\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n*\n* parallel( files, opts, done );\n*/\nfunction parallel() {\n\tvar options;\n\tvar files;\n\tvar opts;\n\tvar clbk;\n\tvar err;\n\tvar dir;\n\tvar i;\n\n\tfiles = arguments[ 0 ];\n\tif ( !isStringArray( files ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of strings. Value: `%s`.', files ) );\n\t}\n\tfiles = files.slice();\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\toptions = arguments[ 1 ];\n\t\tclbk = arguments[ 2 ];\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t} else {\n\t\tclbk = arguments[ 1 ];\n\t}\n\tif ( !isFunction( clbk ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t}\n\t// Prevent the number of concurrent scripts exceeding the number of actual scripts to run.\n\tif ( opts.concurrency > files.length ) {\n\t\topts.concurrency = files.length;\n\t}\n\t// Prevent the number of workers exceeding the number of concurrent scripts (excess capacity), as some workers would never be allocated scripts to run and always be idle.\n\tif ( opts.workers > opts.concurrency ) {\n\t\topts.workers = opts.concurrency;\n\t}\n\t// Resolve any relative paths to absolute paths...\n\tdir = cwd();\n\tfor ( i = 0; i < files.length; i++ ) {\n\t\tfiles[ i ] = path.resolve( dir, files[ i ] );\n\t}\n\texec( files, opts, done );\n\n\t/**\n\t* Callback invoked after executing all scripts.\n\t*\n\t* @private\n\t* @param {Error} error - error object\n\t* @returns {void}\n\t*/\n\tfunction done( error ) {\n\t\tif ( error ) {\n\t\t\treturn clbk( error );\n\t\t}\n\t\tclbk();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = parallel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Execute scripts in parallel.\n*\n* @module @stdlib/utils/parallel\n*\n* @example\n* var parallel = require( '@stdlib/utils/parallel' );\n*\n* function done( error ) {\n* if ( error ) {\n* throw error;\n* }\n* }\n* var files = [ './a.js', './b.js' ];\n* parallel( files, done );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Attempts to parse a string as JSON.\n*\n* @param {string} str - string to parse\n* @param {Function} [reviver] - transformation function\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} reviver must be a function\n* @returns {(*|Error)} parsed value or parse error\n*\n* @example\n* var obj = parseJSON( '{\"beep\":\"boop\"}' );\n* // returns {'beep':'boop'}\n*/\nfunction parseJSON( str, reviver ) {\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isFunction( reviver ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Reviver argument must be a function. Value: `%s`.', reviver ) );\n\t\t}\n\t}\n\ttry {\n\t\treturn JSON.parse( str, reviver );\n\t} catch ( error ) {\n\t\treturn error;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = parseJSON;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Parse a string as JSON.\n*\n* @module @stdlib/utils/parse-json\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n*\n* var obj = parseJSON( '{\"beep\":\"boop\"}' );\n* // returns {'beep':'boop'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy containing only specified keys. If a key does not exist as an own property in a source object, the key is ignored.\n*\n* @param {Object} obj - source object\n* @param {(string|StringArray)} keys - keys to copy\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be either a string or an array of strings\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pick( obj1, 'b' );\n* // returns { 'b': 2 }\n*/\nfunction pick( obj, keys ) {\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tif ( isString( keys ) ) {\n\t\tif ( hasOwnProp( obj, keys ) ) {\n\t\t\tout[ keys ] = obj[ keys ];\n\t\t}\n\t\treturn out;\n\t}\n\tif ( isStringArray( keys ) ) {\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be either a string or an array of strings. Value: `%s`.', keys ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pick;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy containing only specified keys.\n*\n* @module @stdlib/utils/pick\n*\n* @example\n* var pick = require( '@stdlib/utils/pick' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pick( obj1, 'b' );\n* // returns { 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies specified arguments to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeIntegerArray} indices - argument indices\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of nonnegative integers\n* @returns {Function} function wrapper\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = pickArguments( foo, [ 0, 2 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction pickArguments( fcn, indices, thisArg ) {\n\tvar fcns;\n\tvar idx;\n\tvar v;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isCollection( indices ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object containing nonnegative integers. Value: `%s`.', indices ) );\n\t}\n\tidx = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tv = indices[ i ];\n\t\tif ( !isNonNegativeInteger( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object containing nonnegative integers. Value: `%s`.', indices ) );\n\t\t}\n\t\tidx.push( v );\n\t}\n\tfcns = [ nullary, unary, binary, ternary, quaternary, quinary ];\n\treturn ( idx.length < fcns.length ) ? fcns[ idx.length ] : nary;\n\n\t/**\n\t* Invokes a nullary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nullary() {\n\t\treturn fcn.call( thisArg );\n\t}\n\n\t/**\n\t* Invokes a unary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction unary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ] );\n\t}\n\n\t/**\n\t* Invokes a binary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction binary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ] );\n\t}\n\n\t/**\n\t* Invokes a ternary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction ternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quaternary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quaternary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes a quinary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction quinary() {\n\t\treturn fcn.call( thisArg, arguments[ idx[0] ], arguments[ idx[1] ], arguments[ idx[2] ], arguments[ idx[3] ], arguments[ idx[4] ] ); // eslint-disable-line max-len\n\t}\n\n\t/**\n\t* Invokes an n-ary function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction nary() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ idx[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = pickArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies specified arguments to a provided function.\n*\n* @module @stdlib/utils/pick-arguments\n*\n* @example\n* var pickArguments = require( '@stdlib/utils/pick-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* var bar = pickArguments( foo, [ 0, 2 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a partial object copy containing properties for which a predicate returns a truthy value.\n*\n* @param {Object} obj - source object\n* @param {Function} predicate - predicate function\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} second argument must be a function\n* @returns {Object} new object\n*\n* @example\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pickBy( obj1, predicate );\n* // returns { 'b': 2 }\n*/\nfunction pickBy( obj, predicate ) {\n\tvar keys;\n\tvar out;\n\tvar key;\n\tvar i;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tout = {};\n\tkeys = objectKeys( obj );\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tkey = keys[ i ];\n\t\tif ( predicate( key, obj[ key ] ) ) {\n\t\t\tout[ key ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pickBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a partial object copy containing properties for which a predicate (function) returns a truthy value.\n*\n* @module @stdlib/utils/pick-by\n*\n* @example\n* var pickBy = require( '@stdlib/utils/pick-by' );\n*\n* function predicate( key, value ) {\n* return ( value > 1 );\n* }\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = pickBy( obj1, predicate );\n* // returns { 'b': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*/\nfunction defaults() {\n\treturn {\n\t\t'copy': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {boolean} [options.copy] - boolean indicating whether to return a new data structure\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Extracts a property value from each element of an object array.\n*\n* @param {Array} arr - source array\n* @param {*} prop - property to access\n* @param {Options} [options] - function options\n* @param {boolean} [options.copy=true] - boolean indicating whether to return a new data structure\n* @throws {TypeError} first argument must be an object array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} destination array\n*\n* @example\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a' );\n* // returns [ 1, 0.5 ]\n*\n* @example\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a', {'copy':false} );\n* // returns [ 1, 0.5 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*/\nfunction pluck( arr, prop, options ) {\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar v;\n\tvar i;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array. Value: `%s`.', arr ) );\n\t}\n\topts = defaults();\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.copy ) {\n\t\tout = new Array( arr.length );\n\t} else {\n\t\tout = arr;\n\t}\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tv = arr[ i ];\n\t\tif (\n\t\t\tv !== void 0 &&\n\t\t\tv !== null &&\n\t\t\thasOwnProp( v, prop )\n\t\t) {\n\t\t\tout[ i ] = v[ prop ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pluck;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Extract a property value from each element of an object array.\n*\n* @module @stdlib/utils/pluck\n*\n* @example\n* var pluck = require( '@stdlib/utils/pluck' );\n*\n* var arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* var out = pluck( arr, 'a' );\n* // returns [ 1, 0.5 ]\n*\n* arr = [\n* { 'a': 1, 'b': 2 },\n* { 'a': 0.5, 'b': 3 }\n* ];\n*\n* out = pluck( arr, 'a', {'copy':false} );\n* // returns [ 1, 0.5 ]\n*\n* var bool = ( arr[ 0 ] === out[ 0 ] );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the last element of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @returns {Array} input object and the removed element\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* var out = pop( obj );\n* // returns [ { 'length': 1, '0': 1.0 }, 2.0 ]\n*/\nfunction pop( obj ) {\n\tvar len;\n\tvar v;\n\tif ( obj.length === 0 ) {\n\t\treturn [ obj, void 0 ];\n\t}\n\tlen = obj.length - 1;\n\tv = obj[ len ];\n\tdelete obj[ len ];\n\tobj.length = len;\n\treturn [ obj, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the last element of a typed array.\n*\n* @private\n* @param {TypedArray} arr - input array\n* @returns {Array} input array and the removed element\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\nfunction pop( arr ) {\n\tvar view;\n\tvar len;\n\tvar v;\n\tif ( arr.length === 0 ) {\n\t\treturn [ arr, void 0 ];\n\t}\n\tlen = arr.length - 1;\n\tv = arr[ len ];\n\tview = new arr.constructor( arr.buffer, arr.byteOffset, len );\n\treturn [ view, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar popObject = require( './pop_object.js' );\nvar popTypedArray = require( './pop_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Removes and returns the last element of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {Array} updated collection and the removed element\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*\n* @example\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\nfunction pop( collection ) {\n\tvar v;\n\tif ( isArray( collection ) ) {\n\t\tv = collection.pop();\n\t\treturn [ collection, v ];\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn popTypedArray( collection );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn popObject( collection );\n\t}\n\tthrow new TypeError( format( 'invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pop;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Remove and return the last element of a collection.\n*\n* @module @stdlib/utils/pop\n*\n* @example\n* var pop = require( '@stdlib/utils/pop' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = pop( arr );\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* out = pop( arr )\n* // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = prepend( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction prepend( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar prependArray = require( './prepend_array.js' );\nvar prependObject = require( './prepend_object.js' );\nvar prependTypedArray = require( './prepend_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the beginning of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn prependArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn prependTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn prependObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add the elements of one collection to the beginning of another collection.\n*\n* @module @stdlib/utils/prepend\n*\n* @example\n* var prepend = require( '@stdlib/utils/prepend' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable and non-enumerable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = properties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction properties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar i;\n\n\tout = propertyNames( value );\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tout.push( tmp[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = properties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable and non-enumerable property names and symbols.\n*\n* @module @stdlib/utils/properties\n*\n* @example\n* var properties = require( '@stdlib/utils/properties' );\n*\n* var props = properties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyDescriptor = require( './../../property-descriptor' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\n\n\n// MAIN //\n\n/**\n* Returns a property descriptor for an object's own or inherited property.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.\n* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.\n*\n* @private\n* @param {*} value - input object\n* @param {(string|symbol)} property - property\n* @returns {(Object|null)} property descriptor or null\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = propertyDescriptorIn( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}\n*/\nfunction propertyDescriptorIn( value, property ) {\n\tvar desc;\n\tvar obj;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn null;\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain in search of a specified property...\n\tdo {\n\t\tdesc = getOwnPropertyDescriptor( obj, property );\n\t\tif ( desc ) {\n\t\t\treturn desc;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyDescriptorIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a property descriptor for an object's own or inherited property.\n*\n* @module @stdlib/utils/property-descriptor-in\n*\n* @example\n* var propertyDescriptorIn = require( '@stdlib/utils/property-descriptor-in' );\n*\n* var obj = {\n* 'foo': 'bar',\n* 'beep': 'boop'\n* };\n*\n* var desc = propertyDescriptorIn( obj, 'foo' );\n* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyDescriptors = require( './../../property-descriptors' );\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar objectKeys = require( './../../keys' );\nvar defineProperty = require( './../../define-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an object's own and inherited property descriptors.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyDescriptors()`, this function returns an empty object if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Object} own and inherited property descriptors\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var desc = propertyDescriptorsIn( obj );\n* // returns { 'beep': {...}, 'foo': {...}, ... }\n*/\nfunction propertyDescriptorsIn( value ) {\n\tvar desc;\n\tvar keys;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn {};\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all property descriptors...\n\tdesc = {};\n\tdo {\n\t\ttmp = getOwnPropertyDescriptors( obj );\n\t\tkeys = objectKeys( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a property name always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tkeys = getOwnPropertySymbols( tmp );\n\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t// The first encountered property descriptor for a symbol property always takes precedence...\n\t\t\tif ( !hasOwnProp( desc, keys[ i ] ) ) {\n\t\t\t\t// The following is equivalent to `desc[ keys[i] ] = {...}`, but accounts for the possibility of a \"poisoned\" `Object` prototype (i.e., an `Object.prototype` having a property with a setter which throws).\n\t\t\t\tdefineProperty( desc, keys[ i ], {\n\t\t\t\t\t'configurable': true,\n\t\t\t\t\t'enumerable': true,\n\t\t\t\t\t'writable': true,\n\t\t\t\t\t'value': tmp[ keys[ i ] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn desc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyDescriptorsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an object's own and inherited property descriptors.\n*\n* @module @stdlib/utils/property-descriptors-in\n*\n* @example\n* var propertyDescriptorsIn = require( '@stdlib/utils/property-descriptors-in' );\n*\n* var desc = propertyDescriptorsIn({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // returns { 'foo': {...}, 'beep': {...}, ... }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable and non-enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var keys = propertyNamesIn( obj );\n* // e.g., returns [ 'beep', 'foo', ... ]\n*/\nfunction propertyNamesIn( value ) {\n\tvar names;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all enumerable and non-enumerable property names...\n\tnames = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( names, tmp[ i ] ) === false ) {\n\t\t\t\tnames.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable and non-enumerable property names.\n*\n* @module @stdlib/utils/property-names-in\n*\n* @example\n* var propertyNamesIn = require( '@stdlib/utils/property-names-in' );\n*\n* var keys = propertyNamesIn({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an array contains a provided value.\n*\n* @private\n* @param {Array} arr - array\n* @param {*} v - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*/\nfunction contains( arr, v ) {\n\tvar i;\n\tfor ( i = 0; i < arr.length; i++ ) {\n\t\tif ( arr[ i ] === v ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited symbol properties.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.getOwnPropertySymbols()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited symbol properties\n*\n* @example\n* var symbols = propertySymbolsIn( [] );\n*/\nfunction propertySymbolsIn( value ) {\n\tvar symbols;\n\tvar obj;\n\tvar tmp;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all symbol properties...\n\tsymbols = [];\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tif ( contains( symbols, tmp[ i ] ) === false ) {\n\t\t\t\tsymbols.push( tmp[ i ] );\n\t\t\t}\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = propertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited symbol properties.\n*\n* @module @stdlib/utils/property-symbols-in\n*\n* @example\n* var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' );\n*\n* var symbols = propertySymbolsIn( [] );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {Array} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, [ 6.0, 7.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( arr, items ) {\n\tvar i;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tarr.push( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {Array} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = push( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 1.0, '1': 2.0, '2': 3.0, '3': 4.0 }\n*/\nfunction push( obj, items ) {\n\tvar len;\n\tvar i;\n\tlen = obj.length;\n\tfor ( i = 0; i < items.length; i++ ) {\n\t\tobj[ len+i ] = items[ i ];\n\t}\n\tobj.length = len + items.length;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is followed by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {Array} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\ttotal = nbytes + ibytes + arr.byteOffset;\n\n\tif ( arr.buffer.byteLength < total ) {\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\tv = new arr.constructor( buf, 0, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i ] = arr[ i ];\n\t\t}\n\t} else {\n\t\tv = new arr.constructor( arr.buffer, arr.byteOffset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ len+i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar pushArray = require( './push_array.js' );\nvar pushObject = require( './push_object.js' );\nvar pushTypedArray = require( './push_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the end of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @param {...*} items - items to add\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {(Array|TypedArray|Object)} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\nfunction push( collection ) {\n\tvar items;\n\tvar i;\n\titems = [];\n\tfor ( i = 0; i < arguments.length-1; i++ ) {\n\t\titems.push( arguments[ i+1 ] );\n\t}\n\tif ( isArray( collection ) ) {\n\t\treturn pushArray( collection, items );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn pushTypedArray( collection, items );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn pushObject( collection, items );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = push;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add one or more elements to the end of a collection.\n*\n* @module @stdlib/utils/push\n*\n* @example\n* var push = require( '@stdlib/utils/push' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = push( arr, 6.0, 7.0 );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = push( arr, 6.0, 7.0 )\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/max' );\nvar FLOAT32 = require( '@stdlib/constants/float32/max' );\nvar FLOAT64 = require( '@stdlib/constants/float64/max' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum finite value capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} maximum finite value\n*\n* @example\n* var m = realmax( 'float64' );\n* // returns 1.7976931348623157e+308\n*\n* @example\n* var m = realmax( 'float16' );\n* // returns 65504.0\n*\n* @example\n* var m = realmax( 'float32' );\n* // returns 3.4028234663852886e+38\n*/\nfunction realmax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = realmax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum finite value capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/real-max\n*\n* @example\n* var realmax = require( '@stdlib/utils/real-max' );\n*\n* var m = realmax( 'float64' );\n* // returns 1.7976931348623157e+308\n*\n* m = realmax( 'float16' );\n* // returns 65504.0\n*\n* m = realmax( 'float32' );\n* // returns 3.4028234663852886e+38\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/smallest-normal' );\nvar FLOAT32 = require( '@stdlib/constants/float32/smallest-normal' );\nvar FLOAT64 = require( '@stdlib/constants/float64/smallest-normal' );\n\n\n// MAIN //\n\n/**\n* Returns the smallest positive normal value capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} smallest positive normal value\n*\n* @example\n* var m = realmin( 'float64' );\n* // returns 2.2250738585072014e-308\n*\n* @example\n* var m = realmin( 'float16' );\n* // returns 0.00006103515625\n*\n* @example\n* var m = realmin( 'float32' );\n* // returns 1.1754943508222875e-38\n*/\nfunction realmin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = realmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the smallest positive normal value capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/real-min\n*\n* @example\n* var realmin = require( '@stdlib/utils/real-min' );\n*\n* var m = realmin( 'float64' );\n* // returns 2.2250738585072014e-308\n*\n* m = realmin( 'float16' );\n* // returns 0.00006103515625\n*\n* m = realmin( 'float32' );\n* // returns 1.1754943508222875e-38\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = reduce( x, new Complex64( 0.0, 0.0 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 16.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction reduce( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn fcn.call( thisArg, initial, get( xbuf, ox ), 0, ref );\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, ix ), i, ref );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum:\n* var out = reduce( x, 0, sum );\n* // returns 10\n*/\nfunction reduce( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = 0; i < xbuf.length; i++ ) {\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, i ), i, xbuf );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array and returns the accumulated result.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduce( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduce( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction reduce( arr, initial, reducer, thisArg ) {\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, reducer, thisArg );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in an array and return the accumulated result.\n*\n* @module @stdlib/utils/reduce\n*\n* @example\n* var reduce = require( '@stdlib/utils/reduce' );\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduce( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var reduce = require( '@stdlib/utils/reduce' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduce( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vind2bind = require( '@stdlib/ndarray/base/vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input ndarray meta data\n* @param {string} x.ref - reference to original input ndarray-like object\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeInteger} x.length - number of elements\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - accessors for accessing data buffer elements\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cadd = require( '@stdlib/math/base/ops/cadd' );\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n*\n* // Create a data buffer:\n* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf.get( idx );\n* }\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'ref': null,\n* 'dtype': 'complex64',\n* 'data': xbuf,\n* 'length': 4,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': [ getter ]\n* };\n* x.ref = x;\n*\n* // Compute the sum:\n* var v = reduceRight( x, new Complex64( 0.0, 0.0 ), naryFunction( cadd, 2 ) );\n*\n* var re = realf( v );\n* // returns 16.0\n*\n* var im = imagf( v );\n* // returns 20.0\n*/\nfunction reduceRight( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar acc;\n\tvar len;\n\tvar get;\n\tvar ref;\n\tvar shx;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\t// Cache the total number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Cache the input array shape:\n\tshx = x.shape;\n\n\t// Cache reference to the input ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Cache the reference to the original input array:\n\tref = x.ref;\n\n\t// Check for a zero-dimensional array...\n\tif ( shx.length === 0 ) {\n\t\treturn fcn.call( thisArg, initial, get( xbuf, ox ), 0, ref );\n\t}\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory (note: this has negative performance implications for non-contiguous ndarrays due to a lack of data locality)...\n\tacc = initial;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tix = vind2bind( shx, sx, ox, ordx, i, MODE );\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, ix ), i, ref );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* @private\n* @param {Object} x - object containing input array data\n* @param {ArrayLikeObject} x.data - input array data\n* @param {Array} x.accessors - input array accessors\n* @param {*} initial - initial value\n* @param {Function} fcn - function to apply\n* @param {*} thisArg - function execution context\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* // Define a getter:\n* function getter( buf, idx ) {\n* return buf[ idx ];\n* }\n*\n* // Create the input array object:\n* var x = {\n* 'data': [ 1, 2, 3, 4 ],\n* 'accessors': [ getter ]\n* };\n*\n* // Compute the sum:\n* var out = reduceRight( x, 0, sum );\n* // returns 10\n*/\nfunction reduceRight( x, initial, fcn, thisArg ) {\n\tvar xbuf;\n\tvar get;\n\tvar acc;\n\tvar i;\n\n\t// Cache reference to the input data:\n\txbuf = x.data;\n\n\t// Cache the element accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element...\n\tacc = initial;\n\tfor ( i = xbuf.length-1; i >= 0; i-- ) {\n\t\tacc = fcn.call( thisArg, acc, get( xbuf, i ), i, xbuf );\n\t}\n\treturn acc;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar ndarraylike2object = require( '@stdlib/ndarray/base/ndarraylike2object' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar format = require( '@stdlib/string/format' );\nvar ndarrayFcn = require( './ndarray.js' );\nvar arrayFcn = require( './array.js' );\n\n\n// MAIN //\n\n/**\n* Applies a function against an accumulator and each element in an array while iterating from right to left and returns the accumulated result.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **index**: element index.\n* - **arr**: input array.\n*\n* @param {(ArrayLikeObject|ndarray)} arr - input array\n* @param {*} initial - initial value\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - reduction function execution context\n* @throws {TypeError} first argument must be an array-like object or an ndarray\n* @throws {TypeError} third argument must be a function\n* @returns {*} accumulated result\n*\n* @example\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduceRight( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduceRight( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\nfunction reduceRight( arr, initial, reducer, thisArg ) {\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tif ( isndarrayLike( arr ) ) { // note: assertion order matters here, as an ndarray-like object is also array-like\n\t\treturn ndarrayFcn( ndarraylike2object( arr ), initial, reducer, thisArg ); // eslint-disable-line max-len\n\t}\n\tif ( isArrayLikeObject( arr ) ) {\n\t\treturn arrayFcn( arraylike2object( arr ), initial, reducer, thisArg );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an ndarray. Value: `%s`.', arr ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduceRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a function against an accumulator and each element in an array while iterating from right to left and return the accumulated result.\n*\n* @module @stdlib/utils/reduce-right\n*\n* @example\n* var reduceRight = require( '@stdlib/utils/reduce-right' );\n*\n* function sum( acc, value ) {\n* return acc + value;\n* }\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var out = reduceRight( arr, 0, sum );\n* // returns 10\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var array = require( '@stdlib/ndarray/array' );\n* var reduceRight = require( '@stdlib/utils/reduce-right' );\n*\n* var opts = {\n* 'dtype': 'generic'\n* };\n* var arr = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ], opts );\n*\n* var out = reduceRight( arr, 0, naryFunction( add, 2 ) );\n* // returns 21\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Reduces the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and returning the accumulation results as a one-dimensional array.\n*\n* ## Notes\n*\n* - The applied function is provided the following arguments:\n*\n* - **accumulator**: accumulated value.\n* - **value**: array element.\n* - **indices**: current array element indices.\n* - **arr**: input array.\n*\n* @param {ArrayLikeObject} arr - array of arrays\n* @param {ArrayLikeObject} initial - initial values\n* @param {Function} reducer - reduction function\n* @param {*} [thisArg] - function execution context\n* @throws {TypeError} first argument must be an array of arrays\n* @throws {TypeError} second argument must be an array-like object\n* @throws {RangeError} second argument must have a length equal to the size of the outermost input array dimension\n* @throws {TypeError} third argument must be a function\n* @returns {Array} results\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var arr = [\n* [ 1, 2, 3 ],\n* [ 4, 5, 6 ]\n* ];\n*\n* var out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) );\n* // returns [ 6, 15 ]\n*/\nfunction reduce2d( arr, initial, reducer, thisArg ) {\n\tvar out;\n\tvar acc;\n\tvar M;\n\tvar N;\n\tvar a;\n\tvar i;\n\tvar j;\n\n\tif ( !isArrayLikeObject( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tif ( !isArrayLikeObject( initial ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', initial ) );\n\t}\n\tif ( initial.length !== arr.length ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must have a length equal to the size of the outermost input array dimension.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tM = arr.length;\n\tout = [];\n\tfor ( i = 0; i < M; i++ ) {\n\t\ta = arr[ i ];\n\t\tif ( !isCollection( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object containing array-like objects. Index: `%u`. Value: `%s`.', i, a ) );\n\t\t}\n\t\tN = a.length;\n\t\tacc = initial[ i ];\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tacc = reducer.call( thisArg, acc, a[ j ], [ i, j ], arr );\n\t\t}\n\t\tout.push( acc );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reduce2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reduce the number of dimensions by one of a two-dimensional nested array by applying a function against an accumulator and each element along the innermost dimension and return the accumulation results as a one-dimensional array.\n*\n* @module @stdlib/utils/reduce2d\n*\n* @example\n* var naryFunction = require( '@stdlib/utils/nary-function' );\n* var add = require( '@stdlib/math/base/ops/add' );\n* var reduce2d = require( '@stdlib/utils/reduce2d' );\n*\n* var arr = [\n* [ 1, 2, 3 ],\n* [ 4, 5, 6 ]\n* ];\n*\n* var out = reduce2d( arr, [ 0, 0 ], naryFunction( add, 2 ) );\n* // returns [ 6, 15 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that applies arguments to a provided function according to a predicate function.\n*\n* ## Notes\n*\n- The predicate function is provided the following arguments:\n*\n* - **value**: argument value.\n* - **index**: argument index.\n*\n* - Only those arguments in which the predicate function returns a falsy value are applied to a provided function.\n*\n* @param {Function} fcn - input function\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n* @returns {Function} wrapped function\n*\n* @example\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v === 2 );\n* }\n*\n* var bar = rejectArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\nfunction rejectArguments( fcn, predicate, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\treturn wrap;\n\n\t/**\n\t* Invokes a function according to a predicate function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction wrap() {\n\t\tvar args;\n\t\tvar v;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( !predicate( v, i ) ) {\n\t\t\t\targs.push( v );\n\t\t\t}\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = rejectArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function that applies arguments to a provided function according to a predicate function.\n*\n* @module @stdlib/utils/reject-arguments\n*\n* @example\n* var rejectArguments = require( '@stdlib/utils/reject-arguments' );\n*\n* function foo( a, b ) {\n* return [ a, b ];\n* }\n*\n* function predicate( v ) {\n* return ( v === 2 );\n* }\n*\n* var bar = rejectArguments( foo, predicate );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that invokes a provided function with reordered arguments.\n*\n* @param {Function} fcn - input function\n* @param {NonNegativeIntegerArray} indices - argument indices\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of nonnegative integers\n* @returns {Function} function with reordered arguments\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 1, 2 ]\n*/\nfunction reorderArguments( fcn, indices, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( !isNonNegativeIntegerArray( indices ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array containing only nonnegative integers. Value: `%s`.', indices ) );\n\t}\n\treturn reordered;\n\n\t/**\n\t* Invokes a function with reordered arguments.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} must provide expected number of input arguments\n\t* @returns {*} return value\n\t*/\n\tfunction reordered() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\tif ( len !== indices.length ) {\n\t\t\tthrow new Error( format( 'invalid invocation. Unexpected number of input arguments. Expected: `%u`. Actual: `%u`.', indices.length, len ) );\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs.push( arguments[ indices[i] ] );\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = reorderArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function that invokes a provided function with reordered arguments.\n*\n* @module @stdlib/utils/reorder-arguments\n*\n* @example\n* var reorderArguments = require( '@stdlib/utils/reorder-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 1, 2 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function that invokes a provided function with arguments in reverse order.\n*\n* @param {Function} fcn - input function\n* @param {*} [thisArg] - function context\n* @throws {TypeError} first argument must be a function\n* @returns {Function} reverse arguments function\n*\n* @example\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reverseArguments( foo );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 2, 1 ]\n*/\nfunction reverseArguments( fcn, thisArg ) {\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\treturn reversed;\n\n\t/**\n\t* Invokes a function with arguments in reverse order.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @returns {*} return value\n\t*/\n\tfunction reversed() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ len-1-i ] = arguments[ i ];\n\t\t}\n\t\treturn fcn.apply( thisArg, args );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = reverseArguments;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a function that invokes a provided function with arguments in reverse order.\n*\n* @module @stdlib/utils/reverse-arguments\n*\n* @example\n* var reverseArguments = require( '@stdlib/utils/reverse-arguments' );\n*\n* function foo( a, b, c ) {\n* return [ a, b, c ];\n* }\n*\n* var bar = reverseArguments( foo );\n*\n* var out = bar( 1, 2, 3 );\n* // returns [ 3, 2, 1 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/max-safe-integer' );\nvar FLOAT32 = require( '@stdlib/constants/float32/max-safe-integer' );\nvar FLOAT64 = require( '@stdlib/constants/float64/max-safe-integer' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum safe integer capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} maximum safe integer\n*\n* @example\n* var m = safeintmax( 'float64' );\n* // returns 9007199254740991\n*\n* @example\n* var m = safeintmax( 'float16' );\n* // returns 2047\n*\n* @example\n* var m = safeintmax( 'float32' );\n* // returns 16777215\n*/\nfunction safeintmax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeintmax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum safe integer capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/safe-int-max\n*\n* @example\n* var safeintmax = require( '@stdlib/utils/safe-int-max' );\n*\n* var m = safeintmax( 'float64' );\n* // returns 9007199254740991\n*\n* m = safeintmax( 'float16' );\n* // returns 2047\n*\n* m = safeintmax( 'float32' );\n* // returns 16777215\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar FLOAT16 = require( '@stdlib/constants/float16/min-safe-integer' );\nvar FLOAT32 = require( '@stdlib/constants/float32/min-safe-integer' );\nvar FLOAT64 = require( '@stdlib/constants/float64/min-safe-integer' );\n\n\n// MAIN //\n\n/**\n* Returns the minimum safe integer capable of being represented by a numeric real type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} minimum safe integer\n*\n* @example\n* var m = safeintmin( 'float64' );\n* // returns -9007199254740991\n*\n* @example\n* var m = safeintmin( 'float16' );\n* // returns -2047\n*\n* @example\n* var m = safeintmin( 'float32' );\n* // returns -16777215\n*/\nfunction safeintmin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = safeintmin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum safe integer capable of being represented by a numeric real type.\n*\n* @module @stdlib/utils/safe-int-min\n*\n* @example\n* var safeintmin = require( '@stdlib/utils/safe-int-min' );\n*\n* var m = safeintmin( 'float64' );\n* // returns -9007199254740991\n*\n* m = safeintmin( 'float16' );\n* // returns -2047\n*\n* m = safeintmin( 'float32' );\n* // returns -16777215\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the first element of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @returns {Array} input object and the removed element\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* var out = shift( obj );\n* // returns [ { 'length': 1, '0': 2.0 }, 1.0 ]\n*/\nfunction shift( obj ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tif ( obj.length === 0 ) {\n\t\treturn [ obj, void 0 ];\n\t}\n\tlen = obj.length - 1;\n\tv = obj[ 0 ];\n\n\t// Shift all elements down...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tobj[ i ] = obj[ i+1 ];\n\t}\n\tdelete obj[ len ];\n\tobj.length = len;\n\treturn [ obj, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Removes and returns the first element of a typed array.\n*\n* @private\n* @param {TypedArray} arr - input array\n* @returns {Array} input array and the removed element\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\nfunction shift( arr ) {\n\tvar offset;\n\tvar view;\n\tvar v;\n\tif ( arr.length === 0 ) {\n\t\treturn [ arr, void 0 ];\n\t}\n\tv = arr[ 0 ];\n\toffset = arr.byteOffset + arr.BYTES_PER_ELEMENT;\n\tview = new arr.constructor( arr.buffer, offset, arr.length-1 );\n\treturn [ view, v ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar shiftObject = require( './shift_object.js' );\nvar shiftTypedArray = require( './shift_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Removes and returns the first element of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {Array} updated collection and the removed element\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\nfunction shift( collection ) {\n\tvar v;\n\tif ( isArray( collection ) ) {\n\t\tv = collection.shift();\n\t\treturn [ collection, v ];\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn shiftTypedArray( collection );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn shiftObject( collection );\n\t}\n\tthrow new TypeError( format( 'invalid argument. Must provide either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = shift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Remove and return the first element of a collection.\n*\n* @module @stdlib/utils/shift\n*\n* @example\n* var shift = require( '@stdlib/utils/shift' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* var out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* out = shift( arr );\n* // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/num-bytes' );\nvar UINT8 = require( '@stdlib/constants/uint8/num-bytes' );\nvar INT16 = require( '@stdlib/constants/int16/num-bytes' );\nvar UINT16 = require( '@stdlib/constants/uint16/num-bytes' );\nvar INT32 = require( '@stdlib/constants/int32/num-bytes' );\nvar UINT32 = require( '@stdlib/constants/uint32/num-bytes' );\nvar FLOAT16 = require( '@stdlib/constants/float16/num-bytes' );\nvar FLOAT32 = require( '@stdlib/constants/float32/num-bytes' );\nvar FLOAT64 = require( '@stdlib/constants/float64/num-bytes' );\nvar COMPLEX64 = require( '@stdlib/constants/complex64/num-bytes' );\nvar COMPLEX128 = require( '@stdlib/constants/complex128/num-bytes' );\n\n\n// MAIN //\n\n/**\n* Returns the size (in bytes) of the canonical binary representation of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {integer} size in bytes\n*\n* @example\n* var s = sizeOf( 'int8' );\n* // returns 1\n*\n* @example\n* var s = sizeOf( 'uint8' );\n* // returns 1\n*\n* @example\n* var s = sizeOf( 'int16' );\n* // returns 2\n*/\nfunction sizeOf( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'uint32':\n\t\treturn UINT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'uint8':\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn UINT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'uint16':\n\t\treturn UINT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tcase 'complex128':\n\t\treturn COMPLEX128;\n\tcase 'complex64':\n\t\treturn COMPLEX64;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sizeOf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the size (in bytes) of the canonical binary representation of a specified numeric type.\n*\n* @module @stdlib/utils/size-of\n*\n* @example\n* var sizeOf = require( '@stdlib/utils/size-of' );\n*\n* var s = sizeOf( 'int8' );\n* // returns 1\n*\n* s = sizeOf( 'uint8' );\n* // returns 1\n*\n* s = sizeOf( 'int16' );\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which are truthy.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which are truthy\n*\n* @example\n* var arr = [ 0, 0, 1, 2, 3 ];\n*\n* var bool = some( arr, 3 );\n* // returns true\n*/\nfunction some( collection, n ) {\n\tvar count;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( collection[ i ] ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = some;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which are truthy.\n*\n* @module @stdlib/utils/some\n*\n* @example\n* var some = require( '@stdlib/utils/some' );\n*\n* var arr = [ 0, 0, 1, 2, 3 ];\n*\n* var bool = some( arr, 3 );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} third argument must be a function\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which pass a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, -3, 4, -1 ];\n*\n* var bool = someBy( arr, 2, isNegative );\n* // returns true\n*/\nfunction someBy( collection, n, predicate, thisArg ) {\n\tvar count;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = someBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function.\n*\n* @module @stdlib/utils/some-by\n*\n* @example\n* var someBy = require( '@stdlib/utils/some-by' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ 1, 2, -3, 4, -1 ];\n*\n* var bool = someBy( arr, 2, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @param {Collection} collection - input collection\n* @param {PositiveInteger} n - number of elements\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a positive integer\n* @throws {TypeError} third argument must be a function\n* @returns {boolean} boolean indicating whether a collection contains at least `n` elements which pass a test\n*\n* @example\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, -2, 3, 4 ];\n*\n* var bool = someByRight( arr, 2, isNegative );\n* // returns true\n*/\nfunction someByRight( collection, n, predicate, thisArg ) {\n\tvar count;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tcount = 0;\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\tcount += 1;\n\t\t\tif ( count === n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = someByRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a collection contains at least `n` elements which pass a test implemented by a predicate function, iterating from right to left.\n*\n* @module @stdlib/utils/some-by-right\n*\n* @example\n* var someByRight = require( '@stdlib/utils/some-by-right' );\n*\n* function isNegative( v ) {\n* return ( v < 0 );\n* }\n*\n* var arr = [ -1, 1, -2, 3, 4 ];\n*\n* var bool = someByRight( arr, 2, isNegative );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( './../../define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( './../../define-nonenumerable-read-only-accessor' );\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\n\n\n// MAIN //\n\n/**\n* Stack constructor.\n*\n* @constructor\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nfunction Stack() {\n\tif ( !(this instanceof Stack) ) {\n\t\treturn new Stack();\n\t}\n\t// Use a dynamic array as insertion and deletion is O(1) amortized:\n\tthis._buffer = [];\n\treturn this;\n}\n\n/**\n* Clears the stack.\n*\n* @name clear\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the top value:\n* var v = s.first();\n* // returns 'bar'\n*\n* // Examine the stack length:\n* var len = s.length;\n* // returns 2\n*\n* // Clear all stack items:\n* s.clear();\n*\n* // Peek at the top value:\n* v = s.first();\n* // returns undefined\n*\n* // Examine the stack length:\n* len = s.length;\n* // returns 0\n*/\nsetReadOnly( Stack.prototype, 'clear', function clear() {\n\tthis._buffer.length = 0;\n\treturn this;\n});\n\n/**\n* Returns the top value (i.e., the value which is \"first-out\").\n*\n* @name first\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} top value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the top value:\n* var v = s.first();\n* // returns 'bar'\n*/\nsetReadOnly( Stack.prototype, 'first', function first() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer[ this._buffer.length-1 ];\n\t}\n});\n\n/**\n* Returns an iterator for iterating over a stack.\n*\n* ## Notes\n*\n* - In order to prevent confusion arising from stack mutation during iteration, a returned iterator **always** iterates over a stack \"snapshot\", which is defined as the list of stack elements at the time of this method's invocation.\n*\n* @name iterator\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Iterator} iterator\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Create an iterator:\n* var it = s.iterator();\n*\n* // Iterate over the stack...\n* var v = it.next().value;\n* // returns 'bar'\n*\n* v = it.next().value;\n* // returns 'foo'\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Stack.prototype, 'iterator', function iterator() {\n\tvar values;\n\tvar iter;\n\tvar self;\n\tvar FLG;\n\tvar i;\n\n\tself = this;\n\n\t// Initialize the iteration index:\n\ti = this._buffer.length;\n\n\t// Create a copy of stack values (necessary in order to \"snapshot\" the stack; otherwise, values could come and go between calls to `next`):\n\tvalues = this._buffer.slice();\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti -= 1;\n\t\tif ( FLG || i < 0 ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': values[ i ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.iterator();\n\t}\n});\n\n/**\n* Returns the bottom stack value (i.e., the value which is currently \"last-out\").\n*\n* @name last\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} bottom stack value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Peek at the bottom value:\n* var v = s.last();\n* // returns 'foo'\n*/\nsetReadOnly( Stack.prototype, 'last', function last() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer[ 0 ];\n\t}\n});\n\n/**\n* Stack length.\n*\n* @name length\n* @memberof Stack.prototype\n* @type {NonNegativeInteger}\n*\n* @example\n* var s = new Stack();\n*\n* // Examine the initial stack length:\n* var len = s.length;\n* // returns 0\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Retrieve the current stack length:\n* len = s.length;\n* // returns 2\n*/\nsetReadOnlyAccessor( Stack.prototype, 'length', function get() {\n\treturn this._buffer.length;\n});\n\n/**\n* Removes a value from the stack.\n*\n* @name pop\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {(*|void)} removed value\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nsetReadOnly( Stack.prototype, 'pop', function pop() {\n\tif ( this._buffer.length ) {\n\t\treturn this._buffer.pop();\n\t}\n});\n\n/**\n* Adds a value to the stack.\n*\n* @name push\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Stack} stack instance\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\nsetReadOnly( Stack.prototype, 'push', function push( value ) {\n\tthis._buffer.push( value );\n\treturn this;\n});\n\n/**\n* Returns an array of stack values.\n*\n* ## Notes\n*\n* - Why reverse insertion order? Pros and cons to either order, but reverse insertion order mirrors iterator order. For example, we can use the ES6/ES2015+ spread operator along with the iterator to return stack values.\n*\n* ```text\n* arr = [...s.iterator()]\n* ```\n*\n* One might (as is the opinion here) consider parity of array serialization and iterator order to be a reasonable design goal.\n*\n* @name toArray\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Array} stack values\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Get an array of stack values:\n* var vals = s.toArray();\n* // returns [ 'bar', 'foo' ]\n*/\nsetReadOnly( Stack.prototype, 'toArray', function toArray() {\n\tvar out;\n\tvar i;\n\tout = [];\n\tfor ( i = this._buffer.length-1; i >= 0; i-- ) {\n\t\tout.push( this._buffer[ i ] );\n\t}\n\treturn out;\n});\n\n/**\n* Serializes a stack as JSON.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Stack` instance.\n*\n* @name toJSON\n* @memberof Stack.prototype\n* @type {Function}\n* @returns {Object} serialized stack\n*\n* @example\n* var s = new Stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Serialize to JSON:\n* var o = s.toJSON();\n* // returns { 'type': 'stack', 'data': [ 'bar', 'foo' ] }\n*/\nsetReadOnly( Stack.prototype, 'toJSON', function toJSON() {\n\tvar out = {};\n\tout.type = 'stack';\n\tout.data = this.toArray();\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Stack;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Stack.\n*\n* @module @stdlib/utils/stack\n*\n* @example\n* var stack = require( '@stdlib/utils/stack' );\n*\n* var s = stack();\n*\n* // Add values to the stack:\n* s.push( 'foo' ).push( 'bar' );\n*\n* // Remove the top value:\n* var v = s.pop();\n* // returns 'bar'\n*\n* // Add a new value to the stack:\n* s.push( 'beep' );\n*\n* // Remove the top value:\n* v = s.pop();\n* // returns 'beep'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table.\n*\n* ## Notes\n*\n* - The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @throws {TypeError} first argument must be a collection\n* @returns {(Array|Array)} frequency table\n*\n* @example\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulate( arr );\n* // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n*/\nfunction tabulate( collection ) {\n\tvar count;\n\tvar tmp;\n\tvar len;\n\tvar out;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tcount = 0;\n\ttmp = [];\n\tout = [];\n\n\t// For each collection element, determine if we've seen the element before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = collection[ i ];\n\t\tcount += 1;\n\t\tj = indexOf( tmp, v );\n\t\tif ( j === -1 ) {\n\t\t\ttmp.push( v );\n\t\t\tout.push( [ v, 1, 0 ] );\n\t\t} else {\n\t\t\tout[ j ][ 1 ] += 1;\n\t\t}\n\t}\n\t// Compute percentages...\n\tlen = out.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table.\n*\n* @module @stdlib/utils/tabulate\n*\n* @example\n* var tabulate = require( '@stdlib/utils/tabulate' );\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulate( arr );\n* // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {}\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar indexOf = require( './../../index-of' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Generates a frequency table according to a provided function.\n*\n* ## Notes\n*\n* - The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:\n*\n* - 0: unique value\n* - 1: value count\n* - 2: frequency percentage\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {Function} indicator - function whose return values are used to populate the output frequency table\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} last argument must be a function\n* @throws {TypeError} must provide valid options\n* @returns {(Array|Array)} frequency table\n*\n* @example\n* function indicator( value ) {\n* return value[ 0 ];\n* }\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulateBy( arr, indicator );\n* // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n*/\nfunction tabulateBy( collection, options, indicator ) {\n\tvar thisArg;\n\tvar count;\n\tvar opts;\n\tvar tmp;\n\tvar len;\n\tvar out;\n\tvar err;\n\tvar cb;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\topts = {};\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tcb = indicator;\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tthisArg = opts.thisArg;\n\tcount = 0;\n\ttmp = [];\n\tout = [];\n\n\t// For each collection element, determine if we've seen the element before. If not, cache a reference which points to its location in the output array; otherwise, update the running count.\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = cb.call( thisArg, collection[ i ], i );\n\t\tcount += 1;\n\t\tj = indexOf( tmp, v );\n\t\tif ( j === -1 ) {\n\t\t\ttmp.push( v );\n\t\t\tout.push( [ v, 1, 0 ] );\n\t\t} else {\n\t\t\tout[ j ][ 1 ] += 1;\n\t\t}\n\t}\n\t// Compute percentages...\n\tlen = out.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ][ 2 ] = out[ i ][ 1 ] / count;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = tabulateBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a frequency table according to an indicator function.\n*\n* @module @stdlib/utils/tabulate-by\n*\n* @example\n* var tabulateBy = require( '@stdlib/utils/tabulate-by' );\n*\n* function indicator( value ) {\n* return value[ 0 ];\n* }\n*\n* var arr = [ 'beep', 'boop', 'foo', 'beep' ];\n*\n* var out = tabulateBy( arr, indicator );\n* // returns [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a thunk.\n*\n* @param {Function} fcn - function to convert to a thunk\n* @param {...*} [args] - function arguments\n* @throws {TypeError} first argument must be a function\n* @returns {Function} thunk\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n*\n* var f = thunk( add, 2, 3 );\n* // returns \n*\n* // ...\n*\n* // Evaluate the thunk:\n* var v = f();\n* // returns 5\n*/\nfunction thunk( fcn ) {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\t// NOTE: we return an anonymous function to satisfy the definition of a thunk (i.e., an anonymous function which has no parameters of its own and wraps another function)...\n\treturn function () { // eslint-disable-line no-restricted-syntax, func-names\n\t\treturn fcn.apply( null, args );\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = thunk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a thunk.\n*\n* @module @stdlib/utils/thunk\n*\n* @example\n* var add = require( '@stdlib/math/base/ops/add' );\n* var thunk = require( '@stdlib/utils/thunk' );\n*\n* var f = thunk( add, 2, 3 );\n* // returns \n*\n* // ...\n*\n* // Evaluate the thunk:\n* var v = f();\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"iterations\": 1000000,\n\t\"repeats\": 3,\n\t\"before\": \"\",\n\t\"after\": \"\",\n\t\"asynchronous\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNull = require( '@stdlib/assert/is-null' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - options to validate\n* @param {string} [options.before] - setup code\n* @param {string} [options.after] - cleanup code\n* @param {(PositiveInteger|null)} [options.iterations] - number of iterations\n* @param {PositiveInteger} [options.repeats] - number of repeats\n* @param {boolean} [options.asynchronous] - boolean indicating whether a snippet is asynchronous\n* @returns {(Error|null)} error or null\n*\n* @example\n* var opts = {};\n* var options = {\n* 'iterations': 1e7,\n* 'repeats': 5\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'iterations' ) ) {\n\t\topts.iterations = options.iterations;\n\t\tif (\n\t\t\t!isPositiveInteger( opts.iterations ) &&\n\t\t\t!isNull( opts.iterations )\n\t\t) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer or null. Option: `%s`.', 'iterations', opts.iterations ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'repeats' ) ) {\n\t\topts.repeats = options.repeats;\n\t\tif ( !isPositiveInteger( opts.repeats ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'repeats', opts.repeats ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'before' ) ) {\n\t\topts.before = options.before;\n\t\tif ( !isString( opts.before ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'before', opts.before ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'after' ) ) {\n\t\topts.after = options.after;\n\t\tif ( !isString( opts.after ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'after', opts.after ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'asynchronous' ) ) {\n\t\topts.asynchronous = options.asynchronous;\n\t\tif ( !isBoolean( opts.asynchronous ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'asynchronous', opts.asynchronous ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\nvar tic = require( '@stdlib/time/tic' );\nvar toc = require( '@stdlib/time/toc' );\n\n\n// MAIN //\n\n/**\n* Returns a context.\n*\n* @private\n* @param {Callback} done - callback to be invoked within snippet execution context\n* @returns {Object} context\n*/\nfunction context( done ) {\n\tvar ctx = {};\n\n\tdefineProperty( ctx, 'tic', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': tic\n\t});\n\tdefineProperty( ctx, 'toc', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': toc\n\t});\n\tdefineProperty( ctx, 'done', {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': done\n\t});\n\treturn {\n\t\t'tic': tic,\n\t\t'toc': toc,\n\t\t'done': done\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = context;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar noop = 'next();';\n\n\n// MAIN //\n\n/**\n* Generates a source code body for asynchronous execution.\n*\n* ## Notes\n*\n* - Example output:\n*\n* ```javascript\n* \"use strict\";\n*\n* var ctx = this;\n* var state1 = {};\n* var t1, d1, i1;\n*\n* function before( state, next ) {\n* // {{before}}\n* }\n*\n* function cb1( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* i1 = 0;\n* t1 = ctx.tic();\n* main( state1, cb2 );\n* }\n*\n* function main( state, next ) {\n* // {{code}}\n* }\n*\n* function cb2( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* i1 += 1;\n* if ( i1 < 1e6 ) {\n* return main( state1, cb2 );\n* }\n* d1 = ctx.toc( t1 );\n* after( state1, cb3 );\n* }\n*\n* function after( state, next ) {\n* // {{after}}\n* }\n*\n* function cb3( error ) {\n* if ( error ) {\n* return ctx.done( error );\n* }\n* ctx.done( null, d1 );\n* }\n*\n* before( state1, cb1 );\n*\n* return 1;\n* ```\n*\n* @private\n* @param {number} id - id\n* @param {string} code - code to time\n* @param {Options} opts - function options\n* @param {string} opts.before - setup code\n* @param {string} opts.after - cleanup code\n* @param {PositiveInteger} opts.iterations - number of iterations\n* @returns {string} source code body\n*/\nfunction body( id, code, opts ) {\n\tvar before;\n\tvar after;\n\tvar state;\n\tvar main;\n\tvar src;\n\tvar cb1;\n\tvar cb2;\n\tvar cb3;\n\tvar ctx;\n\tvar t;\n\tvar d;\n\tvar i;\n\n\tsrc = '\"use strict\";';\n\n\t// Define identifiers:\n\tbefore = '__before$'+id+'__';\n\tafter = '__after$'+id+'__';\n\tstate = '__state$'+id+'__';\n\tmain = '__main$'+id+'__';\n\tcb1 = '__cb1$'+id+'__';\n\tcb2 = '__cb2$'+id+'__';\n\tcb3 = '__cb3$'+id+'__';\n\tctx = '__ctx$'+id+'__';\n\ti = '__i$'+id+'__';\n\tt = '__t$'+id+'__';\n\td = '__d$'+id+'__';\n\n\t// Declare variables:\n\tsrc += 'var '+ctx+' = this;';\n\tsrc += 'var '+state+' = {};';\n\tsrc += 'var '+i+','+t+','+d+';';\n\n\t// Insert the setup code:\n\tsrc += 'function '+before+'( state, next ) {';\n\tsrc += ' '+(opts.before||noop)+';';\n\tsrc += '}';\n\n\t// Insert the setup callback:\n\tsrc += 'function '+cb1+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+i+' = 0;';\n\tsrc += ' '+t+' = '+ctx+'.tic();'; // start the timer\n\tsrc += ' '+main+'( '+state+','+cb2+' );';\n\tsrc += '}';\n\n\t// Wrap the code to time in a function:\n\tsrc += 'function '+main+'( state, next ) {';\n\tsrc += ' '+(code||noop)+';';\n\tsrc += '}';\n\n\t// Insert the main callback:\n\tsrc += 'function '+cb2+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+i+' += 1;';\n\tsrc += ' if ( '+i+' < '+opts.iterations+' ) {';\n\tsrc += ' return '+main+'( '+state+','+cb2+' );';\n\tsrc += ' }';\n\tsrc += ' '+d+' = '+ctx+'.toc( '+t+' );'; // stop the timer\n\tsrc += ' '+after+'( '+state+','+cb3+' );';\n\tsrc += '}';\n\n\t// Insert the cleanup code:\n\tsrc += 'function '+after+'( state, next ) {';\n\tsrc += ' '+(opts.after||noop)+';';\n\tsrc += '}';\n\n\t// Insert the cleanup callback:\n\tsrc += 'function '+cb3+'( error ) {';\n\tsrc += ' if ( error ) {';\n\tsrc += ' return '+ctx+'.done( error );';\n\tsrc += ' }';\n\tsrc += ' '+ctx+'.done( null,'+d+' );'; // return results\n\tsrc += '}';\n\n\t// Invoke the setup function to begin the execution sequence:\n\tsrc += before+'( '+state+','+cb1+' );';\n\n\t// Return a value:\n\tsrc += 'return '+id+';';\n\n\treturn src;\n}\n\n\n// EXPORTS //\n\nmodule.exports = body;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Generates a source code body for synchronous execution.\n*\n* ## Notes\n*\n* - Example output:\n*\n* ```javascript\n* \"use strict\";\n*\n* var ctx = this;\n* var t1, d1, i1;\n*\n* // {{before}}\n*\n* t1 = ctx.tic();\n* for ( i1 = 0; i1 < 1e6; i1++ ) {\n* // {{code}}\n* }\n* d1 = ctx.toc( t1 );\n*\n* // {{after}}\n*\n* ctx.done( null, d1 );\n*\n* return 1;\n* ```\n*\n* @private\n* @param {number} id - id\n* @param {string} code - code to time\n* @param {Options} opts - function options\n* @param {string} opts.before - setup code\n* @param {string} opts.after - cleanup code\n* @param {PositiveInteger} opts.iterations - number of iterations\n* @returns {string} source code body\n*/\nfunction generate( id, code, opts ) {\n\tvar src;\n\tvar ctx;\n\tvar t;\n\tvar d;\n\tvar i;\n\n\tsrc = '\"use strict\";';\n\n\t// Declare variables:\n\tctx = '__ctx$'+id+'__';\n\ti = '__i$'+id+'__';\n\tt = '__t$'+id+'__';\n\td = '__d$'+id+'__';\n\n\tsrc += 'var '+ctx+' = this;';\n\tsrc += 'var '+t+','+d+','+i+';';\n\n\t// Insert the setup code:\n\tsrc += opts.before+';';\n\n\t// Start the timer:\n\tsrc += t+' = '+ctx+'.tic();';\n\n\t// Create the loop:\n\tsrc += 'for ( '+i+'= 0; '+i+' < '+opts.iterations+'; '+i+'++ ) {';\n\n\t// Insert the loop body:\n\tsrc += code+';';\n\n\t// Close the loop:\n\tsrc += '}';\n\n\t// Stop the timer:\n\tsrc += d+' = '+ctx+'.toc( '+t+' );';\n\n\t// Insert the cleanup code:\n\tsrc += opts.after+';';\n\n\t// Return results:\n\tsrc += ctx+'.done( null, '+d+' );';\n\n\t// Return a value:\n\tsrc += 'return '+id+';';\n\n\treturn src;\n}\n\n\n// EXPORTS //\n\nmodule.exports = generate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wraps a source code string similar to `require`.\n*\n* @private\n* @param {string} src - source code\n* @returns {string} wrapped code\n*/\nfunction wrap( src ) {\n\tvar out = '';\n\tout += '(function(require,__filename,__dirname){';\n\tout += src;\n\tout += '});';\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar vm = require( 'vm' );\nvar wrap = require( './wrap.js' );\n\n\n// MAIN //\n\n/**\n* Compiles JavaScript source code for execution within a V8 virtual machine context.\n*\n* @private\n* @param {string} filename - filename to associate with compiled source code\n* @param {string} code - source code to compile\n* @returns {Function} compiled source code wrapped within a function\n*/\nfunction compile( filename, code ) {\n\tvar script;\n\tvar opts;\n\n\t// Wrap the source code similar to `require`:\n\tcode = wrap( code );\n\n\t// Compile the source code:\n\topts = {\n\t\t'filename': filename,\n\t\t'lineOffset': 0\n\t};\n\tscript = new vm.Script( code, opts );\n\n\t// Run the compiled code in the current V8 context:\n\topts = {\n\t\t'displayErrors': true\n\t};\n\treturn script.runInThisContext( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = compile;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( '@stdlib/random/base/minstd-shuffle' );\nvar createContext = require( './context.js' );\nvar asyncSource = require( './async.js' );\nvar syncSource = require( './sync.js' );\nvar compile = require( './vm_compile.js' );\n\n\n// MAIN //\n\n/**\n* Evaluates source code within a V8 virtual machine context.\n*\n* @private\n* @param {string} src - source code\n* @param {Object} opts - options\n* @param {string} filename - filename\n* @param {string} dirname - directory name\n* @param {Callback} clbk - callback to invoke upon completion\n* @returns {void}\n*/\nfunction evaluate( src, opts, filename, dirname, clbk ) {\n\tvar context;\n\tvar tmp;\n\tvar fcn;\n\tvar err;\n\tvar id;\n\n\t// Create an id:\n\tid = minstd();\n\n\t// Create an execution context:\n\tcontext = createContext( done );\n\n\t// Generate the source code to evaluate...\n\tif ( opts.asynchronous ) {\n\t\tsrc = asyncSource( id, src, opts );\n\t} else {\n\t\tsrc = syncSource( id, src, opts );\n\t}\n\t// Compile the source code:\n\tfcn = compile( filename, src );\n\n\t// Execute the source code:\n\ttmp = fcn.call( context, require, filename, dirname );\n\n\t// Check that the snippet did not prematurely return...\n\tif ( tmp !== id ) {\n\t\terr = new Error( 'evaluation error. Unable to retrieve evaluation results. Ensure that the provided snippet does not return prematurely.' );\n\t\treturn done( err );\n\t}\n\t/**\n\t* Callback invoked upon executing source code.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} results - results\n\t* @returns {void}\n\t*/\n\tfunction done( error, results ) {\n\t\tif ( error ) {\n\t\t\treturn clbk( error );\n\t\t}\n\t\treturn clbk( null, results );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = evaluate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum time.\n*\n* @private\n* @param {ArrayArray} times - times\n* @returns {NonNegativeIntegerArray} minimum time\n*/\nfunction min( times ) {\n\tvar out;\n\tvar t;\n\tvar i;\n\n\tout = times[ 0 ];\n\tfor ( i = 1; i < times.length; i++ ) {\n\t\tt = times[ i ];\n\t\tif (\n\t\t\tt[ 0 ] < out[ 0 ] ||\n\t\t\t(\n\t\t\t\tt[ 0 ] === out[ 0 ] &&\n\t\t\t\tt[ 1 ] < out[ 1 ]\n\t\t\t)\n\t\t) {\n\t\t\tout = t;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = min;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( './min_time.js' );\n\n\n// MAIN //\n\n/**\n* Transforms raw results.\n*\n* @private\n* @param {ArrayArray} raw - raw results\n* @param {PositiveInteger} iterations - number of iterations\n* @returns {Object} transformed results\n*/\nfunction transform( raw, iterations ) {\n\tvar secs;\n\tvar rate;\n\tvar out;\n\tvar m;\n\n\tm = min( raw );\n\tsecs = m[ 0 ] + ( m[ 1 ]/1e9 );\n\trate = iterations / secs;\n\n\tout = {\n\t\t'iterations': iterations,\n\t\t'repeats': raw.length,\n\t\t'min': m,\n\t\t'elapsed': secs,\n\t\t'rate': rate,\n\t\t'times': raw\n\t};\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = transform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar copy = require( './../../copy' );\nvar cwd = require( '@stdlib/process/cwd' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( './../../next-tick' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar evaluate = require( './vm_evaluate.js' );\nvar transform = require( './transform.js' );\n\n\n// VARIABLES //\n\nvar FILENAME = 'timeit.js';\nvar MIN_TIME = 0.1; // seconds\nvar ITERATIONS = 10; // 10^1\nvar MAX_ITERATIONS = 10000000000; // 10^10\n\n\n// MAIN //\n\n/**\n* Times a snippet.\n*\n* @param {string} code - snippet to time\n* @param {Options} [options] - function options\n* @param {string} [options.before=\"\"] - setup code\n* @param {string} [options.after=\"\"] - cleanup code\n* @param {(PositiveInteger|null)} [options.iterations=1e6] - number of iterations\n* @param {PositiveInteger} [options.repeats=3] - number of repeats\n* @param {boolean} [options.asynchronous=false] - boolean indicating whether a snippet is asynchronous\n* @param {Callback} clbk - callback to invoke upon completion\n* @throws {TypeError} first argument must be a string\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} callback argument must be a function\n* @returns {void}\n*\n* @example\n* var code = '';\n* code += 'var x = Math.pow( Math.random(), 3 );';\n* code += 'if ( x !== x ) {';\n* code += 'throw new Error( \\'Something went wrong.\\' );';\n* code += '}';\n*\n* timeit( code, done );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.dir( results );\n* }\n*/\nfunction timeit( code, options, clbk ) {\n\tvar results;\n\tvar opts;\n\tvar dir;\n\tvar err;\n\tvar idx;\n\tvar cb;\n\n\tif ( !isString( code ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', code ) );\n\t}\n\topts = copy( defaults );\n\tif ( arguments.length === 2 ) {\n\t\tcb = options;\n\t} else {\n\t\tcb = clbk;\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( !isFunction( cb ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );\n\t}\n\tresults = new Array( opts.repeats );\n\tdir = cwd();\n\tidx = 0;\n\n\t// Pretest to check for early returns and/or errors...\n\ttry {\n\t\tevaluate( code, opts, FILENAME, dir, onTest );\n\t} catch ( error ) {\n\t\terr = new Error( format( 'evaluation error. Encountered an error when evaluating snippet. %s', error.message ) );\n\t\treturn done( err );\n\t}\n\n\t/**\n\t* Evaluates a code snippet on the next turn of the event loop. Waiting until the next turn avoids the current turn being bogged down by a long running queue.\n\t*\n\t* @private\n\t* @param {Callback} clbk - callback\n\t*/\n\tfunction next( clbk ) {\n\t\tnextTick( onTick );\n\n\t\t/**\n\t\t* Callback invoked upon next turn of event loop.\n\t\t*\n\t\t* @private\n\t\t*/\n\t\tfunction onTick() {\n\t\t\tevaluate( code, opts, FILENAME, dir, clbk );\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked after completing pretest.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onTest( error, time ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( !isArray( time ) || time.length !== 2 ) {\n\t\t\t// This should only happen if someone is a bad actor and attempts to call the `done` callback without providing timing results.\n\t\t\terror = new Error( 'evaluation error. Did not receive timing results.' );\n\t\t\treturn done( error );\n\t\t}\n\t\tif ( opts.iterations === null ) {\n\t\t\topts.iterations = ITERATIONS;\n\t\t\treturn next( onRun );\n\t\t}\n\t\t// Begin timing the snippet...\n\t\treturn next( onFinish );\n\t}\n\n\t/**\n\t* Callback invoked upon running a pre-run to determine the number of iterations.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onRun( error, time ) {\n\t\tvar t;\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tt = time[ 0 ] + ( time[ 1 ]/1e9 );\n\t\tif (\n\t\t\tt < MIN_TIME &&\n\t\t\topts.iterations < MAX_ITERATIONS\n\t\t) {\n\t\t\topts.iterations *= 10;\n\t\t\treturn next( onRun );\n\t\t}\n\t\t// Begin timing the snippet...\n\t\treturn next( onFinish );\n\t}\n\n\t/**\n\t* Callback invoked upon executing code.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {NonNegativeIntegerArray} time - results\n\t* @returns {void}\n\t*/\n\tfunction onFinish( error, time ) {\n\t\tif ( error ) {\n\t\t\treturn done( error );\n\t\t}\n\t\tresults[ idx ] = time;\n\t\tidx += 1;\n\t\tif ( idx < opts.repeats ) {\n\t\t\treturn next( onFinish );\n\t\t}\n\t\tdone( null, results );\n\t}\n\n\t/**\n\t* Callback invoked upon completion.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @param {ArrayArray} results - raw results\n\t*/\n\tfunction done( error, results ) {\n\t\tvar out;\n\t\tif ( !error ) {\n\t\t\tout = transform( results, opts.iterations );\n\t\t}\n\t\t// Avoid releasing the zalgo:\n\t\tnextTick( onTick );\n\n\t\t/**\n\t\t* Callback invoked upon the next tick.\n\t\t*\n\t\t* @private\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction onTick() {\n\t\t\tif ( error ) {\n\t\t\t\treturn cb( error );\n\t\t\t}\n\t\t\tcb( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = timeit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Time a snippet.\n*\n* @module @stdlib/utils/timeit\n*\n* @example\n* var timeit = require( '@stdlib/utils/timeit' );\n*\n* var code = '';\n* code += 'var x = Math.pow( Math.random(), 3 );';\n* code += 'if ( x !== x ) {';\n* code += 'throw new Error( \\'Something went wrong.\\' );';\n* code += '}';\n*\n* timeit( code, done );\n*\n* function done( error, results ) {\n* if ( error ) {\n* throw error;\n* }\n* console.dir( results );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not throw, returns the function return value; otherwise, returns `y`.\n*\n* @param {Function} x - function to try invoking\n* @param {*} y - value to return if a function throws\n* @throws {TypeError} first argument must be a function\n* @returns {*} either the return value of `x` or the provided argument `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n* var z = trycatch( x, -1.0 );\n* // returns \n*/\nfunction trycatch( x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\ttry {\n\t\treturn x();\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn y;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trycatch;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not throw, return the function return value; otherwise, return `y`.\n*\n* @module @stdlib/utils/try-catch\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trycatch = require( '@stdlib/utils/try-catch' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n* var z = trycatch( x, -1.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Wraps a function in a try/catch block.\n*\n* @param {Function} fcn - function to wrap\n* @param {*} [thisArg] - function context\n* @throws {TypeError} must provide a function\n* @returns {Function} wrapped function\n*\n* @example\n* function fcn() {\n* throw new Error( 'beep boop' );\n* }\n*\n* var f = wrap( fcn );\n*\n* var out = f();\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* // => 'beep boop'\n* }\n*/\nfunction wrap( fcn, thisArg ) {\n\tvar ctx;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tctx = thisArg;\n\t} else {\n\t\tctx = null;\n\t}\n\treturn wrapped;\n\n\t/**\n\t* Wrapped function.\n\t*\n\t* @private\n\t* @param {...*} [args] - function arguments\n\t* @returns {*|Error} returned value or an error object\n\t*/\n\tfunction wrapped() {\n\t\tvar args;\n\t\tvar len;\n\t\tvar i;\n\n\t\tlen = arguments.length;\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\t\ttry {\n\t\t\treturn fcn.apply( ctx, args );\n\t\t} catch ( error ) {\n\t\t\tif ( isError( error ) ) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t\t// Handle thrown literals...\n\t\t\tif ( typeof error === 'object' ) {\n\t\t\t\treturn new Error( JSON.stringify( error ) );\n\t\t\t}\n\t\t\treturn new Error( error.toString() );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wrap a function in a try/catch block.\n*\n* @module @stdlib/utils/try-function\n*\n* @example\n* var wrap = require( '@stdlib/utils/try-function' );\n*\n* function fcn() {\n* throw new Error( 'beep boop' );\n* }\n*\n* var f = wrap( fcn );\n*\n* var out = f();\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* // => 'beep boop'\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isError = require( '@stdlib/assert/is-error' );\n\n\n// MAIN //\n\n/**\n* Wraps `require` in a try/catch block.\n*\n* @param {string} id - module id\n* @returns {*|Error} `module.exports` of the resolved module or an error\n*\n* @example\n* var out = tryRequire( 'beepboop' );\n*\n* if ( out instanceof Error ) {\n* console.error( out.message );\n* }\n*/\nfunction tryRequire( id ) {\n\ttry {\n\t\treturn require( id ); // eslint-disable-line stdlib/no-dynamic-require\n\t} catch ( error ) {\n\t\tif ( isError( error ) ) {\n\t\t\treturn error;\n\t\t}\n\t\t// Handle case where a literal is thrown...\n\t\tif ( typeof error === 'object' ) {\n\t\t\treturn new Error( JSON.stringify( error ) );\n\t\t}\n\t\treturn new Error( error.toString() );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = tryRequire;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Wrap `require` in a try/catch block.\n*\n* @module @stdlib/utils/try-require\n*\n* @example\n* var tryRequire = require( '@stdlib/utils/try-require' );\n*\n* var out = tryRequire( 'beepboop' );\n*\n* if ( out instanceof Error ) {\n* console.log( out.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* If a function does not throw, returns the function return value; otherwise, returns the return value of a second function `y`.\n*\n* @param {Function} x - function to try invoking\n* @param {Function} y - function to invoke if a function throws\n* @throws {TypeError} first argument must be a function\n* @returns {*} the return value of either `x` or `y`\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n*\n* function y() {\n* return randu();\n* }\n*\n* var z = trythen( x, y );\n* // returns \n*/\nfunction trythen( x, y ) {\n\tif ( !isFunction( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', x ) );\n\t}\n\tif ( !isFunction( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', y ) );\n\t}\n\ttry {\n\t\treturn x();\n\t} catch ( error ) {\n\t\treturn y( error );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = trythen;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* If a function does not throw, return the function return value; otherwise, return the return value of a second function `y`.\n*\n* @module @stdlib/utils/try-then\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n* var trythen = require( '@stdlib/utils/try-then' );\n*\n* function x() {\n* if ( randu() < 0.5 ) {\n* throw new Error( 'beep' );\n* }\n* return 1.0;\n* }\n*\n* function y() {\n* return randu();\n* }\n*\n* var z = trythen( x, y );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/jsdoc-doctest-decimal-point */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/max' );\nvar UINT8 = require( '@stdlib/constants/uint8/max' );\nvar INT16 = require( '@stdlib/constants/int16/max' );\nvar UINT16 = require( '@stdlib/constants/uint16/max' );\nvar INT32 = require( '@stdlib/constants/int32/max' );\nvar UINT32 = require( '@stdlib/constants/uint32/max' );\nvar FLOAT16 = require( '@stdlib/constants/float16/pinf' );\nvar FLOAT32 = require( '@stdlib/constants/float32/pinf' );\nvar FLOAT64 = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum value of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} maximum value\n*\n* @example\n* var m = typemax( 'int8' );\n* // returns 127\n*\n* @example\n* var m = typemax( 'uint8' );\n* // returns 255\n*\n* @example\n* var m = typemax( 'int16' );\n* // returns 32767\n*/\nfunction typemax( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'uint32':\n\t\treturn UINT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'uint8':\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn UINT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'uint16':\n\t\treturn UINT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = typemax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum value of a specified numeric type.\n*\n* @module @stdlib/utils/type-max\n*\n* @example\n* var typemax = require( '@stdlib/utils/type-max' );\n*\n* var m = typemax( 'int8' );\n* // returns 127\n*\n* m = typemax( 'uint8' );\n* // returns 255\n*\n* m = typemax( 'int16' );\n* // returns 32767\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/jsdoc-doctest-decimal-point */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\nvar INT8 = require( '@stdlib/constants/int8/min' );\nvar INT16 = require( '@stdlib/constants/int16/min' );\nvar INT32 = require( '@stdlib/constants/int32/min' );\nvar FLOAT16 = require( '@stdlib/constants/float16/ninf' );\nvar FLOAT32 = require( '@stdlib/constants/float32/ninf' );\nvar FLOAT64 = require( '@stdlib/constants/float64/ninf' );\n\n\n// MAIN //\n\n/**\n* Returns the minimum value of a specified numeric type.\n*\n* @param {string} dtype - numeric type\n* @throws {TypeError} must provide a recognized numeric type\n* @returns {number} minimum value\n*\n* @example\n* var m = typemin( 'int8' );\n* // returns -128\n*\n* @example\n* var m = typemin( 'uint8' );\n* // returns 0\n*\n* @example\n* var m = typemin( 'int16' );\n* // returns -32768\n*/\nfunction typemin( dtype ) {\n\tswitch ( dtype ) {\n\tcase 'float64':\n\t\treturn FLOAT64;\n\tcase 'int32':\n\t\treturn INT32;\n\tcase 'float32':\n\t\treturn FLOAT32;\n\tcase 'int8':\n\t\treturn INT8;\n\tcase 'int16':\n\t\treturn INT16;\n\tcase 'float16':\n\t\treturn FLOAT16;\n\tcase 'uint32':\n\t\t// Fall-through..\n\tcase 'uint16': // eslint-disable-line no-fallthrough\n\t\t// Fall-through..\n\tcase 'uint8': // eslint-disable-line no-fallthrough\n\t\t// Fall-through...\n\tcase 'uint8c': // eslint-disable-line no-fallthrough\n\t\treturn 0;\n\tdefault:\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized type. Value: `%s`.', dtype ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = typemin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum value of a specified numeric type.\n*\n* @module @stdlib/utils/type-min\n*\n* @example\n* var typemin = require( '@stdlib/utils/type-min' );\n*\n* var m = typemin( 'int8' );\n* // returns -128\n*\n* m = typemin( 'uint8' );\n* // returns 0\n*\n* m = typemin( 'int16' );\n* // returns -32768\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts the first letter of each object key to lowercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'AA': 1,\n* 'BB': 2\n* };\n*\n* var obj2 = uncapitalizeKeys( obj1 );\n* // returns { 'aA': 1, 'bB': 2 }\n*/\nfunction uncapitalizeKeys( obj ) {\n\tvar out;\n\tvar key;\n\tvar k;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tif ( key === '' ) {\n\t\t\t\tout[ key ] = obj[ key ];\n\t\t\t} else {\n\t\t\t\tk = key.charAt( 0 ).toLowerCase() + key.slice( 1 );\n\t\t\t\tout[ k ] = obj[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncapitalizeKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert the first letter of each object key to lowercase.\n*\n* @module @stdlib/utils/uncapitalize-keys\n*\n* @example\n* var uncapitalizeKeys = require( '@stdlib/utils/uncapitalize-keys' );\n*\n* var obj1 = {\n* 'AA': 1,\n* 'BB': 2\n* };\n*\n* var obj2 = uncapitalizeKeys( obj1 );\n* // returns { 'aA': 1, 'bB': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a curried function into a function invoked with multiple arguments.\n*\n* @param {Function} fcn - curried function\n* @param {PositiveInteger} [arity] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} uncurried function\n*\n* @example\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurry( addX );\n*\n* var sum = add( 2, 3 );\n* // returns 5\n*/\nfunction uncurry( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = null;\n\t}\n\telse if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t}\n\telse if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t}\n\telse {\n\t\tlen = null;\n\t\tcontext = arity;\n\t}\n\treturn uncurried;\n\n\t/**\n\t* Uncurried function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} if arity is set, must provide expected number of input arguments\n\t* @throws {Error} configured arity must be compatible with curried function\n\t* @throws {Error} if arity is not set, number of arguments must be compatible with curried function\n\t* @returns {*} function result\n\t*/\n\tfunction uncurried() {\n\t\tvar f;\n\t\tvar i;\n\n\t\tf = fcn;\n\t\tif ( len ) {\n\t\t\tif ( len > arguments.length ) {\n\t\t\t\tthrow new Error( format( 'insufficient arguments. Expected %u argument(s) and only received %u argument(s).', len, arguments.length ) );\n\t\t\t}\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( isFunction( f ) ) {\n\t\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error( format( 'invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', len, i ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn f;\n\t\t}\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\tif ( isFunction( f ) ) {\n\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t} else {\n\t\t\t\tthrow new Error( format( 'invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', arguments.length, i ) );\n\t\t\t}\n\t\t}\n\t\treturn f;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncurry;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a curried function into a function invoked with multiple arguments.\n*\n* @module @stdlib/utils/uncurry\n*\n* @example\n* var uncurry = require( '@stdlib/utils/uncurry' );\n*\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurry( addX );\n*\n* var sum = add( 2, 3 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Transforms a curried function into a function invoked with multiple arguments.\n*\n* @param {Function} fcn - curried function\n* @param {PositiveInteger} [arity] - number of parameters\n* @param {*} [thisArg] - evaluation context\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} `arity` argument must be a positive integer\n* @returns {Function} uncurried function\n*\n* @example\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurryRight( addX );\n*\n* var sum = add( 3, 2 );\n* // returns 5\n*/\nfunction uncurryRight( fcn, arity, thisArg ) {\n\tvar context;\n\tvar len;\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tlen = null;\n\t}\n\telse if ( arguments.length > 2 ) {\n\t\tlen = arity;\n\t\tcontext = thisArg;\n\t\tif ( !isPositiveInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Arity argument must be a positive integer. Value: `%s`.', len ) );\n\t\t}\n\t}\n\telse if ( isPositiveInteger( arity ) ) {\n\t\tlen = arity;\n\t}\n\telse {\n\t\tlen = null;\n\t\tcontext = arity;\n\t}\n\treturn uncurried;\n\n\t/**\n\t* Uncurried function.\n\t*\n\t* @private\n\t* @param {...*} args - arguments\n\t* @throws {Error} if arity is set, must provide expected number of input arguments\n\t* @throws {Error} configured arity must be compatible with curried function\n\t* @throws {Error} if arity is not set, number of arguments must be compatible with curried function\n\t* @returns {*} function result\n\t*/\n\tfunction uncurried() {\n\t\tvar f;\n\t\tvar i;\n\n\t\tf = fcn;\n\t\tif ( len ) {\n\t\t\tif ( len > arguments.length ) {\n\t\t\t\tthrow new Error( format( 'insufficient arguments. Expected %u argument(s) and only received %u argument(s).', len, arguments.length ) );\n\t\t\t}\n\t\t\tfor ( i = len-1; i >= 0; i-- ) {\n\t\t\t\tif ( isFunction( f ) ) {\n\t\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error( format( 'invalid invocation. The configured arity exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', len, i ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn f;\n\t\t}\n\t\tfor ( i = arguments.length-1; i >= 0; i-- ) {\n\t\t\tif ( isFunction( f ) ) {\n\t\t\t\tf = f.call( context, arguments[ i ] );\n\t\t\t} else {\n\t\t\t\tthrow new Error( format( 'invalid invocation. Number of arguments exceeds the number of possible curried function invocations. Expected: `%u`. Actual: `%u`.', arguments.length, i ) );\n\t\t\t}\n\t\t}\n\t\treturn f;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = uncurryRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform a curried function into a function invoked with multiple arguments.\n*\n* @module @stdlib/utils/uncurry-right\n*\n* @example\n* var uncurryRight = require( '@stdlib/utils/uncurry-right' );\n*\n* function addX( x ) {\n* return function addY( y ) {\n* return x + y;\n* };\n* }\n*\n* var add = uncurryRight( addX );\n*\n* var sum = add( 3, 2 );\n* // returns 5\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {Array} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {Array} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = unshift( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction unshift( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array/buffer' );\nvar ceil2 = require( '@stdlib/math/base/special/ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {Array} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar format = require( '@stdlib/string/format' );\nvar unshiftArray = require( './unshift_array.js' );\nvar unshiftObject = require( './unshift_object.js' );\nvar unshiftTypedArray = require( './unshift_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds one or more elements to the beginning of a collection.\n*\n* @param {(Array|TypedArray|Object)} collection - collection\n* @param {...*} items - items to add\n* @throws {TypeError} must provide either an array, typed array, or an array-like object\n* @returns {(Array|TypedArray|Object)} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction unshift( collection ) {\n\tvar items;\n\tvar i;\n\titems = new Array( arguments.length-1 );\n\tfor ( i = 0; i < arguments.length-1; i++ ) {\n\t\titems[ i ] = arguments[ i+1 ];\n\t}\n\tif ( isArray( collection ) ) {\n\t\treturn unshiftArray( collection, items );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection ) ) {\n\t\treturn unshiftTypedArray( collection, items );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection !== null &&\n\t\ttypeof collection === 'object' &&\n\t\ttypeof collection.length === 'number' &&\n\t\tisInteger( collection.length ) &&\n\t\tcollection.length >= 0\n\t) {\n\t\treturn unshiftObject( collection, items );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = unshift;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add one or more elements to the beginning of a collection.\n*\n* @module @stdlib/utils/unshift\n*\n* @example\n* var unshift = require( '@stdlib/utils/unshift' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = unshift( arr, 6.0, 7.0 );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function until a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to stop invoking a function\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i >= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* until( predicate, beep );\n*/\nfunction until( predicate, fcn, thisArg ) {\n\tvar i;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\ti = 0;\n\twhile ( !predicate( i ) ) {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = until;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function until a test condition is true.\n*\n* @module @stdlib/utils/until\n*\n* @example\n* var until = require( '@stdlib/utils/until' );\n*\n* function predicate( i ) {\n* return ( i >= 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* until( predicate, beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, key, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, key, collection ) {\n* console.log( '%s: %d', key, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* untilEach( arr, predicate, log );\n*/\nfunction untilEach( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = 0;\n\twhile (\n\t\ti < len &&\n\t\t!predicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/until-each\n*\n* @example\n* var untilEach = require( '@stdlib/utils/until-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* untilEach( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Until a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `untilEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `untilEach()`, `[].push()` behavior is consistent with `untilEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to stop iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* untilEachRight( arr, predicate, log );\n*/\nfunction untilEachRight( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = len - 1;\n\twhile (\n\t\ti >= 0 &&\n\t\t!predicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = untilEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Until a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/until-each-right\n*\n* @example\n* var untilEachRight = require( '@stdlib/utils/until-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v !== v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* untilEachRight( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/assert/is-integer' );\nvar isArray = require( '@stdlib/assert/is-array' );\n\n\n// MAIN //\n\n/**\n* Unzips a zipped array (i.e., a nested array of tuples).\n*\n* @param {Array} arr - zipped array\n* @param {Array} [idx] - array of indices specifying which tuple elements to unzip\n* @throws {TypeError} first argument must be a zipped array\n* @throws {TypeError} second argument must be an array of integer indices\n* @throws {Error} indices must be on the interval from zero to the tuple length\n* @returns {Array} array of unzipped arrays\n*\n* @example\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n*\n* var out = unzip( arr );\n* // returns [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n*\n* @example\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n*\n* var out = unzip( arr, [ 0, 2 ] );\n* // returns [ [ 1, 2 ], [ 3, 4 ] ]\n*/\nfunction unzip( arr, idx ) {\n\tvar numVals;\n\tvar len;\n\tvar out;\n\tvar tmp;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( !isArray( arr ) ) {\n\t\tthrow new TypeError( 'invalid argument. Must provide a zipped array.' );\n\t}\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( !isArray( arr[i] ) ) {\n\t\t\tthrow new TypeError( 'invalid argument. Array must only contain arrays.' );\n\t\t}\n\t}\n\t// Assume that the first tuple is representative of all tuples...\n\tnumVals = arr[ 0 ].length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isArray( idx ) ) {\n\t\t\tthrow new TypeError( 'invalid argument. Indices must be specified as an array.' );\n\t\t}\n\t\tfor ( i = 0; i < idx.length; i++ ) {\n\t\t\tk = idx[ i ];\n\t\t\tif ( !isInteger( k ) ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. All indices must be integers.' );\n\t\t\t}\n\t\t\tif ( k < 0 || k > numVals ) {\n\t\t\t\tthrow new Error( 'invalid argument. Must provide valid indices (i.e., must be a nonnegative integer less than or equal to the tuple length).' );\n\t\t\t}\n\t\t}\n\t\tnumVals = idx.length;\n\t} else {\n\t\tidx = new Array( numVals );\n\t\tfor ( i = 0; i < numVals; i++ ) {\n\t\t\tidx[ i ] = i;\n\t\t}\n\t}\n\tout = new Array( numVals );\n\tfor ( j = 0; j < numVals; j++ ) {\n\t\ttmp = new Array( len );\n\t\tk = idx[ j ];\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\ttmp[ i ] = arr[ i ][ k ];\n\t\t}\n\t\tout[ j ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = unzip;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Unzip a zipped array (i.e., a nested array of tuples).\n*\n* @module @stdlib/utils/unzip\n*\n* @example\n* var unzip = require( '@stdlib/utils/unzip' );\n*\n* var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n* var out = unzip( arr );\n* // returns [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n*\n* arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n* out = unzip( arr, [ 0, 2 ] );\n* // returns [ [ 1, 2 ], [ 3, 4 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Converts each object key to uppercase.\n*\n* @param {Object} obj - source object\n* @throws {TypeError} must provide an object\n* @returns {Object} new object\n*\n* @example\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = uppercaseKeys( obj1 );\n* // returns { 'A': 1, 'B': 2 }\n*/\nfunction uppercaseKeys( obj ) {\n\tvar out;\n\tvar key;\n\tif ( typeof obj !== 'object' || obj === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', obj ) );\n\t}\n\tout = {};\n\tfor ( key in obj ) {\n\t\tif ( hasOwnProp( obj, key ) ) {\n\t\t\tout[ key.toUpperCase() ] = obj[ key ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uppercaseKeys;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert each object key to uppercase.\n*\n* @module @stdlib/utils/uppercase-keys\n*\n* @example\n* var uppercaseKeys = require( '@stdlib/utils/uppercase-keys' );\n*\n* var obj1 = {\n* 'a': 1,\n* 'b': 2\n* };\n*\n* var obj2 = uppercaseKeys( obj1 );\n* // returns { 'A': 1, 'B': 2 }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar objectKeys = require( './../../keys' );\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property values.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} value array\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var vals = objectValues( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\nfunction objectValues( obj ) {\n\tvar keys;\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ] = obj[ keys[i] ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectValues;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own enumerable property values.\n*\n* @module @stdlib/utils/values\n*\n* @example\n* var objectValues = require( '@stdlib/utils/values' );\n*\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 'bar'\n* };\n*\n* var vals = objectValues( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( '@stdlib/assert/is-object-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited enumerable property values.\n*\n* @param {ObjectLike} obj - input object\n* @throws {TypeError} must provide an object-like value\n* @returns {Array} value array\n*\n* @example\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var values = objectValuesIn( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\nfunction objectValuesIn( obj ) {\n\tvar out;\n\tvar key;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an object (except null). Value: `%s`.', obj ) );\n\t}\n\tout = [];\n\tfor ( key in obj ) { // eslint-disable-line guard-for-in\n\t\tout.push( obj[ key ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectValuesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited enumerable property values.\n*\n* @module @stdlib/utils/values-in\n*\n* @example\n* var objectValuesIn = require( '@stdlib/utils/values-in' );\n*\n* function Foo() {\n* this.beep = 'boop';\n* return this;\n* }\n*\n* Foo.prototype.foo = 'bar';\n*\n* var obj = new Foo();\n*\n* var values = objectValuesIn( obj );\n* // e.g., returns [ 'boop', 'bar' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Invokes a function while a test condition is true.\n*\n* @param {Function} predicate - function which indicates whether to continue invoking a function\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the invoked function\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be a function\n*\n* @example\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'beep: %d', i );\n* }\n*\n* whilst( predicate, beep );\n*/\nfunction whilst( predicate, fcn, thisArg ) {\n\tvar i;\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\ti = 0;\n\twhile ( predicate( i ) ) {\n\t\tfcn.call( thisArg, i );\n\t\ti += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = whilst;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Invoke a function while a test condition is true.\n*\n* @module @stdlib/utils/while\n*\n* @example\n* var whilst = require( '@stdlib/utils/while' );\n*\n* function predicate( i ) {\n* return ( i < 5 );\n* }\n*\n* function beep( i ) {\n* console.log( 'boop: %d', i );\n* }\n*\n* whilst( predicate, beep );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* whileEach( arr, predicate, log );\n*/\nfunction whileEach( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = 0;\n\twhile (\n\t\ti < len &&\n\t\tpredicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\t\ti += 1;\n\t\tlen = collection.length; // ...account for dynamically resizing a collection\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection.\n*\n* @module @stdlib/utils/while-each\n*\n* @example\n* var whileEach = require( '@stdlib/utils/while-each' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, 2, 3, 4, NaN, 5 ];\n*\n* whileEach( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* While a test condition is true, invokes a function once for each element in a collection, iterating from right to left.\n*\n* ## Notes\n*\n* - For dynamic array resizing, the only behavior made intentionally consistent with `whileEach` (iterating from left to right) is when elements are pushed onto the beginning (end) of an array. In other words, for `whileEach()`, `[].push()` behavior is consistent with `whileEachRight()` `[].unshift()` behavior.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - function which indicates whether to continue iterating over a collection\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - execution context for the applied function\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @throws {TypeError} third argument must be a function\n* @returns {Collection} input collection\n*\n* @example\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* whileEachRight( arr, predicate, log );\n*/\nfunction whileEachRight( collection, predicate, fcn, thisArg ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tlen = collection.length;\n\ti = len - 1;\n\twhile (\n\t\ti >= 0 &&\n\t\tpredicate( collection[ i ], i, collection )\n\t) {\n\t\tfcn.call( thisArg, collection[ i ], i, collection );\n\n\t\t// Account for dynamically resizing a collection...\n\t\tif ( len !== collection.length ) {\n\t\t\ti += ( collection.length - len );\n\t\t\tlen = collection.length;\n\t\t}\n\t\ti -= 1;\n\t}\n\treturn collection;\n}\n\n\n// EXPORTS //\n\nmodule.exports = whileEachRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* While a test condition is true, invoke a function once for each element in a collection, iterating from right to left.\n*\n* @module @stdlib/utils/while-each-right\n*\n* @example\n* var whileEachRight = require( '@stdlib/utils/while-each-right' );\n*\n* function predicate( v, index, collection ) {\n* return ( v === v );\n* }\n*\n* function log( v, index, collection ) {\n* console.log( '%s: %d', index, v );\n* }\n*\n* var arr = [ 1, NaN, 2, 3, 4, 5 ];\n*\n* whileEachRight( arr, predicate, log );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar propertyNames = require( './../../property-names' );\nvar propertySymbols = require( './../../property-symbols' );\nvar isWritable = require( '@stdlib/assert/is-writable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own property writable names and symbols\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var props = writableProperties( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction writableProperties( value ) {\n\tvar out;\n\tvar tmp;\n\tvar n;\n\tvar i;\n\n\tout = propertyNames( value );\n\tn = 0;\n\tfor ( i = 0; i < out.length; i++ ) {\n\t\tif ( isWritable( value, out[ i ] ) ) {\n\t\t\tout[ n ] = out[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tout.length = n;\n\n\ttmp = propertySymbols( value );\n\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\tif ( isWritable( value, tmp[ i ] ) ) {\n\t\t\tout.push( tmp[ i ] );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writableProperties;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable property names and symbols.\n*\n* @module @stdlib/utils/writable-properties\n*\n* @example\n* var writableProperties = require( '@stdlib/utils/writable-properties' );\n*\n* var props = writableProperties({\n* 'foo': 'bar',\n* 'beep': 'boop'\n* });\n* // e.g., returns [ 'foo', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isWritable = require( '@stdlib/assert/is-writable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable property names and symbols.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable property names and symbols\n*\n* @example\n* var props = writablePropertiesIn( [] );\n* // returns [...]\n*/\nfunction writablePropertiesIn( value ) {\n\tvar cache;\n\tvar out;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting writable properties...\n\tcache = {};\n\tout = [];\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a name more than once\n\t\t\t\tisWritable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false && // guards against processing a symbol more than once\n\t\t\t\tisWritable( obj, k )\n\t\t\t) {\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertiesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable property names and symbols.\n*\n* @module @stdlib/utils/writable-properties-in\n*\n* @example\n* var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' );\n*\n* var props = writablePropertiesIn( [] );\n* // returns [...]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar Object = require( '@stdlib/object/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own writable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNames( obj );\n* // returns [ 'a' ]\n*/\nfunction writablePropertyNames( value ) {\n\tvar names;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tnames = getOwnPropertyNames( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < names.length; i++ ) {\n\t\tif ( isWritableProperty( value, names[ i ] ) ) {\n\t\t\tnames[ n ] = names[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tnames.length = n;\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertyNames;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable property names.\n*\n* @module @stdlib/utils/writable-property-names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var writablePropertyNames = require( '@stdlib/utils/writable-property-names' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNames( obj );\n* // returns [ 'a' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertyNames = require( './../../property-names' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable property names.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable property names\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNamesIn( obj );\n* // e.g., returns [ 'a', ... ]\n*/\nfunction writablePropertyNamesIn( value ) {\n\tvar names;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting writable property names...\n\tnames = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertyNames( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tnames.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn names;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertyNamesIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable property names.\n*\n* @module @stdlib/utils/writable-property-names-in\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n* var writablePropertyNamesIn = require( '@stdlib/utils/writable-property-names-in' );\n*\n* var obj = { 'a': 'b' };\n*\n* defineProperty( obj, 'beep', {\n* 'configurable': true,\n* 'enumerable': true,\n* 'writable': false,\n* 'value': 'boop'\n* });\n*\n* var keys = writablePropertyNamesIn( obj );\n* // e.g., returns [ 'a', ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own writable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own writable symbol properties\n*\n* @example\n* var symbols = writablePropertySymbols( {} );\n*/\nfunction writablePropertySymbols( value ) {\n\tvar symbols;\n\tvar i;\n\tvar n;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\tsymbols = getOwnPropertySymbols( Object( value ) );\n\tn = 0;\n\tfor ( i = 0; i < symbols.length; i++ ) {\n\t\tif ( isWritableProperty( value, symbols[ i ] ) ) {\n\t\t\tsymbols[ n ] = symbols[ i ];\n\t\t\tn += 1;\n\t\t}\n\t}\n\tsymbols.length = n;\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertySymbols;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own writable symbol properties.\n*\n* @module @stdlib/utils/writable-property-symbols\n*\n* @example\n* var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' );\n*\n* var symbols = writablePropertySymbols( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getOwnPropertySymbols = require( './../../property-symbols' );\nvar getPrototypeOf = require( './../../get-prototype-of' );\nvar isWritableProperty = require( '@stdlib/assert/is-writable-property' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own and inherited writable symbol properties.\n*\n* @param {*} value - input object\n* @returns {Array} a list of own and inherited writable symbol properties\n*\n* @example\n* var symbols = writablePropertySymbolsIn( {} );\n*/\nfunction writablePropertySymbolsIn( value ) {\n\tvar symbols;\n\tvar cache;\n\tvar obj;\n\tvar tmp;\n\tvar k;\n\tvar i;\n\n\tif ( value === null || value === void 0 ) {\n\t\treturn [];\n\t}\n\t// Cast the value to an object:\n\tobj = Object( value );\n\n\t// Walk the prototype chain collecting all writable symbol properties...\n\tsymbols = [];\n\tcache = {};\n\tdo {\n\t\ttmp = getOwnPropertySymbols( obj );\n\t\tfor ( i = 0; i < tmp.length; i++ ) {\n\t\t\tk = tmp[ i ];\n\t\t\tif (\n\t\t\t\thasOwnProp( cache, k ) === false &&\n\t\t\t\tisWritableProperty( obj, k )\n\t\t\t) {\n\t\t\t\tsymbols.push( k );\n\t\t\t}\n\t\t\tcache[ k ] = true;\n\t\t}\n\t\tobj = getPrototypeOf( obj );\n\t} while ( obj );\n\n\treturn symbols;\n}\n\n\n// EXPORTS //\n\nmodule.exports = writablePropertySymbolsIn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an array of an object's own and inherited writable symbol properties.\n*\n* @module @stdlib/utils/writable-property-symbols-in\n*\n* @example\n* var writablePropertySymbolsIn = require( '@stdlib/utils/writable-property-symbols-in' );\n*\n* var symbols = writablePropertySymbolsIn( {} );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Generates array tuples from input arrays.\n*\n* @param {...Array} arr - input arrays to be zipped\n* @param {Object} [opts] - function options\n* @param {boolean} [opts.trunc=true] - boolean indicating whether to truncate arrays longer than the shortest input array\n* @param {*} [opts.fill=null] - fill value used for arrays of unequal length\n* @param {boolean} [opts.arrays=false] - boolean indicating whether an input array should be interpreted as an array of arrays to be zipped\n* @throws {TypeError} must provide array arguments\n* @throws {Error} must provide at least one array\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} output array of arrays\n*\n* @example\n* var zipped = zip( [ 1, 2 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* @example\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* @example\n* var opts = {\n* 'trunc': false\n* };\n*\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n*\n* @example\n* var opts = {\n* 'trunc': false,\n* 'fill': ''\n* };\n*\n* var zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, '' ] ]\n*\n* @example\n* var arr = [ [ 1, 2 ], [ 'a', 'b' ] ];\n*\n* // Default behavior:\n* var zipped = zip( arr );\n* // returns [ [ [ 1, 2 ] ], [ [ 'a', 'b' ] ] ]\n*\n* // Array of arrays:\n* zipped = zip( arr, { 'arrays': true } );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*/\nfunction zip() {\n\tvar nargs;\n\tvar args;\n\tvar fill;\n\tvar opts;\n\tvar arg;\n\tvar flg;\n\tvar len;\n\tvar arr;\n\tvar out;\n\tvar val;\n\tvar i;\n\tvar j;\n\n\topts = {};\n\tfill = null;\n\targs = Array.prototype.slice.call( arguments );\n\tnargs = args.length;\n\n\tfor ( i = 0; i < nargs-1; i++ ) {\n\t\tif ( !isArray( args[i] ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide array arguments. Value: `%s`.', args[i] ) );\n\t\t}\n\t}\n\targ = args[ nargs-1 ];\n\tflg = isObject( arg );\n\tif ( !flg && !isArray( arg ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be either an array or an options object. Value: `%s`.', arg ) );\n\t}\n\tif ( flg ) {\n\t\topts = args.pop();\n\t}\n\tnargs = args.length;\n\tif ( nargs === 0 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide at least one array.' );\n\t}\n\tif ( hasOwnProp( opts, 'trunc' ) ) {\n\t\tif ( !isBoolean( opts.trunc ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'trunc', opts.trunc ) );\n\t\t}\n\t} else {\n\t\topts.trunc = true;\n\t}\n\tif ( hasOwnProp( opts, 'fill' ) ) {\n\t\tfill = opts.fill;\n\t}\n\tif ( hasOwnProp( opts, 'arrays' ) ) {\n\t\tif ( !isBoolean( opts.arrays ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'arrays', opts.arrays ) );\n\t\t}\n\t} else {\n\t\topts.arrays = false;\n\t}\n\tif ( nargs === 1 && opts.arrays ) {\n\t\t// Treat the lone array argument as an array of arrays to be zipped...\n\t\targs = args[ 0 ];\n\t\tnargs = args.length;\n\t}\n\tlen = args[ 0 ].length;\n\tif ( opts.trunc ) {\n\t\t// Find the min array length...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tval = args[ i ].length;\n\t\t\tif ( val < len ) {\n\t\t\t\tlen = val;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Find the max array length...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tval = args[ i ].length;\n\t\t\tif ( val > len ) {\n\t\t\t\tlen = val;\n\t\t\t}\n\t\t}\n\t}\n\tout = new Array( len );\n\tfor ( j = 0; j < len; j++ ) {\n\t\t// Temporary array to store tuples...\n\t\tarr = new Array( nargs );\n\n\t\t// Create the tuples...\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targ = args[ i ];\n\n\t\t\t// If an array is too short, use a fill value...\n\t\t\tif ( arg.length <= j ) {\n\t\t\t\tarr[ i ] = fill;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tarr[ i ] = arg[ j ];\n\t\t}\n\t\tout[ j ] = arr;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = zip;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate array tuples from input arrays.\n*\n* @module @stdlib/utils/zip\n*\n* @example\n* var zip = require( '@stdlib/utils/zip' );\n*\n* var zipped = zip( [ 1, 2 ], [ 'a', 'b' ] );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ] ]\n*\n* var opts = {\n* 'trunc': false\n* };\n*\n* zipped = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts );\n* // returns [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n/*\n* The following modules are intentionally not exported: library-manifest\n*/\n\n// MODULES //\n\nvar setReadOnly = require( './../define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace utils\n*/\nvar utils = {};\n\n/**\n* @name any\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any}\n*/\nsetReadOnly( utils, 'any', require( './../any' ) );\n\n/**\n* @name anyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any-by}\n*/\nsetReadOnly( utils, 'anyBy', require( './../any-by' ) );\n\n/**\n* @name anyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/any-by-right}\n*/\nsetReadOnly( utils, 'anyByRight', require( './../any-by-right' ) );\n\n/**\n* @name append\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/append}\n*/\nsetReadOnly( utils, 'append', require( './../append' ) );\n\n/**\n* @name argumentFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/argument-function}\n*/\nsetReadOnly( utils, 'argumentFunction', require( './../argument-function' ) );\n\n/**\n* @name async\n* @memberof utils\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/utils/async}\n*/\nsetReadOnly( utils, 'async', require( './../async' ) );\n\n/**\n* @name bifurcate\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate}\n*/\nsetReadOnly( utils, 'bifurcate', require( './../bifurcate' ) );\n\n/**\n* @name bifurcateBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-by}\n*/\nsetReadOnly( utils, 'bifurcateBy', require( './../bifurcate-by' ) );\n\n/**\n* @name bifurcateIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-in}\n*/\nsetReadOnly( utils, 'bifurcateIn', require( './../bifurcate-in' ) );\n\n/**\n* @name bifurcateOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/bifurcate-own}\n*/\nsetReadOnly( utils, 'bifurcateOwn', require( './../bifurcate-own' ) );\n\n/**\n* @name capitalizeKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/capitalize-keys}\n*/\nsetReadOnly( utils, 'capitalizeKeys', require( './../capitalize-keys' ) );\n\n/**\n* @name CircularBuffer\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/circular-buffer}\n*/\nsetReadOnly( utils, 'CircularBuffer', require( './../circular-buffer' ) );\n\n/**\n* @name commonKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/common-keys}\n*/\nsetReadOnly( utils, 'commonKeys', require( './../common-keys' ) );\n\n/**\n* @name commonKeysIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/common-keys-in}\n*/\nsetReadOnly( utils, 'commonKeysIn', require( './../common-keys-in' ) );\n\n/**\n* @name CompactAdjacencyMatrix\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/compact-adjacency-matrix}\n*/\nsetReadOnly( utils, 'CompactAdjacencyMatrix', require( './../compact-adjacency-matrix' ) );\n\n/**\n* @name compose\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/compose}\n*/\nsetReadOnly( utils, 'compose', require( './../compose' ) );\n\n/**\n* @name constantFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/constant-function}\n*/\nsetReadOnly( utils, 'constantFunction', require( './../constant-function' ) );\n\n/**\n* @name constructorName\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/constructor-name}\n*/\nsetReadOnly( utils, 'constructorName', require( './../constructor-name' ) );\n\n/**\n* @name convertPath\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/convert-path}\n*/\nsetReadOnly( utils, 'convertPath', require( './../convert-path' ) );\n\n/**\n* @name copy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/copy}\n*/\nsetReadOnly( utils, 'copy', require( './../copy' ) );\n\n/**\n* @name countBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/count-by}\n*/\nsetReadOnly( utils, 'countBy', require( './../count-by' ) );\n\n/**\n* @name curry\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/curry}\n*/\nsetReadOnly( utils, 'curry', require( './../curry' ) );\n\n/**\n* @name curryRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/curry-right}\n*/\nsetReadOnly( utils, 'curryRight', require( './../curry-right' ) );\n\n/**\n* @name decorateAfter\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/decorate-after}\n*/\nsetReadOnly( utils, 'decorateAfter', require( './../decorate-after' ) );\n\n/**\n* @name deepGet\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-get}\n*/\nsetReadOnly( utils, 'deepGet', require( './../deep-get' ) );\n\n/**\n* @name deepPluck\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-pluck}\n*/\nsetReadOnly( utils, 'deepPluck', require( './../deep-pluck' ) );\n\n/**\n* @name deepSet\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/deep-set}\n*/\nsetReadOnly( utils, 'deepSet', require( './../deep-set' ) );\n\n/**\n* @name setConfigurableReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-only-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableReadOnlyAccessor', require( './../define-configurable-read-only-accessor' ) );\n\n/**\n* @name setConfigurableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-only-property}\n*/\nsetReadOnly( utils, 'setConfigurableReadOnly', require( './../define-configurable-read-only-property' ) );\n\n/**\n* @name setConfigurableReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-read-write-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableReadWriteAccessor', require( './../define-configurable-read-write-accessor' ) );\n\n/**\n* @name setConfigurableWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-configurable-write-only-accessor}\n*/\nsetReadOnly( utils, 'setConfigurableWriteOnlyAccessor', require( './../define-configurable-write-only-accessor' ) );\n\n/**\n* @name setMemoizedConfigurableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-configurable-read-only-property}\n*/\nsetReadOnly( utils, 'setMemoizedConfigurableReadOnly', require( './../define-memoized-configurable-read-only-property' ) );\n\n/**\n* @name defineMemoizedProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-property}\n*/\nsetReadOnly( utils, 'defineMemoizedProperty', require( './../define-memoized-property' ) );\n\n/**\n* @name setMemoizedReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-memoized-read-only-property}\n*/\nsetReadOnly( utils, 'setMemoizedReadOnly', require( './../define-memoized-read-only-property' ) );\n\n/**\n* @name setNonEnumerableProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-property}\n*/\nsetReadOnly( utils, 'setNonEnumerableProperty', require( './../define-nonenumerable-property' ) );\n\n/**\n* @name setNonEnumerableReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-only-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadOnlyAccessor', require( './../define-nonenumerable-read-only-accessor' ) );\n\n/**\n* @name setNonEnumerableReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-only-property}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadOnly', require( './../define-nonenumerable-read-only-property' ) );\n\n/**\n* @name setNonEnumerableReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-read-write-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableReadWriteAccessor', require( './../define-nonenumerable-read-write-accessor' ) );\n\n/**\n* @name setNonEnumerableWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-nonenumerable-write-only-accessor}\n*/\nsetReadOnly( utils, 'setNonEnumerableWriteOnlyAccessor', require( './../define-nonenumerable-write-only-accessor' ) );\n\n/**\n* @name defineProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-properties}\n*/\nsetReadOnly( utils, 'defineProperties', require( './../define-properties' ) );\n\n/**\n* @name defineProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-property}\n*/\nsetReadOnly( utils, 'defineProperty', require( './../define-property' ) );\n\n/**\n* @name setReadOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-only-accessor}\n*/\nsetReadOnly( utils, 'setReadOnlyAccessor', require( './../define-read-only-accessor' ) );\n\n/**\n* @name setReadOnly\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-only-property}\n*/\nsetReadOnly( utils, 'setReadOnly', require( './../define-read-only-property' ) );\n\n/**\n* @name setReadWriteAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-read-write-accessor}\n*/\nsetReadOnly( utils, 'setReadWriteAccessor', require( './../define-read-write-accessor' ) );\n\n/**\n* @name setWriteOnlyAccessor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/define-write-only-accessor}\n*/\nsetReadOnly( utils, 'setWriteOnlyAccessor', require( './../define-write-only-accessor' ) );\n\n/**\n* @name dirname\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/dirname}\n*/\nsetReadOnly( utils, 'dirname', require( './../dirname' ) );\n\n/**\n* @name doUntil\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until}\n*/\nsetReadOnly( utils, 'doUntil', require( './../do-until' ) );\n\n/**\n* @name doUntilEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until-each}\n*/\nsetReadOnly( utils, 'doUntilEach', require( './../do-until-each' ) );\n\n/**\n* @name doUntilEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-until-each-right}\n*/\nsetReadOnly( utils, 'doUntilEachRight', require( './../do-until-each-right' ) );\n\n/**\n* @name doWhile\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while}\n*/\nsetReadOnly( utils, 'doWhile', require( './../do-while' ) );\n\n/**\n* @name doWhileEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while-each}\n*/\nsetReadOnly( utils, 'doWhileEach', require( './../do-while-each' ) );\n\n/**\n* @name doWhileEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/do-while-each-right}\n*/\nsetReadOnly( utils, 'doWhileEachRight', require( './../do-while-each-right' ) );\n\n/**\n* @name DoublyLinkedList\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/doubly-linked-list}\n*/\nsetReadOnly( utils, 'DoublyLinkedList', require( './../doubly-linked-list' ) );\n\n/**\n* @name dsv\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/dsv}\n*/\nsetReadOnly( utils, 'dsv', require( './../dsv' ) );\n\n/**\n* @name objectEntries\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/entries}\n*/\nsetReadOnly( utils, 'objectEntries', require( './../entries' ) );\n\n/**\n* @name objectEntriesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/entries-in}\n*/\nsetReadOnly( utils, 'objectEntriesIn', require( './../entries-in' ) );\n\n/**\n* @name enumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-properties}\n*/\nsetReadOnly( utils, 'enumerableProperties', require( './../enumerable-properties' ) );\n\n/**\n* @name enumerablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-properties-in}\n*/\nsetReadOnly( utils, 'enumerablePropertiesIn', require( './../enumerable-properties-in' ) );\n\n/**\n* @name enumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-property-symbols}\n*/\nsetReadOnly( utils, 'enumerablePropertySymbols', require( './../enumerable-property-symbols' ) );\n\n/**\n* @name enumerablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/enumerable-property-symbols-in}\n*/\nsetReadOnly( utils, 'enumerablePropertySymbolsIn', require( './../enumerable-property-symbols-in' ) );\n\n/**\n* @name rescape\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/escape-regexp-string}\n*/\nsetReadOnly( utils, 'rescape', require( './../escape-regexp-string' ) );\n\n/**\n* @name evil\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/eval}\n*/\nsetReadOnly( utils, 'evil', require( './../eval' ) );\n\n/**\n* @name every\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every}\n*/\nsetReadOnly( utils, 'every', require( './../every' ) );\n\n/**\n* @name everyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every-by}\n*/\nsetReadOnly( utils, 'everyBy', require( './../every-by' ) );\n\n/**\n* @name everyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/every-by-right}\n*/\nsetReadOnly( utils, 'everyByRight', require( './../every-by-right' ) );\n\n/**\n* @name extname\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/extname}\n*/\nsetReadOnly( utils, 'extname', require( './../extname' ) );\n\n/**\n* @name FIFO\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/fifo}\n*/\nsetReadOnly( utils, 'FIFO', require( './../fifo' ) );\n\n/**\n* @name filterArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/filter-arguments}\n*/\nsetReadOnly( utils, 'filterArguments', require( './../filter-arguments' ) );\n\n/**\n* @name find\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/find}\n*/\nsetReadOnly( utils, 'find', require( './../find' ) );\n\n/**\n* @name flattenArray\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/flatten-array}\n*/\nsetReadOnly( utils, 'flattenArray', require( './../flatten-array' ) );\n\n/**\n* @name flattenObject\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/flatten-object}\n*/\nsetReadOnly( utils, 'flattenObject', require( './../flatten-object' ) );\n\n/**\n* @name forEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-each}\n*/\nsetReadOnly( utils, 'forEach', require( './../for-each' ) );\n\n/**\n* @name forEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-each-right}\n*/\nsetReadOnly( utils, 'forEachRight', require( './../for-each-right' ) );\n\n/**\n* @name forIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-in}\n*/\nsetReadOnly( utils, 'forIn', require( './../for-in' ) );\n\n/**\n* @name forOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/for-own}\n*/\nsetReadOnly( utils, 'forOwn', require( './../for-own' ) );\n\n/**\n* @name objectFromEntries\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/from-entries}\n*/\nsetReadOnly( utils, 'objectFromEntries', require( './../from-entries' ) );\n\n/**\n* @name functionName\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/function-name}\n*/\nsetReadOnly( utils, 'functionName', require( './../function-name' ) );\n\n/**\n* @name functionSequence\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/function-sequence}\n*/\nsetReadOnly( utils, 'functionSequence', require( './../function-sequence' ) );\n\n/**\n* @name getPrototypeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/get-prototype-of}\n*/\nsetReadOnly( utils, 'getPrototypeOf', require( './../get-prototype-of' ) );\n\n/**\n* @name getGlobal\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/global}\n*/\nsetReadOnly( utils, 'getGlobal', require( './../global' ) );\n\n/**\n* @name group\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group}\n*/\nsetReadOnly( utils, 'group', require( './../group' ) );\n\n/**\n* @name groupBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-by}\n*/\nsetReadOnly( utils, 'groupBy', require( './../group-by' ) );\n\n/**\n* @name groupIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-in}\n*/\nsetReadOnly( utils, 'groupIn', require( './../group-in' ) );\n\n/**\n* @name groupOwn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/group-own}\n*/\nsetReadOnly( utils, 'groupOwn', require( './../group-own' ) );\n\n/**\n* @name identity\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/identity-function}\n*/\nsetReadOnly( utils, 'identity', require( './../identity-function' ) );\n\n/**\n* @name ifelse\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/if-else}\n*/\nsetReadOnly( utils, 'ifelse', require( './../if-else' ) );\n\n/**\n* @name ifthen\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/if-then}\n*/\nsetReadOnly( utils, 'ifthen', require( './../if-then' ) );\n\n/**\n* @name indexOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/index-of}\n*/\nsetReadOnly( utils, 'indexOf', require( './../index-of' ) );\n\n/**\n* @name inherit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherit}\n*/\nsetReadOnly( utils, 'inherit', require( './../inherit' ) );\n\n/**\n* @name inheritedEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-enumerable-properties}\n*/\nsetReadOnly( utils, 'inheritedEnumerableProperties', require( './../inherited-enumerable-properties' ) );\n\n/**\n* @name inheritedEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-enumerable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedEnumerablePropertySymbols', require( './../inherited-enumerable-property-symbols' ) );\n\n/**\n* @name inheritedKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-keys}\n*/\nsetReadOnly( utils, 'inheritedKeys', require( './../inherited-keys' ) );\n\n/**\n* @name inheritedNonEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-properties}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerableProperties', require( './../inherited-nonenumerable-properties' ) );\n\n/**\n* @name inheritedNonEnumerablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-property-names}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerablePropertyNames', require( './../inherited-nonenumerable-property-names' ) );\n\n/**\n* @name inheritedNonEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-nonenumerable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedNonEnumerablePropertySymbols', require( './../inherited-nonenumerable-property-symbols' ) );\n\n/**\n* @name inheritedProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-properties}\n*/\nsetReadOnly( utils, 'inheritedProperties', require( './../inherited-properties' ) );\n\n/**\n* @name inheritedPropertyDescriptor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-descriptor}\n*/\nsetReadOnly( utils, 'inheritedPropertyDescriptor', require( './../inherited-property-descriptor' ) );\n\n/**\n* @name inheritedPropertyDescriptors\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-descriptors}\n*/\nsetReadOnly( utils, 'inheritedPropertyDescriptors', require( './../inherited-property-descriptors' ) );\n\n/**\n* @name inheritedPropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-names}\n*/\nsetReadOnly( utils, 'inheritedPropertyNames', require( './../inherited-property-names' ) );\n\n/**\n* @name inheritedPropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedPropertySymbols', require( './../inherited-property-symbols' ) );\n\n/**\n* @name inheritedWritableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-properties}\n*/\nsetReadOnly( utils, 'inheritedWritableProperties', require( './../inherited-writable-properties' ) );\n\n/**\n* @name inheritedWritablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-property-names}\n*/\nsetReadOnly( utils, 'inheritedWritablePropertyNames', require( './../inherited-writable-property-names' ) );\n\n/**\n* @name inheritedWritablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inherited-writable-property-symbols}\n*/\nsetReadOnly( utils, 'inheritedWritablePropertySymbols', require( './../inherited-writable-property-symbols' ) );\n\n/**\n* @name inmap\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inmap}\n*/\nsetReadOnly( utils, 'inmap', require( './../inmap' ) );\n\n/**\n* @name inmapRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/inmap-right}\n*/\nsetReadOnly( utils, 'inmapRight', require( './../inmap-right' ) );\n\n/**\n* @name keyBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/key-by}\n*/\nsetReadOnly( utils, 'keyBy', require( './../key-by' ) );\n\n/**\n* @name keyByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/key-by-right}\n*/\nsetReadOnly( utils, 'keyByRight', require( './../key-by-right' ) );\n\n/**\n* @name objectKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/keys}\n*/\nsetReadOnly( utils, 'objectKeys', require( './../keys' ) );\n\n/**\n* @name keysIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/keys-in}\n*/\nsetReadOnly( utils, 'keysIn', require( './../keys-in' ) );\n\n/**\n* @name LinkedList\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/linked-list}\n*/\nsetReadOnly( utils, 'LinkedList', require( './../linked-list' ) );\n\n/**\n* @name lowercaseKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/lowercase-keys}\n*/\nsetReadOnly( utils, 'lowercaseKeys', require( './../lowercase-keys' ) );\n\n/**\n* @name map\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map}\n*/\nsetReadOnly( utils, 'map', require( './../map' ) );\n\n/**\n* @name mapArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-arguments}\n*/\nsetReadOnly( utils, 'mapArguments', require( './../map-arguments' ) );\n\n/**\n* @name mapFun\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-function}\n*/\nsetReadOnly( utils, 'mapFun', require( './../map-function' ) );\n\n/**\n* @name mapKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-keys}\n*/\nsetReadOnly( utils, 'mapKeys', require( './../map-keys' ) );\n\n/**\n* @name mapReduce\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-reduce}\n*/\nsetReadOnly( utils, 'mapReduce', require( './../map-reduce' ) );\n\n/**\n* @name mapReduceRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-reduce-right}\n*/\nsetReadOnly( utils, 'mapReduceRight', require( './../map-reduce-right' ) );\n\n/**\n* @name mapRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-right}\n*/\nsetReadOnly( utils, 'mapRight', require( './../map-right' ) );\n\n/**\n* @name mapValues\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map-values}\n*/\nsetReadOnly( utils, 'mapValues', require( './../map-values' ) );\n\n/**\n* @name map2\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2}\n*/\nsetReadOnly( utils, 'map2', require( './../map2' ) );\n\n/**\n* @name map2Right\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2-right}\n*/\nsetReadOnly( utils, 'map2Right', require( './../map2-right' ) );\n\n/**\n* @name map2d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map2d}\n*/\nsetReadOnly( utils, 'map2d', require( './../map2d' ) );\n\n/**\n* @name map3d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map3d}\n*/\nsetReadOnly( utils, 'map3d', require( './../map3d' ) );\n\n/**\n* @name map4d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map4d}\n*/\nsetReadOnly( utils, 'map4d', require( './../map4d' ) );\n\n/**\n* @name map5d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/map5d}\n*/\nsetReadOnly( utils, 'map5d', require( './../map5d' ) );\n\n/**\n* @name maskArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/mask-arguments}\n*/\nsetReadOnly( utils, 'maskArguments', require( './../mask-arguments' ) );\n\n/**\n* @name memoize\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/memoize}\n*/\nsetReadOnly( utils, 'memoize', require( './../memoize' ) );\n\n/**\n* @name merge\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/merge}\n*/\nsetReadOnly( utils, 'merge', require( './../merge' ) );\n\n/**\n* @name moveProperty\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/move-property}\n*/\nsetReadOnly( utils, 'moveProperty', require( './../move-property' ) );\n\n/**\n* @name namedtypedtuple\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/named-typed-tuple}\n*/\nsetReadOnly( utils, 'namedtypedtuple', require( './../named-typed-tuple' ) );\n\n/**\n* @name naryFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nary-function}\n*/\nsetReadOnly( utils, 'naryFunction', require( './../nary-function' ) );\n\n/**\n* @name nativeClass\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/native-class}\n*/\nsetReadOnly( utils, 'nativeClass', require( './../native-class' ) );\n\n/**\n* @name nextTick\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/next-tick}\n*/\nsetReadOnly( utils, 'nextTick', require( './../next-tick' ) );\n\n/**\n* @name none\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none}\n*/\nsetReadOnly( utils, 'none', require( './../none' ) );\n\n/**\n* @name noneBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none-by}\n*/\nsetReadOnly( utils, 'noneBy', require( './../none-by' ) );\n\n/**\n* @name noneByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/none-by-right}\n*/\nsetReadOnly( utils, 'noneByRight', require( './../none-by-right' ) );\n\n/**\n* @name nonEnumerableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-properties}\n*/\nsetReadOnly( utils, 'nonEnumerableProperties', require( './../nonenumerable-properties' ) );\n\n/**\n* @name nonEnumerablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-properties-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertiesIn', require( './../nonenumerable-properties-in' ) );\n\n/**\n* @name nonEnumerablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-names}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertyNames', require( './../nonenumerable-property-names' ) );\n\n/**\n* @name nonEnumerablePropertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-names-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertyNamesIn', require( './../nonenumerable-property-names-in' ) );\n\n/**\n* @name nonEnumerablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-symbols}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertySymbols', require( './../nonenumerable-property-symbols' ) );\n\n/**\n* @name nonEnumerablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonenumerable-property-symbols-in}\n*/\nsetReadOnly( utils, 'nonEnumerablePropertySymbolsIn', require( './../nonenumerable-property-symbols-in' ) );\n\n/**\n* @name nonIndexKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/nonindex-keys}\n*/\nsetReadOnly( utils, 'nonIndexKeys', require( './../nonindex-keys' ) );\n\n/**\n* @name noop\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/noop}\n*/\nsetReadOnly( utils, 'noop', require( './../noop' ) );\n\n/**\n* @name objectInverse\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/object-inverse}\n*/\nsetReadOnly( utils, 'objectInverse', require( './../object-inverse' ) );\n\n/**\n* @name objectInverseBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/object-inverse-by}\n*/\nsetReadOnly( utils, 'objectInverseBy', require( './../object-inverse-by' ) );\n\n/**\n* @name omit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/omit}\n*/\nsetReadOnly( utils, 'omit', require( './../omit' ) );\n\n/**\n* @name omitBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/omit-by}\n*/\nsetReadOnly( utils, 'omitBy', require( './../omit-by' ) );\n\n/**\n* @name openURL\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/open-url}\n*/\nsetReadOnly( utils, 'openURL', require( './../open-url' ) );\n\n/**\n* @name papply\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/papply}\n*/\nsetReadOnly( utils, 'papply', require( './../papply' ) );\n\n/**\n* @name papplyRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/papply-right}\n*/\nsetReadOnly( utils, 'papplyRight', require( './../papply-right' ) );\n\n/**\n* @name parallel\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/parallel}\n*/\nsetReadOnly( utils, 'parallel', require( './../parallel' ) );\n\n/**\n* @name parseJSON\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/parse-json}\n*/\nsetReadOnly( utils, 'parseJSON', require( './../parse-json' ) );\n\n/**\n* @name pick\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick}\n*/\nsetReadOnly( utils, 'pick', require( './../pick' ) );\n\n/**\n* @name pickArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick-arguments}\n*/\nsetReadOnly( utils, 'pickArguments', require( './../pick-arguments' ) );\n\n/**\n* @name pickBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pick-by}\n*/\nsetReadOnly( utils, 'pickBy', require( './../pick-by' ) );\n\n/**\n* @name pluck\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pluck}\n*/\nsetReadOnly( utils, 'pluck', require( './../pluck' ) );\n\n/**\n* @name pop\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/pop}\n*/\nsetReadOnly( utils, 'pop', require( './../pop' ) );\n\n/**\n* @name prepend\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/prepend}\n*/\nsetReadOnly( utils, 'prepend', require( './../prepend' ) );\n\n/**\n* @name properties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/properties}\n*/\nsetReadOnly( utils, 'properties', require( './../properties' ) );\n\n/**\n* @name propertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/properties-in}\n*/\nsetReadOnly( utils, 'propertiesIn', require( './../properties-in' ) );\n\n/**\n* @name propertyDescriptor\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptor}\n*/\nsetReadOnly( utils, 'propertyDescriptor', require( './../property-descriptor' ) );\n\n/**\n* @name propertyDescriptorIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptor-in}\n*/\nsetReadOnly( utils, 'propertyDescriptorIn', require( './../property-descriptor-in' ) );\n\n/**\n* @name propertyDescriptors\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptors}\n*/\nsetReadOnly( utils, 'propertyDescriptors', require( './../property-descriptors' ) );\n\n/**\n* @name propertyDescriptorsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-descriptors-in}\n*/\nsetReadOnly( utils, 'propertyDescriptorsIn', require( './../property-descriptors-in' ) );\n\n/**\n* @name propertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-names}\n*/\nsetReadOnly( utils, 'propertyNames', require( './../property-names' ) );\n\n/**\n* @name propertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-names-in}\n*/\nsetReadOnly( utils, 'propertyNamesIn', require( './../property-names-in' ) );\n\n/**\n* @name propertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-symbols}\n*/\nsetReadOnly( utils, 'propertySymbols', require( './../property-symbols' ) );\n\n/**\n* @name propertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/property-symbols-in}\n*/\nsetReadOnly( utils, 'propertySymbolsIn', require( './../property-symbols-in' ) );\n\n/**\n* @name push\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/push}\n*/\nsetReadOnly( utils, 'push', require( './../push' ) );\n\n/**\n* @name realmax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/real-max}\n*/\nsetReadOnly( utils, 'realmax', require( './../real-max' ) );\n\n/**\n* @name realmin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/real-min}\n*/\nsetReadOnly( utils, 'realmin', require( './../real-min' ) );\n\n/**\n* @name reduce\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce}\n*/\nsetReadOnly( utils, 'reduce', require( './../reduce' ) );\n\n/**\n* @name reduceRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce-right}\n*/\nsetReadOnly( utils, 'reduceRight', require( './../reduce-right' ) );\n\n/**\n* @name reduce2d\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reduce2d}\n*/\nsetReadOnly( utils, 'reduce2d', require( './../reduce2d' ) );\n\n/**\n* @name reFromString\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/regexp-from-string}\n*/\nsetReadOnly( utils, 'reFromString', require( './../regexp-from-string' ) );\n\n/**\n* @name rejectArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reject-arguments}\n*/\nsetReadOnly( utils, 'rejectArguments', require( './../reject-arguments' ) );\n\n/**\n* @name reorderArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reorder-arguments}\n*/\nsetReadOnly( utils, 'reorderArguments', require( './../reorder-arguments' ) );\n\n/**\n* @name reverseArguments\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/reverse-arguments}\n*/\nsetReadOnly( utils, 'reverseArguments', require( './../reverse-arguments' ) );\n\n/**\n* @name safeintmax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/safe-int-max}\n*/\nsetReadOnly( utils, 'safeintmax', require( './../safe-int-max' ) );\n\n/**\n* @name safeintmin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/safe-int-min}\n*/\nsetReadOnly( utils, 'safeintmin', require( './../safe-int-min' ) );\n\n/**\n* @name shift\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/shift}\n*/\nsetReadOnly( utils, 'shift', require( './../shift' ) );\n\n/**\n* @name sizeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/size-of}\n*/\nsetReadOnly( utils, 'sizeOf', require( './../size-of' ) );\n\n/**\n* @name some\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some}\n*/\nsetReadOnly( utils, 'some', require( './../some' ) );\n\n/**\n* @name someBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some-by}\n*/\nsetReadOnly( utils, 'someBy', require( './../some-by' ) );\n\n/**\n* @name someByRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/some-by-right}\n*/\nsetReadOnly( utils, 'someByRight', require( './../some-by-right' ) );\n\n/**\n* @name Stack\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/stack}\n*/\nsetReadOnly( utils, 'Stack', require( './../stack' ) );\n\n/**\n* @name tabulate\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/tabulate}\n*/\nsetReadOnly( utils, 'tabulate', require( './../tabulate' ) );\n\n/**\n* @name tabulateBy\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/tabulate-by}\n*/\nsetReadOnly( utils, 'tabulateBy', require( './../tabulate-by' ) );\n\n/**\n* @name thunk\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/thunk}\n*/\nsetReadOnly( utils, 'thunk', require( './../thunk' ) );\n\n/**\n* @name timeit\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/timeit}\n*/\nsetReadOnly( utils, 'timeit', require( './../timeit' ) );\n\n/**\n* @name trycatch\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-catch}\n*/\nsetReadOnly( utils, 'trycatch', require( './../try-catch' ) );\n\n/**\n* @name tryFunction\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-function}\n*/\nsetReadOnly( utils, 'tryFunction', require( './../try-function' ) );\n\n/**\n* @name tryRequire\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-require}\n*/\nsetReadOnly( utils, 'tryRequire', require( './../try-require' ) );\n\n/**\n* @name trythen\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/try-then}\n*/\nsetReadOnly( utils, 'trythen', require( './../try-then' ) );\n\n/**\n* @name typemax\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-max}\n*/\nsetReadOnly( utils, 'typemax', require( './../type-max' ) );\n\n/**\n* @name typemin\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-min}\n*/\nsetReadOnly( utils, 'typemin', require( './../type-min' ) );\n\n/**\n* @name typeOf\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/type-of}\n*/\nsetReadOnly( utils, 'typeOf', require( './../type-of' ) );\n\n/**\n* @name uncapitalizeKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncapitalize-keys}\n*/\nsetReadOnly( utils, 'uncapitalizeKeys', require( './../uncapitalize-keys' ) );\n\n/**\n* @name uncurry\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncurry}\n*/\nsetReadOnly( utils, 'uncurry', require( './../uncurry' ) );\n\n/**\n* @name uncurryRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uncurry-right}\n*/\nsetReadOnly( utils, 'uncurryRight', require( './../uncurry-right' ) );\n\n/**\n* @name unshift\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/unshift}\n*/\nsetReadOnly( utils, 'unshift', require( './../unshift' ) );\n\n/**\n* @name until\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until}\n*/\nsetReadOnly( utils, 'until', require( './../until' ) );\n\n/**\n* @name untilEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until-each}\n*/\nsetReadOnly( utils, 'untilEach', require( './../until-each' ) );\n\n/**\n* @name untilEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/until-each-right}\n*/\nsetReadOnly( utils, 'untilEachRight', require( './../until-each-right' ) );\n\n/**\n* @name unzip\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/unzip}\n*/\nsetReadOnly( utils, 'unzip', require( './../unzip' ) );\n\n/**\n* @name uppercaseKeys\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/uppercase-keys}\n*/\nsetReadOnly( utils, 'uppercaseKeys', require( './../uppercase-keys' ) );\n\n/**\n* @name objectValues\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/values}\n*/\nsetReadOnly( utils, 'objectValues', require( './../values' ) );\n\n/**\n* @name objectValuesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/values-in}\n*/\nsetReadOnly( utils, 'objectValuesIn', require( './../values-in' ) );\n\n/**\n* @name whilst\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while}\n*/\nsetReadOnly( utils, 'whilst', require( './../while' ) );\n\n/**\n* @name whileEach\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while-each}\n*/\nsetReadOnly( utils, 'whileEach', require( './../while-each' ) );\n\n/**\n* @name whileEachRight\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/while-each-right}\n*/\nsetReadOnly( utils, 'whileEachRight', require( './../while-each-right' ) );\n\n/**\n* @name writableProperties\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-properties}\n*/\nsetReadOnly( utils, 'writableProperties', require( './../writable-properties' ) );\n\n/**\n* @name writablePropertiesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-properties-in}\n*/\nsetReadOnly( utils, 'writablePropertiesIn', require( './../writable-properties-in' ) );\n\n/**\n* @name writablePropertyNames\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-names}\n*/\nsetReadOnly( utils, 'writablePropertyNames', require( './../writable-property-names' ) );\n\n/**\n* @name writablePropertyNamesIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-names-in}\n*/\nsetReadOnly( utils, 'writablePropertyNamesIn', require( './../writable-property-names-in' ) );\n\n/**\n* @name writablePropertySymbols\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-symbols}\n*/\nsetReadOnly( utils, 'writablePropertySymbols', require( './../writable-property-symbols' ) );\n\n/**\n* @name writablePropertySymbolsIn\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/writable-property-symbols-in}\n*/\nsetReadOnly( utils, 'writablePropertySymbolsIn', require( './../writable-property-symbols-in' ) );\n\n/**\n* @name zip\n* @memberof utils\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/zip}\n*/\nsetReadOnly( utils, 'zip', require( './../zip' ) );\n\n\n// EXPORTS //\n\nmodule.exports = utils;\n"], + "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAS,OAAO,OAAO,gBAAmB,WAAe,OAAO,eAAiB,KAKrFD,GAAO,QAAUC,KC3BjB,IAAAC,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAiB,KAerB,SAASC,IAA2B,CAEnC,GAAI,CACH,OAAAD,GAAgB,CAAC,EAAG,IAAK,CAAC,CAAE,EACrB,EACR,OAAUE,EAAM,CACf,MAAO,EACR,CACD,CAKAH,GAAO,QAAUE,KClDjB,IAAAE,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAuDA,IAAIC,GAAiB,OAAO,eAK5BD,GAAO,QAAUC,KC5DjB,IAAAC,GAAAC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,EAAO,iBAAkB,IAAmC,EASzED,EAAaC,EAAO,qBAAsB,IAAsC,EAShFD,EAAaC,EAAO,uBAAwB,IAAyC,EASrFD,EAAaC,EAAO,wBAAyB,IAA0C,EASvFD,EAAaC,EAAO,0BAA2B,IAA6C,EAS5FD,EAAaC,EAAO,0BAA2B,IAA4C,EAS3FD,EAAaC,EAAO,4BAA6B,IAA+C,EAShGD,EAAaC,EAAO,MAAO,IAAsB,EAKjD,OAAO,QAAUA", + "names": ["require_define_property", "__commonJSMin", "exports", "module", "main", "require_has_define_property_support", "__commonJSMin", "exports", "module", "defineProperty", "hasDefinePropertySupport", "err", "require_builtin", "__commonJSMin", "exports", "module", "defineProperty", "require_polyfill", "__commonJSMin", "exports", "module", "format", "objectProtoype", "toStr", "defineGetter", "defineSetter", "lookupGetter", "lookupSetter", "defineProperty", "obj", "prop", "descriptor", "prototype", "hasValue", "hasGet", "hasSet", "require_lib", "__commonJSMin", "exports", "module", "hasDefinePropertySupport", "builtin", "polyfill", "defineProperty", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "format", "any", "collection", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "anyBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "anyByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_append_array", "__commonJSMin", "exports", "module", "append", "arr", "items", "i", "require_append_object", "__commonJSMin", "exports", "module", "append", "obj", "items", "len", "require_append_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "append", "arr", "items", "nbytes", "ibytes", "total", "len", "buf", "n", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isCollection", "isTypedArrayLike", "isInteger", "format", "appendArray", "appendObject", "appendTypedArray", "append", "collection1", "collection2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "wrap", "idx", "argn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "anyByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "anyByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "anyByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "anyByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isnan", "isCollection", "isString", "isInteger", "format", "indexOf", "arr", "searchElement", "fromIndex", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "indexOf", "format", "returns", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "bool", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "bifurcateByAsync", "collection", "done", "clbk", "error", "results", "require_main", "__commonJSMin", "exports", "module", "factory", "bifurcateByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "composeAsync", "nFuncs", "f", "i", "composite", "done", "args", "next", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "hasOwnProp", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "countByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "countByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doUntilAsync", "fcn", "predicate", "done", "thisArg", "args", "idx", "next", "error", "i", "onPredicate", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doWhileAsync", "fcn", "predicate", "done", "thisArg", "args", "idx", "next", "error", "i", "onPredicate", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "PINF", "format", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "everyByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "everyByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "PINF", "format", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "everyByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "everyByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "forEachAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "forEachAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "forEachRightAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "forEachRightAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "funseqAsync", "nFuncs", "f", "i", "pipeline", "done", "args", "next", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "indexOf", "format", "returns", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "hasOwnProp", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "groupByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "groupByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifelseAsync", "predicate", "x", "y", "done", "clbk", "error", "bool", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifthenAsync", "predicate", "x", "y", "done", "clbk1", "error", "bool", "clbk2", "nargs", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "inmapAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "inmapAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "inmapRightAsync", "collection", "done", "clbk", "error", "require_main", "__commonJSMin", "exports", "module", "factory", "inmapRightAsync", "collection", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "n", "opts", "fcn", "done", "count", "flg", "out", "lim", "idx", "m", "i", "next", "j", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "mapFunAsync", "n", "done", "clbk", "error", "results", "require_main", "__commonJSMin", "exports", "module", "factory", "mapFunAsync", "fcn", "n", "options", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_builtin", "__commonJSMin", "exports", "module", "keys", "value", "require_has_arguments_bug", "__commonJSMin", "exports", "module", "keys", "test", "check", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin_wrapper", "__commonJSMin", "exports", "module", "isArguments", "builtin", "slice", "keys", "value", "require_main", "__commonJSMin", "exports", "module", "noop", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_enumerable_prototype_bug", "__commonJSMin", "exports", "module", "isEnumerableProperty", "noop", "bool", "require_has_non_enumerable_properties_bug", "__commonJSMin", "exports", "module", "isEnumerableProperty", "obj", "bool", "require_re", "__commonJSMin", "exports", "module", "RE", "require_codegen", "__commonJSMin", "exports", "module", "getGlobal", "require_self", "__commonJSMin", "exports", "module", "obj", "require_window", "__commonJSMin", "exports", "module", "obj", "require_global", "__commonJSMin", "exports", "module", "obj", "require_global_this", "__commonJSMin", "exports", "module", "obj", "require_main", "__commonJSMin", "exports", "module", "isBoolean", "format", "getThis", "Self", "Win", "Global", "GlobalThis", "getGlobal", "codegen", "require_lib", "__commonJSMin", "exports", "module", "main", "require_nodelist", "__commonJSMin", "exports", "module", "getGlobal", "root", "nodeList", "require_typedarray", "__commonJSMin", "exports", "module", "typedarray", "require_check", "__commonJSMin", "exports", "module", "RE", "nodeList", "typedarray", "check", "require_tostring", "__commonJSMin", "exports", "module", "toStr", "require_main", "__commonJSMin", "exports", "module", "toStr", "nativeClass", "v", "require_tostringtag", "__commonJSMin", "exports", "module", "Symbol", "toStrTag", "require_polyfill", "__commonJSMin", "exports", "module", "hasOwnProp", "toStringTag", "toStr", "nativeClass", "v", "isOwn", "tag", "out", "err", "require_lib", "__commonJSMin", "exports", "module", "hasToStringTag", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "nativeClass", "RE", "isBuffer", "constructorName", "v", "match", "name", "ctor", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "ctorName", "typeOf", "v", "type", "require_polyfill", "__commonJSMin", "exports", "module", "ctorName", "typeOf", "v", "require_lib", "__commonJSMin", "exports", "module", "usePolyfill", "builtin", "polyfill", "main", "require_is_constructor_prototype", "__commonJSMin", "exports", "module", "isConstructorPrototype", "value", "require_excluded_keys", "__commonJSMin", "exports", "module", "require_window", "__commonJSMin", "exports", "module", "w", "require_has_automation_equality_bug", "__commonJSMin", "exports", "module", "hasOwnProp", "indexOf", "typeOf", "isConstructorPrototype", "EXCLUDED_KEYS", "win", "bool", "check", "k", "err", "require_has_window", "__commonJSMin", "exports", "module", "bool", "require_is_constructor_prototype_wrapper", "__commonJSMin", "exports", "module", "hasAutomationEqualityBug", "isConstructorPrototype", "HAS_WINDOW", "wrapper", "value", "error", "require_non_enumerable", "__commonJSMin", "exports", "module", "require_polyfill", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "isArguments", "HAS_ENUM_PROTO_BUG", "HAS_NON_ENUM_PROPS_BUG", "isConstructorPrototype", "NON_ENUMERABLE", "keys", "value", "skipConstructor", "skipPrototype", "isFcn", "out", "k", "p", "i", "require_main", "__commonJSMin", "exports", "module", "hasArgumentsBug", "HAS_BUILTIN", "builtin", "wrapper", "polyfill", "keys", "require_lib", "__commonJSMin", "exports", "module", "main", "require_limit", "__commonJSMin", "exports", "module", "logger", "objectKeys", "debug", "limit", "obj", "opts", "fcn", "done", "maxIndex", "count", "keys", "flg", "lim", "len", "idx", "out", "i", "next", "value", "key", "cb", "error", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "format", "PINF", "validate", "limit", "factory", "options", "transform", "opts", "err", "f", "mapKeysAsync", "obj", "done", "clbk", "error", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "mapKeysAsync", "obj", "options", "transform", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "objectKeys", "debug", "limit", "obj", "opts", "fcn", "done", "maxIndex", "count", "keys", "flg", "lim", "len", "idx", "out", "i", "next", "key", "cb", "error", "value", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "format", "PINF", "validate", "limit", "factory", "options", "transform", "opts", "err", "f", "mapValuesAsync", "obj", "done", "clbk", "error", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "mapValuesAsync", "obj", "options", "transform", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "noneByAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "noneByAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "noneByRightAsync", "collection", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "noneByRightAsync", "collection", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "acc", "opts", "fcn", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "i", "next", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "reduceAsync", "collection", "initial", "done", "clbk", "error", "acc", "require_main", "__commonJSMin", "exports", "module", "factory", "reduceAsync", "collection", "initial", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "acc", "opts", "fcn", "done", "count", "flg", "lim", "len", "idx", "i", "next", "cb", "error", "result", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "fcn", "opts", "err", "f", "reduceRightAsync", "collection", "initial", "done", "clbk", "error", "acc", "require_main", "__commonJSMin", "exports", "module", "factory", "reduceRightAsync", "collection", "initial", "options", "fcn", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "isFunctionArray", "isFunction", "format", "factory", "fcns", "clbk", "thisArg", "waterfall", "idx", "next", "args", "len", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "waterfall", "fcns", "clbk", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "n", "opts", "predicate", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "cnt", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "isPositiveInteger", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "someByAsync", "collection", "n", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "someByAsync", "collection", "n", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "debug", "limit", "collection", "n", "opts", "predicate", "done", "count", "flg", "lim", "len", "idx", "cnt", "i", "next", "clbk", "error", "result", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "predicate", "opts", "err", "f", "someByRightAsync", "collection", "n", "done", "clbk", "error", "bool", "require_main", "__commonJSMin", "exports", "module", "factory", "someByRightAsync", "collection", "n", "options", "predicate", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "format", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "indexOf", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "tmp", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "f", "tabulateByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "tabulateByAsync", "collection", "options", "indicator", "done", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trycatchAsync", "x", "y", "done", "clbk", "error", "result", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trythenAsync", "x", "y", "done", "clbk1", "error", "nargs", "args", "i", "clbk2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "untilAsync", "predicate", "fcn", "done", "thisArg", "args", "idx", "onPredicate", "error", "result", "next", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "whileAsync", "predicate", "fcn", "done", "thisArg", "args", "idx", "onPredicate", "error", "result", "next", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "returnValues", "returnIndices", "returnPairs", "format", "validate", "bifurcate", "collection", "options", "filter", "opts", "err", "f", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "v", "i", "require_return_indices", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "i", "require_return_pairs", "__commonJSMin", "exports", "module", "bifurcateBy", "collection", "opts", "predicate", "thisArg", "bool", "out", "len", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "validate", "returnValues", "returnIndices", "returnPairs", "bifurcateBy", "collection", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_return_keys", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "require_return_pairs", "__commonJSMin", "exports", "module", "bifurcateIn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "bifurcateIn", "obj", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "bifurcateOwn", "obj", "opts", "predicate", "thisArg", "bool", "out", "key", "flg", "v", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "bifurcateOwn", "obj", "options", "predicate", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "capitalizeKeys", "obj", "out", "key", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "MAX_ITERATIONS", "arraylike2object", "format", "CircularBuffer", "buffer", "buf", "i", "niters", "iter", "self", "FLG", "N", "n", "next", "end", "factory", "value", "set", "get", "v", "out", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "hasOwnProp", "commonKeys", "nargs", "keys", "arg", "ptr", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "keysIn", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "keysIn", "hasProp", "commonKeysIn", "nargs", "keys", "arg", "ptr", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_from_adjacency_list_iterator", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIterator", "it", "out", "v", "z", "require_from_adjacency_list_iterator_map", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_from_edges_iterator", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIterator", "it", "out", "v", "z", "require_from_edges_iterator_map", "__commonJSMin", "exports", "module", "isCollection", "format", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "z", "i", "require_set_bit", "__commonJSMin", "exports", "module", "setBit", "value", "i", "require_clear_bit", "__commonJSMin", "exports", "module", "clearBit", "value", "i", "require_is_set", "__commonJSMin", "exports", "module", "Boolean", "isSet", "value", "i", "require_bit_value", "__commonJSMin", "exports", "module", "bitValue", "value", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isArrayLikeObject", "isCollection", "isFunction", "isObject", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "Int32Array", "Int8Array", "format", "ceil", "floor", "grev", "fromIteratorAdjList", "fromIteratorAdjListMap", "fromIteratorEdges", "fromIteratorEdgesMap", "setBit", "clearBit", "isSet", "bitValue", "HAS_ITERATOR_SYMBOL", "NBITS", "CompactAdjacencyMatrix", "N", "list", "thisArg", "nargs", "edges", "clbk", "adj", "tmp", "len", "i", "j", "edge", "out", "bucket", "bit", "idx", "deg", "marks", "self", "err", "visit", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "compose", "nFuncs", "f", "i", "composite", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "wrap", "value", "constantFunction", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "reExtendedLengthPath", "lowercase", "replace", "format", "RE_WIN_DEVICE_ROOT", "RE_POSIX_DEVICE_ROOT", "convertPath", "from", "to", "device", "parts", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "reRegExp", "format", "reFromString", "str", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertyNames", "getOwnPropertyNames", "value", "require_polyfill", "__commonJSMin", "exports", "module", "Object", "keys", "getOwnPropertyNames", "value", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "propertyDescriptor", "getOwnPropertyDescriptor", "value", "property", "desc", "require_polyfill", "__commonJSMin", "exports", "module", "hasOwnProp", "getOwnPropertyDescriptor", "value", "property", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_native", "__commonJSMin", "exports", "module", "getProto", "require_proto", "__commonJSMin", "exports", "module", "getProto", "obj", "require_polyfill", "__commonJSMin", "exports", "module", "nativeClass", "getProto", "getPrototypeOf", "obj", "proto", "require_detect", "__commonJSMin", "exports", "module", "isFunction", "builtin", "polyfill", "getProto", "require_main", "__commonJSMin", "exports", "module", "Object", "getProto", "getPrototypeOf", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_typed_arrays", "__commonJSMin", "exports", "module", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "hash", "int8array", "arr", "uint8array", "uint8clampedarray", "int16array", "uint16array", "int32array", "uint32array", "float32array", "float64array", "typedarrays", "out", "require_deep_copy", "__commonJSMin", "exports", "module", "hasOwnProp", "isArray", "isBuffer", "isError", "typeOf", "regexp", "indexOf", "objectKeys", "propertyNames", "propertyDescriptor", "getPrototypeOf", "defineProperty", "copyBuffer", "typedArrays", "cloneInstance", "val", "cache", "names", "name", "refs", "desc", "tmp", "ref", "i", "deepCopy", "copyError", "error", "keys", "key", "err", "copy", "level", "parent", "ctor", "x", "j", "require_main", "__commonJSMin", "exports", "module", "isArray", "isNonNegativeInteger", "format", "PINF", "deepCopy", "copy", "value", "level", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "hasOwnProp", "format", "validate", "countBy", "collection", "options", "indicator", "thisArg", "opts", "err", "out", "len", "cb", "g", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "curry", "fcn", "arity", "thisArg", "context", "len", "createCurried", "args", "curried", "v", "cargs", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "curryRight", "fcn", "arity", "thisArg", "context", "len", "createCurried", "args", "curried", "v", "cargs", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "apply", "fcn", "args", "after", "thisArg", "r1", "r2", "decorateAfter", "arity", "fcns", "f", "fN", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "i", "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "reNativeFunction", "function2string", "Fcn", "format", "RE_PARAMETERS", "decorateAfter", "fcn", "arity", "after", "thisArg", "params", "str", "len", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_dget", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "deepGet", "obj", "props", "len", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isString", "isArray", "format", "validate", "defaults", "dget", "deepGet", "obj", "path", "options", "isStr", "props", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isString", "isArray", "isObjectLike", "format", "validate", "defaults", "dget", "factory", "path", "options", "isStr", "props", "opts", "err", "deepGet", "obj", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isBoolean", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "deepGet", "isArray", "format", "defaults", "validate", "deepPluck", "arr", "path", "options", "dget", "opts", "out", "err", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isBoolean", "isString", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_dset", "__commonJSMin", "exports", "module", "isObjectLike", "hasOwnProp", "isFunction", "deepSet", "obj", "props", "create", "val", "bool", "len", "v", "p", "i", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isString", "isArray", "format", "validate", "defaults", "dset", "deepSet", "obj", "path", "value", "options", "isStr", "props", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isString", "isArray", "isObjectLike", "format", "validate", "defaults", "dset", "factory", "path", "options", "isStr", "props", "opts", "err", "deepSet", "obj", "value", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadOnly", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setConfigurableWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineProperty", "format", "defineMemoizedProperty", "obj", "prop", "desc", "getter", "memoize", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineMemoizedProperty", "format", "setMemoizedConfigurableReadOnly", "obj", "prop", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObject", "isFunction", "defineMemoizedProperty", "format", "setMemoizedReadOnly", "obj", "prop", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableProperty", "obj", "prop", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setNonEnumerableWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_builtin", "__commonJSMin", "exports", "module", "defineProperties", "require_polyfill", "__commonJSMin", "exports", "module", "isObject", "objectKeys", "defineProperty", "format", "defineProperties", "obj", "props", "keys", "name", "i", "require_lib", "__commonJSMin", "exports", "module", "hasDefinePropertiesSupport", "builtin", "polyfill", "defineProperties", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadOnlyAccessor", "obj", "prop", "getter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setReadWriteAccessor", "obj", "prop", "getter", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "setWriteOnlyAccessor", "obj", "prop", "setter", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "format", "RE_DIRNAME", "dirname", "path", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doUntil", "fcn", "predicate", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doUntilEach", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doUntilEachRight", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "doWhile", "fcn", "predicate", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doWhileEach", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "doWhileEachRight", "collection", "fcn", "predicate", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "defineProperty", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "format", "Node", "DoublyLinkedList", "node", "value", "location", "loc", "n", "direction", "values", "iter", "self", "FLG", "dir", "inc", "i", "next", "end", "factory", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "format", "RE_CHARS", "rescape", "str", "len", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "noop", "throwError", "err", "defaults", "require_enum2state", "__commonJSMin", "exports", "module", "require_state2enum", "__commonJSMin", "exports", "module", "enum2state", "table", "out", "i", "state2enum", "require_closed", "__commonJSMin", "exports", "module", "state2enum", "CLOSED", "processor", "parser", "next", "require_comment", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "processor", "parser", "newlineLastIndex", "newline", "next", "ch", "require_error", "__commonJSMin", "exports", "module", "state2enum", "ERROR", "processor", "parser", "next", "require_max", "__commonJSMin", "exports", "module", "max", "x", "y", "require_escape", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "ERROR", "FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "skipLastIndex", "escapeLength", "delimiter", "newline", "comment", "escape", "strict", "skip", "max", "next", "ch", "cursor", "idx", "d", "require_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ESCAPE", "FIELD", "INIT", "QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "escapeLastIndex", "quoteLastIndex", "delimiter", "newline", "quoting", "escape", "strict", "quote", "next", "ch", "idx", "require_init", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "COMMENT", "FIELD", "ESCAPE", "INIT", "QUOTED_FIELD", "SKIP", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "quoteLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "quoting", "escape", "strict", "quote", "skip", "next", "ch", "idx", "require_invalid_quote_end", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ERROR", "FIELD", "INIT", "removeWhitespace", "parser", "state", "processor", "delimiterLastIndex", "newlineLastIndex", "delimiter", "newline", "next", "ch", "require_quote_end", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "ERROR", "FIELD", "INIT", "INVALID_QUOTE_END", "QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "quoteLastIndex", "doublequote", "delimiter", "newline", "strict", "quote", "max", "next", "ch", "require_quoted_escape", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "ERROR", "QUOTED_FIELD", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "escapeLength", "strict", "quote", "next", "ch", "cursor", "idx", "d", "require_quoted_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "QUOTE_END", "QUOTED_ESCAPE", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "doublequote", "escape", "quote", "next", "ch", "require_skip", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "SKIP", "SKIPPED_COMMENT", "SKIPPED_FIELD", "SKIPPED_ESCAPE", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "quoteLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "quoting", "escape", "strict", "quote", "skip", "next", "ch", "idx", "require_skipped_comment", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "processor", "parser", "newlineLastIndex", "newline", "next", "ch", "require_skipped_escape", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "SKIPPED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "commentLastIndex", "escapeLastIndex", "skipLastIndex", "delimiter", "newline", "comment", "escape", "skip", "max", "next", "ch", "cursor", "idx", "d", "require_skipped_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "INIT", "SKIPPED_ESCAPE", "SKIPPED_FIELD", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "escapeLastIndex", "quoteLastIndex", "delimiter", "newline", "quoting", "escape", "strict", "quote", "next", "ch", "idx", "require_skipped_invalid_quote_end", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_FIELD", "INIT", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "delimiter", "newline", "next", "ch", "require_skipped_quote_end", "__commonJSMin", "exports", "module", "logger", "maximum", "state2enum", "debug", "INIT", "SKIPPED_FIELD", "SKIPPED_INVALID_QUOTE_END", "SKIPPED_QUOTED_FIELD", "processor", "parser", "delimiterLastIndex", "newlineLastIndex", "quoteLastIndex", "doublequote", "delimiter", "newline", "quote", "max", "next", "ch", "require_skipped_quoted_escape", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_QUOTED_FIELD", "processor", "parser", "quoteLastIndex", "quote", "next", "ch", "cursor", "idx", "d", "require_skipped_quoted_field", "__commonJSMin", "exports", "module", "logger", "state2enum", "debug", "SKIPPED_QUOTE_END", "SKIPPED_QUOTED_ESCAPE", "processor", "parser", "escapeLastIndex", "quoteLastIndex", "doublequote", "escape", "quote", "next", "ch", "require_states", "__commonJSMin", "exports", "module", "enum2state", "closed", "comment", "error", "escape", "field", "init", "invalidQuoteEnd", "quoteEnd", "quotedEscape", "quotedField", "skip", "skippedComment", "skippedEscape", "skippedField", "skippedInvalidQuoteEnd", "skippedQuoteEnd", "skippedQuotedEscape", "skippedQuotedField", "table", "states", "parser", "out", "i", "require_main", "__commonJSMin", "exports", "module", "logger", "setReadOnly", "setReadOnlyAccessor", "Boolean", "format", "rescape", "replace", "defaults", "state2enum", "enum2state", "states", "debug", "CLOSED", "COMMENT", "ERROR", "ESCAPE", "FIELD", "INIT", "INVALID_QUOTE_END", "QUOTE_END", "QUOTED_ESCAPE", "QUOTED_FIELD", "SKIP", "SKIPPED_COMMENT", "SKIPPED_ESCAPE", "SKIPPED_FIELD", "SKIPPED_INVALID_QUOTE_END", "SKIPPED_QUOTE_END", "SKIPPED_QUOTED_ESCAPE", "SKIPPED_QUOTED_FIELD", "array2pattern", "list", "pattern", "i", "Parser", "options", "opts", "ch", "buf", "N", "target", "start", "end", "value", "idx", "v", "search", "name", "err", "state", "chunk", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isObjectLike", "format", "objectEntries", "obj", "keys", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "objectEntriesIn", "obj", "key", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertySymbols", "getOwnPropertySymbols", "value", "require_polyfill", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "keys", "propertySymbols", "isEnumerable", "enumerableProperties", "value", "out", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isEnumerable", "Object", "enumerablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isEnumerableProperty", "Object", "enumerablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isEnumerableProperty", "hasOwnProp", "Object", "enumerablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "evil", "require_main", "__commonJSMin", "exports", "module", "isCollection", "base", "format", "every", "collection", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "everyBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "everyByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "RE_EXTNAME", "format", "extname", "filename", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Node", "FIFO", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "value", "node", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "filterArguments", "fcn", "predicate", "thisArg", "wrap", "args", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_find", "__commonJSMin", "exports", "module", "isFunction", "isInteger", "isObject", "isString", "isCollection", "hasOwnProp", "indexOf", "format", "RETURNS", "find", "arr", "options", "clbk", "count", "mode", "opts", "len", "out", "ret", "cb", "i", "k", "v", "require_lib", "__commonJSMin", "exports", "module", "find", "require_defaults", "__commonJSMin", "exports", "module", "FLOAT64_MAX", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_recurse", "__commonJSMin", "exports", "module", "isArrayLikeObject", "recurse", "out", "arr", "depth", "v", "i", "require_main", "__commonJSMin", "exports", "module", "copy", "isArrayLikeObject", "format", "defaults", "validate", "recurse", "flattenArray", "arr", "options", "opts", "err", "out", "require_gen_fcn", "__commonJSMin", "exports", "module", "Fcn", "genFcn", "dims", "len", "n", "f", "i", "require_wrap_flatten", "__commonJSMin", "exports", "module", "isArrayLikeObject", "format", "wrap", "flatten", "flattenArray", "arr", "require_wrap_flatten_copy", "__commonJSMin", "exports", "module", "isArrayLikeObject", "format", "copy", "wrap", "flatten", "flattenArray", "arr", "require_factory", "__commonJSMin", "exports", "module", "isPositiveIntegerArray", "isObject", "hasOwnProp", "isBoolean", "format", "defaults", "genFcn", "wrapFlatten", "wrapFlattenCopy", "factory", "dims", "options", "copyFLG", "flatten", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "FLOAT64_MAX", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isString", "isBoolean", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_recurse", "__commonJSMin", "exports", "module", "objectKeys", "isPlainObject", "isArray", "recurse", "out", "obj", "prefix", "depth", "opts", "keys", "val", "key", "i", "require_flatten", "__commonJSMin", "exports", "module", "copy", "recurse", "flatten", "obj", "opts", "out", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "defaults", "validate", "flatten", "flattenObject", "obj", "options", "opts", "err", "require_factory", "__commonJSMin", "exports", "module", "isObjectLike", "format", "defaults", "validate", "flatten", "factory", "options", "opts", "err", "flattenObject", "obj", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "forEach", "collection", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "forEachRight", "collection", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "forIn", "obj", "fcn", "thisArg", "bool", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "forOwn", "obj", "fcn", "thisArg", "keys", "bool", "len", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayArray", "format", "objectFromEntries", "entries", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasFunctionNameSupport", "format", "RE", "isFunctionNameSupported", "functionName", "fcn", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "funseq", "nFuncs", "f", "i", "pipeline", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "returnValues", "returnIndices", "returnPairs", "format", "validate", "group", "collection", "options", "groups", "opts", "err", "g", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "v", "i", "require_return_indices", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "i", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupBy", "collection", "opts", "indicator", "thisArg", "out", "len", "g", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "validate", "returnValues", "returnIndices", "returnPairs", "groupBy", "collection", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "g", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupIn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "groupIn", "obj", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "indexOf", "format", "returns", "validate", "opts", "options", "require_return_values", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_return_keys", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "g", "require_return_pairs", "__commonJSMin", "exports", "module", "hasOwnProp", "groupOwn", "obj", "opts", "indicator", "thisArg", "out", "key", "v", "g", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "isFunction", "format", "validate", "returnValues", "returnKeys", "returnPairs", "groupOwn", "obj", "options", "indicator", "opts", "err", "cb", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "identity", "x", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "ifelse", "bool", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "ifthen", "bool", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "format", "validate", "value", "type", "require_native", "__commonJSMin", "exports", "module", "require_polyfill", "__commonJSMin", "exports", "module", "Ctor", "createObject", "proto", "require_detect", "__commonJSMin", "exports", "module", "builtin", "polyfill", "createObject", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "format", "validate", "createObject", "inherit", "ctor", "superCtor", "err", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isEnumerableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedEnumerableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isEnumerableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedEnumerablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyNames", "getPrototypeOf", "isEnumerable", "hasOwnProp", "format", "inheritedKeys", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerablePropertyNames", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isNonEnumerableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedNonEnumerablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertySymbols", "propertyNames", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedProperties", "value", "level", "out", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyDescriptor", "getPrototypeOf", "format", "inheritedPropertyDescriptor", "value", "property", "level", "desc", "obj", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_has_builtin", "__commonJSMin", "exports", "module", "bool", "require_builtin", "__commonJSMin", "exports", "module", "Object", "propertyDescriptors", "getOwnPropertyDescriptors", "value", "require_polyfill", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "propertyDescriptor", "defineProperty", "getOwnPropertyDescriptors", "value", "symbols", "names", "desc", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "HAS_BUILTIN", "builtin", "polyfill", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "getOwnPropertyDescriptors", "getOwnPropertySymbols", "getPrototypeOf", "objectKeys", "defineProperty", "hasOwnProp", "format", "inheritedPropertyDescriptors", "value", "level", "desc", "keys", "obj", "tmp", "N", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertyNames", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedPropertyNames", "value", "level", "names", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "propertySymbols", "getPrototypeOf", "format", "contains", "arr", "v", "i", "inheritedPropertySymbols", "value", "level", "out", "obj", "tmp", "N", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritableProperties", "value", "level", "props", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritablePropertyNames", "value", "level", "names", "cache", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "isPositiveInteger", "isWritableProperty", "getOwnPropertySymbols", "getPrototypeOf", "hasOwnProp", "format", "inheritedWritablePropertySymbols", "value", "level", "cache", "out", "obj", "tmp", "N", "n", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "inmap", "collection", "fcn", "thisArg", "len", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "inmapRight", "collection", "fcn", "thisArg", "len", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "keyBy", "collection", "fcn", "thisArg", "out", "len", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "keyByRight", "collection", "fcn", "thisArg", "out", "len", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_node", "__commonJSMin", "exports", "module", "defineProperty", "Node", "value", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Node", "LinkedList", "node", "value", "n", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "lowercaseKeys", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "get", "set", "ref", "shx", "shy", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_array", "__commonJSMin", "exports", "module", "map", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "format", "ndarrayFcn", "arrayFcn", "map", "arr", "fcn", "thisArg", "out", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map", "arr", "out", "fcn", "thisArg", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "mapArguments", "fcn", "clbk", "thisArg", "wrap", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "mapFun", "fcn", "n", "thisArg", "out", "i", "require_lib", "__commonJSMin", "exports", "module", "mapFun", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasOwnProp", "format", "mapKeys", "obj", "transform", "out", "key", "v", "require_lib", "__commonJSMin", "exports", "module", "mapKeys", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapReduce", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "mapReduce", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "mapReduce", "arr", "initial", "mapper", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapReduceRight", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "mapReduceRight", "x", "initial", "mapper", "reducer", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "mapReduceRight", "arr", "initial", "mapper", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "mapRight", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "ordx", "ordy", "len", "get", "set", "ref", "shx", "shy", "sx", "sy", "ox", "oy", "ix", "iy", "i", "require_array", "__commonJSMin", "exports", "module", "mapRight", "x", "y", "fcn", "thisArg", "xbuf", "ybuf", "get", "set", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "format", "ndarrayFcn", "arrayFcn", "mapRight", "arr", "fcn", "thisArg", "out", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "mapRight", "arr", "out", "fcn", "thisArg", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isFunction", "hasOwnProp", "format", "mapValues", "obj", "transform", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "mapValues", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map2", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "ordx", "ordy", "ordz", "xget", "yget", "zset", "xref", "yref", "shx", "shy", "shz", "len", "sx", "sy", "sz", "ox", "oy", "oz", "ix", "iy", "iz", "i", "require_array", "__commonJSMin", "exports", "module", "map2", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "xget", "yget", "zset", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "broadcastShapes", "broadcast", "format", "ndarrayFcn", "arrayFcn", "map2", "x", "y", "fcn", "thisArg", "isxnd", "isynd", "out", "tmp", "sh", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map2", "x", "y", "out", "fcn", "thisArg", "isxnd", "isynd", "isznd", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "map2Right", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "ordx", "ordy", "ordz", "xget", "yget", "zset", "xref", "yref", "shx", "shy", "shz", "len", "sx", "sy", "sz", "ox", "oy", "oz", "ix", "iy", "iz", "i", "require_array", "__commonJSMin", "exports", "module", "map2Right", "x", "y", "z", "fcn", "thisArg", "xbuf", "ybuf", "zbuf", "xget", "yget", "zset", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "zeros", "ndarraylike2object", "arraylike2object", "ndzeros", "broadcastShapes", "broadcast", "format", "ndarrayFcn", "arrayFcn", "map2Right", "x", "y", "fcn", "thisArg", "isxnd", "isynd", "out", "tmp", "sh", "require_assign", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "broadcast", "isReadOnly", "format", "ndarrayFcn", "arrayFcn", "map2Right", "x", "y", "out", "fcn", "thisArg", "isxnd", "isynd", "isznd", "tmp", "sh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map2d", "arr", "fcn", "thisArg", "out", "tmp", "M", "N", "a", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map3d", "arr", "fcn", "thisArg", "out", "t1", "t2", "a1", "a2", "S0", "S1", "S2", "i0", "i1", "i2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map4d", "arr", "fcn", "thisArg", "out", "t1", "t2", "t3", "a1", "a2", "a3", "S0", "S1", "S2", "S3", "i0", "i1", "i2", "i3", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isFunction", "format", "map5d", "arr", "fcn", "thisArg", "out", "t1", "t2", "t3", "t4", "a1", "a2", "a3", "a4", "S0", "S1", "S2", "S3", "S4", "i0", "i1", "i2", "i3", "i4", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "maskArguments", "fcn", "mask", "thisArg", "fcns", "idx", "i", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "setReadOnly", "identity", "hasOwnProp", "format", "memoize", "fcn", "hashFunction", "toKey", "cache", "memoized", "args", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "memoize", "require_defaults", "__commonJSMin", "exports", "module", "PINF", "defaults", "require_deepmerge", "__commonJSMin", "exports", "module", "objectKeys", "isObject", "hasOwnProp", "isBuffer", "isFunction", "typeOf", "deepCopy", "deepMerge", "target", "source", "level", "copy", "override", "extend", "hasProp", "isFunc", "name", "keys", "curr", "key", "val", "tmp", "i", "require_mergefcn", "__commonJSMin", "exports", "module", "isObject", "format", "deepMerge", "mergefcn", "opts", "merge", "target", "nargs", "arg", "src", "i", "require_main", "__commonJSMin", "exports", "module", "defaults", "mergefcn", "merge", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isFunction", "isPositiveInteger", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "validate", "defaults", "mergefcn", "factory", "options", "opts", "err", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "defineProperty", "format", "moveProperty", "source", "prop", "target", "desc", "require_lib", "__commonJSMin", "exports", "module", "moveProperty", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertiesIn", "value", "out", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_contains", "__commonJSMin", "exports", "module", "contains", "arr", "v", "i", "require_has_distinct_elements", "__commonJSMin", "exports", "module", "hasOwnProp", "hasDistinctElements", "arr", "obj", "i", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isString", "dtypes", "format", "contains", "DTYPES", "validate", "opts", "options", "require_ascending", "__commonJSMin", "exports", "module", "ascending", "a", "b", "require_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "fields", "it", "clbk", "thisArg", "out", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isStringArray", "isString", "isArrayBuffer", "isFunction", "isInteger", "isObject", "isCollection", "hasOwnProp", "hasIteratorSymbolSupport", "propertiesIn", "typedarray", "Int8Array", "getDtype", "defineProperty", "setNonEnumerableProperty", "setNonEnumerableReadOnlyAccessor", "setNonEnumerableReadWriteAccessor", "floor", "ITERATOR_SYMBOL", "format", "contains", "hasDistinctElements", "validate", "ascending", "fromIterator", "fromIteratorMap", "RESERVED_PROPS", "HAS_ITERATOR_SYMBOL", "factory", "names", "options", "nfields", "fields", "opts", "err", "i", "namedtypedtuple", "indices", "dtype", "nargs", "tuple", "getter", "setter", "getFields", "orderedFields", "entries", "every", "fieldOf", "filter", "find", "findIndex", "findField", "forEach", "ind2key", "key2ind", "keys", "lastFieldOf", "map", "reduce", "reduceRight", "reverse", "slice", "some", "sort", "subtuple", "toJSON", "toString", "get", "set", "v", "out", "self", "iter", "FLG", "next", "end", "value", "predicate", "thisArg", "bool", "searchElement", "tmp", "f", "fcn", "ind", "key", "acc", "j", "begin", "compareFunction", "clbk", "k", "wrapper", "ia", "ib", "a", "b", "src", "it", "obj", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "format", "naryFunction", "fcn", "arity", "thisArg", "fcns", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "x", "y", "z", "w", "v", "t", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "proc", "nextTick", "clbk", "args", "i", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "base", "format", "none", "collection", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "noneBy", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "noneByRight", "collection", "predicate", "thisArg", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "isNonEnumerable", "nonEnumerableProperties", "value", "out", "tmp", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isNonEnumerable", "nonEnumerablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "isNonEnumerableProperty", "nonEnumerablePropertyNames", "value", "names", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "isNonEnumerableProperty", "hasOwnProp", "Object", "nonEnumerablePropertyNamesIn", "value", "names", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isNonEnumerableProperty", "Object", "nonEnumerablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isNonEnumerableProperty", "hasOwnProp", "Object", "nonEnumerablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "RE_INTEGER_INDEX", "nonIndexKeys", "obj", "keys", "len", "N", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isArray", "isObject", "isObjectLike", "isBoolean", "hasOwnProp", "format", "invert", "obj", "opts", "allowDupes", "keys", "len", "key", "val", "out", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isArray", "isObject", "isObjectLike", "isBoolean", "isFunction", "hasOwnProp", "format", "invertBy", "obj", "opts", "transform", "allowDupes", "keys", "len", "key", "val", "out", "cb", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isString", "isStringArray", "indexOf", "format", "omit", "obj", "keys", "ownKeys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "omitBy", "obj", "predicate", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "spawn", "IS_WINDOWS", "IS_DARWIN", "format", "isURI", "ARGS", "CMD", "openURL", "url", "args", "proc", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "papply", "fcn", "pargs", "i", "papplied", "args", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "papplyRight", "fcn", "pargs", "len", "pappliedRight", "nargs", "args", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "numCPUs", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isPositiveInteger", "isNonNegativeInteger", "isBoolean", "isString", "format", "validate", "opts", "options", "require_env", "__commonJSMin", "exports", "module", "objectKeys", "ENV", "copy", "keys", "env", "out", "opts", "require_options", "__commonJSMin", "exports", "module", "cwd", "env", "getOpts", "options", "opts", "require_exec", "__commonJSMin", "exports", "module", "fork", "path", "logger", "objectKeys", "format", "getOpts", "debug", "WORKER_FILEPATH", "exec", "files", "opts", "clbk", "numClosed", "workers", "pending", "fopts", "args", "proc", "pids", "pid", "idx", "err", "i", "onError", "onClose", "onExit", "onDisconnect", "onMessage", "next", "child", "numPending", "close", "listener", "filepath", "code", "signal", "processExit", "childClosed", "done", "error", "require_node", "__commonJSMin", "exports", "module", "exec", "require_main", "__commonJSMin", "exports", "module", "path", "isStringArray", "isFunction", "format", "cwd", "defaults", "validate", "exec", "parallel", "options", "files", "opts", "clbk", "err", "dir", "i", "done", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "isFunction", "format", "parseJSON", "str", "reviver", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isString", "isStringArray", "hasOwnProp", "format", "pick", "obj", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeInteger", "isCollection", "format", "pickArguments", "fcn", "indices", "thisArg", "fcns", "idx", "v", "i", "nullary", "unary", "binary", "ternary", "quaternary", "quinary", "nary", "args", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isFunction", "format", "pickBy", "obj", "predicate", "keys", "out", "key", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isArray", "hasOwnProp", "format", "defaults", "validate", "pluck", "arr", "prop", "options", "opts", "out", "err", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_pop_object", "__commonJSMin", "exports", "module", "pop", "obj", "len", "v", "require_pop_typed_array", "__commonJSMin", "exports", "module", "pop", "arr", "view", "len", "v", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "popObject", "popTypedArray", "pop", "collection", "v", "require_lib", "__commonJSMin", "exports", "module", "main", "require_prepend_array", "__commonJSMin", "exports", "module", "prepend", "arr", "items", "i", "require_prepend_object", "__commonJSMin", "exports", "module", "prepend", "obj", "items", "len", "n", "i", "require_prepend_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "prepend", "arr", "items", "nbytes", "ibytes", "offset", "total", "len", "buf", "n", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isCollection", "isTypedArrayLike", "isInteger", "format", "prependArray", "prependObject", "prependTypedArray", "prepend", "collection1", "collection2", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "properties", "value", "out", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyDescriptor", "getPrototypeOf", "propertyDescriptorIn", "value", "property", "desc", "obj", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyDescriptors", "getOwnPropertySymbols", "getPrototypeOf", "objectKeys", "defineProperty", "hasOwnProp", "Object", "propertyDescriptorsIn", "value", "desc", "keys", "obj", "tmp", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertyNamesIn", "value", "names", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "Object", "contains", "arr", "v", "i", "propertySymbolsIn", "value", "symbols", "obj", "tmp", "require_lib", "__commonJSMin", "exports", "module", "main", "require_push_array", "__commonJSMin", "exports", "module", "push", "arr", "items", "i", "require_push_object", "__commonJSMin", "exports", "module", "push", "obj", "items", "len", "require_push_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "push", "arr", "items", "nbytes", "ibytes", "total", "len", "buf", "n", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "pushArray", "pushObject", "pushTypedArray", "push", "collection", "items", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "realmax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "realmin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "reduce", "x", "initial", "fcn", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "reduce", "x", "initial", "fcn", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "reduce", "arr", "initial", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_ndarray", "__commonJSMin", "exports", "module", "vind2bind", "MODE", "reduceRight", "x", "initial", "fcn", "thisArg", "xbuf", "ordx", "acc", "len", "get", "ref", "shx", "sx", "ox", "ix", "i", "require_array", "__commonJSMin", "exports", "module", "reduceRight", "x", "initial", "fcn", "thisArg", "xbuf", "get", "acc", "i", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isndarrayLike", "isFunction", "ndarraylike2object", "arraylike2object", "format", "ndarrayFcn", "arrayFcn", "reduceRight", "arr", "initial", "reducer", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isArrayLikeObject", "isCollection", "isFunction", "format", "reduce2d", "arr", "initial", "reducer", "thisArg", "out", "acc", "M", "N", "a", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "rejectArguments", "fcn", "predicate", "thisArg", "wrap", "args", "v", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isNonNegativeIntegerArray", "format", "reorderArguments", "fcn", "indices", "thisArg", "reordered", "args", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "reverseArguments", "fcn", "thisArg", "reversed", "args", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "safeintmax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "FLOAT16", "FLOAT32", "FLOAT64", "safeintmin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_shift_object", "__commonJSMin", "exports", "module", "shift", "obj", "len", "v", "require_shift_typed_array", "__commonJSMin", "exports", "module", "shift", "arr", "offset", "view", "v", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "shiftObject", "shiftTypedArray", "shift", "collection", "v", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "UINT8", "INT16", "UINT16", "INT32", "UINT32", "FLOAT16", "FLOAT32", "FLOAT64", "COMPLEX64", "COMPLEX128", "sizeOf", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "format", "some", "collection", "n", "count", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isFunction", "format", "someBy", "collection", "n", "predicate", "thisArg", "count", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isPositiveInteger", "isFunction", "format", "someByRight", "collection", "n", "predicate", "thisArg", "count", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "iteratorSymbol", "Stack", "values", "iter", "self", "FLG", "i", "next", "end", "factory", "value", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "indexOf", "format", "tabulate", "collection", "count", "tmp", "len", "out", "v", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "indexOf", "format", "validate", "tabulateBy", "collection", "options", "indicator", "thisArg", "count", "opts", "tmp", "len", "out", "err", "cb", "v", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "thunk", "fcn", "args", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isPositiveInteger", "isString", "isBoolean", "isNull", "format", "validate", "opts", "options", "require_context", "__commonJSMin", "exports", "module", "defineProperty", "tic", "toc", "context", "done", "ctx", "require_async", "__commonJSMin", "exports", "module", "noop", "body", "id", "code", "opts", "before", "after", "state", "main", "src", "cb1", "cb2", "cb3", "ctx", "t", "d", "i", "require_sync", "__commonJSMin", "exports", "module", "generate", "id", "code", "opts", "src", "ctx", "t", "d", "i", "require_wrap", "__commonJSMin", "exports", "module", "wrap", "src", "out", "require_vm_compile", "__commonJSMin", "exports", "module", "vm", "wrap", "compile", "filename", "code", "script", "opts", "require_vm_evaluate", "__commonJSMin", "exports", "module", "minstd", "createContext", "asyncSource", "syncSource", "compile", "evaluate", "src", "opts", "filename", "dirname", "clbk", "context", "tmp", "fcn", "err", "id", "done", "error", "results", "require_min_time", "__commonJSMin", "exports", "module", "min", "times", "out", "require_transform", "__commonJSMin", "exports", "module", "min", "transform", "raw", "iterations", "secs", "rate", "out", "m", "require_main", "__commonJSMin", "exports", "module", "isString", "isFunction", "isArray", "copy", "cwd", "format", "nextTick", "defaults", "validate", "evaluate", "transform", "FILENAME", "MIN_TIME", "ITERATIONS", "MAX_ITERATIONS", "timeit", "code", "options", "clbk", "results", "opts", "dir", "err", "idx", "cb", "onTest", "error", "done", "next", "onTick", "time", "onRun", "onFinish", "t", "out", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trycatch", "x", "y", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isError", "format", "wrap", "fcn", "thisArg", "ctx", "wrapped", "args", "len", "i", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isError", "tryRequire", "id", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "trythen", "x", "y", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "UINT8", "INT16", "UINT16", "INT32", "UINT32", "FLOAT16", "FLOAT32", "FLOAT64", "typemax", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "format", "INT8", "INT16", "INT32", "FLOAT16", "FLOAT32", "FLOAT64", "typemin", "dtype", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "uncapitalizeKeys", "obj", "out", "key", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "uncurry", "fcn", "arity", "thisArg", "context", "len", "uncurried", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "isPositiveInteger", "format", "uncurryRight", "fcn", "arity", "thisArg", "context", "len", "uncurried", "f", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_unshift_array", "__commonJSMin", "exports", "module", "unshift", "arr", "items", "i", "require_unshift_object", "__commonJSMin", "exports", "module", "unshift", "obj", "items", "len", "n", "i", "require_unshift_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "unshift", "arr", "items", "nbytes", "ibytes", "offset", "total", "len", "buf", "n", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isTypedArrayLike", "isInteger", "format", "unshiftArray", "unshiftObject", "unshiftTypedArray", "unshift", "collection", "items", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "until", "predicate", "fcn", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "untilEach", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "untilEachRight", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isInteger", "isArray", "unzip", "arr", "idx", "numVals", "len", "out", "tmp", "i", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "format", "uppercaseKeys", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isObjectLike", "format", "objectValues", "obj", "keys", "out", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isObjectLike", "format", "objectValuesIn", "obj", "out", "key", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFunction", "format", "whilst", "predicate", "fcn", "thisArg", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "whileEach", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "whileEachRight", "collection", "predicate", "fcn", "thisArg", "len", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "propertyNames", "propertySymbols", "isWritable", "writableProperties", "value", "out", "tmp", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getOwnPropertyNames", "getPrototypeOf", "hasOwnProp", "isWritable", "Object", "writablePropertiesIn", "value", "cache", "out", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "isWritableProperty", "Object", "writablePropertyNames", "value", "names", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertyNames", "getPrototypeOf", "isWritableProperty", "hasOwnProp", "writablePropertyNamesIn", "value", "names", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "isWritableProperty", "writablePropertySymbols", "value", "symbols", "i", "n", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "getOwnPropertySymbols", "getPrototypeOf", "isWritableProperty", "hasOwnProp", "writablePropertySymbolsIn", "value", "symbols", "cache", "obj", "tmp", "k", "i", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isBoolean", "isObject", "isArray", "hasOwnProp", "format", "zip", "nargs", "args", "fill", "opts", "arg", "flg", "len", "arr", "out", "val", "i", "j", "require_lib", "__commonJSMin", "exports", "module", "main", "setReadOnly", "utils"] } diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index e114662b..c0ed96e1 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -341,7 +341,7 @@ interface Namespace { * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -949,7 +949,7 @@ interface Namespace { * @returns decorator * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; @@ -965,7 +965,7 @@ interface Namespace { * // returns -5 * * @example - * var abs = require( `@stdlib/math/base/special/abs` ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * function negate( v ) { * return -v; @@ -1321,7 +1321,7 @@ interface Namespace { * @param value - value to set * * @example - * var objectKeys = require( `@stdlib/utils/keys` ); + * var objectKeys = require( './../../keys' ); * * var obj = {}; * @@ -2663,7 +2663,7 @@ interface Namespace { * @returns either `x` or `y` * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * var z = ns.ifelse( randu() > 0.5, 1.0, -1.0 ); * // returns @@ -2679,7 +2679,7 @@ interface Namespace { * @returns return value of either `x` or `y` * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function x() { * return randu() * 100.0; @@ -3252,8 +3252,8 @@ interface Namespace { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -3261,9 +3261,9 @@ interface Namespace { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -3277,8 +3277,8 @@ interface Namespace { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -3289,9 +3289,9 @@ interface Namespace { * // => [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -3502,8 +3502,8 @@ interface Namespace { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -3511,9 +3511,9 @@ interface Namespace { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -3527,8 +3527,8 @@ interface Namespace { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -3539,9 +3539,9 @@ interface Namespace { * // => [ 1, 2, 3, 4, 5, 6 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -3612,8 +3612,8 @@ interface Namespace { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -3622,9 +3622,9 @@ interface Namespace { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -3639,8 +3639,8 @@ interface Namespace { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -3652,9 +3652,9 @@ interface Namespace { * // => [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -3690,8 +3690,8 @@ interface Namespace { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -3700,9 +3700,9 @@ interface Namespace { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -3717,8 +3717,8 @@ interface Namespace { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -3730,9 +3730,9 @@ interface Namespace { * // => [ 2, 3, 4, 5, 6, 7 ] * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -3766,8 +3766,8 @@ interface Namespace { * @returns array of arrays * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ -1, -2, -3 ], @@ -3796,8 +3796,8 @@ interface Namespace { * @returns three-dimensional nested array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ -1, -2, -3 ] ], @@ -3826,8 +3826,8 @@ interface Namespace { * @returns four-dimensional nested array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ [ -1, -2, -3 ] ] ], @@ -3856,8 +3856,8 @@ interface Namespace { * @returns five-dimensional nested array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ [ [ -1, -2, -3 ] ] ] ], @@ -4195,7 +4195,7 @@ interface Namespace { * @returns a list of own non-enumerable property names and symbols * * @example - * var defineProperty = require( `@stdlib/utils/define-property` ); + * var defineProperty = require( './../../define-property' ); * * var obj = {}; * @@ -4240,7 +4240,7 @@ interface Namespace { * @returns a list of own non-enumerable property names * * @example - * var defineProperty = require( `@stdlib/utils/define-property` ); + * var defineProperty = require( './../../define-property' ); * * var obj = {}; * @@ -4268,7 +4268,7 @@ interface Namespace { * @returns a list of own and inherited non-enumerable property names * * @example - * var defineProperty = require( `@stdlib/utils/define-property` ); + * var defineProperty = require( './../../define-property' ); * * var obj = {}; * @@ -4701,7 +4701,7 @@ interface Namespace { * // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -4730,7 +4730,7 @@ interface Namespace { * // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -4961,7 +4961,7 @@ interface Namespace { * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -5113,8 +5113,8 @@ interface Namespace { * @returns accumulation results * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var arr = [ * [ 1, 2, 3 ], @@ -5294,7 +5294,7 @@ interface Namespace { * // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -5507,7 +5507,7 @@ interface Namespace { * @returns thunk * * @example - * var add = require( `@stdlib/math/base/ops/add` ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var f = ns.thunk( add, 2, 3 ); * // returns @@ -5575,7 +5575,7 @@ interface Namespace { * @returns either the return value of `x` or the provided argument `y` * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function x() { * if ( randu() < 0.5 ) { @@ -5649,7 +5649,7 @@ interface Namespace { * @returns the return value of either `x` or `y` * * @example - * var randu = require( `@stdlib/random/base/randu` ); + * var randu = require( '@stdlib/random/base/randu' ); * * function x() { * if ( randu() < 0.5 ) { @@ -5848,7 +5848,7 @@ interface Namespace { * // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] @@ -6183,7 +6183,7 @@ interface Namespace { * @returns a list of own writable property names * * @example - * var defineProperty = require( `@stdlib/utils/define-property` ); + * var defineProperty = require( './../../define-property' ); * * var obj = { 'a': 'b' }; * @@ -6211,7 +6211,7 @@ interface Namespace { * @returns a list of own and inherited writable property names * * @example - * var defineProperty = require( `@stdlib/utils/define-property` ); + * var defineProperty = require( './../../define-property' ); * * var obj = { 'a': 'b' }; * diff --git a/every/lib/main.js b/every/lib/main.js index 2761cdcd..6e0201f3 100644 --- a/every/lib/main.js +++ b/every/lib/main.js @@ -21,6 +21,7 @@ // MODULES // var isCollection = require( '@stdlib/assert/is-collection' ); +var base = require( '@stdlib/array/base/every' ); var format = require( '@stdlib/string/format' ); @@ -40,18 +41,10 @@ var format = require( '@stdlib/string/format' ); * // returns true */ function every( collection ) { - var len; - var i; if ( !isCollection( collection ) ) { throw new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) ); } - len = collection.length; - for ( i = 0; i < len; i++ ) { - if ( !collection[ i ] ) { - return false; - } - } - return true; + return base( collection ); } diff --git a/if-else/docs/types/index.d.ts b/if-else/docs/types/index.d.ts index ed3d7c47..1d599cd6 100644 --- a/if-else/docs/types/index.d.ts +++ b/if-else/docs/types/index.d.ts @@ -27,7 +27,7 @@ * @returns either `x` or `y` * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * var z = ifelse( randu() > 0.5, 1.0, -1.0 ); * // returns diff --git a/if-then/docs/types/index.d.ts b/if-then/docs/types/index.d.ts index 2c3ba4c9..d4d13bee 100644 --- a/if-then/docs/types/index.d.ts +++ b/if-then/docs/types/index.d.ts @@ -27,7 +27,7 @@ * @returns return value of either `x` or `y` * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function x() { * return randu() * 100.0; diff --git a/map-reduce-right/docs/types/index.d.ts b/map-reduce-right/docs/types/index.d.ts index 2d0e5dab..860f687f 100644 --- a/map-reduce-right/docs/types/index.d.ts +++ b/map-reduce-right/docs/types/index.d.ts @@ -193,10 +193,10 @@ type ArrayReducer = NullaryReducer | UnaryReducer | Bina * @returns accumulated result * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' diff --git a/map-reduce/docs/types/index.d.ts b/map-reduce/docs/types/index.d.ts index ef7c4301..446843ce 100644 --- a/map-reduce/docs/types/index.d.ts +++ b/map-reduce/docs/types/index.d.ts @@ -193,10 +193,10 @@ type ArrayReducer = NullaryReducer | UnaryReducer | Bina * @returns accumulated result * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' diff --git a/map-right/docs/types/index.d.ts b/map-right/docs/types/index.d.ts index 24f116ae..10691fca 100644 --- a/map-right/docs/types/index.d.ts +++ b/map-right/docs/types/index.d.ts @@ -110,9 +110,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -144,8 +144,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -172,9 +172,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -208,8 +208,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -239,8 +239,8 @@ interface Routine { * @returns output array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -248,9 +248,9 @@ interface Routine { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -264,8 +264,8 @@ interface Routine { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -276,9 +276,9 @@ interface Routine { * // => [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', diff --git a/map/docs/types/index.d.ts b/map/docs/types/index.d.ts index 9f9cf515..05a64eb1 100644 --- a/map/docs/types/index.d.ts +++ b/map/docs/types/index.d.ts @@ -110,9 +110,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -144,8 +144,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -172,9 +172,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -208,8 +208,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var abs = require( `@stdlib/math/base/special/abs` ); + * var naryFunction = require( './../../../nary-function' ); + * var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -239,8 +239,8 @@ interface Routine { * @returns output array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * @@ -248,9 +248,9 @@ interface Routine { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -264,8 +264,8 @@ interface Routine { * // returns [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ -1, -2, -3, -4, -5, -6 ]; * var out = [ 0, 0, 0, 0, 0, 0 ]; @@ -276,9 +276,9 @@ interface Routine { * // => [ 1, 2, 3, 4, 5, 6 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', diff --git a/map2-right/docs/types/index.d.ts b/map2-right/docs/types/index.d.ts index 956d3b9c..a7eff093 100644 --- a/map2-right/docs/types/index.d.ts +++ b/map2-right/docs/types/index.d.ts @@ -128,9 +128,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -165,8 +165,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -196,9 +196,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -235,8 +235,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -269,8 +269,8 @@ interface Routine { * @returns output array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -279,9 +279,9 @@ interface Routine { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -296,8 +296,8 @@ interface Routine { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -309,9 +309,9 @@ interface Routine { * // => [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', diff --git a/map2/docs/types/index.d.ts b/map2/docs/types/index.d.ts index 7513ca6f..1d47cb1f 100644 --- a/map2/docs/types/index.d.ts +++ b/map2/docs/types/index.d.ts @@ -128,9 +128,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -165,8 +165,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -196,9 +196,9 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); - * var array = require( `@stdlib/ndarray/array` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); + * var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', @@ -235,8 +235,8 @@ interface Routine { * @returns output array * * @example - * var naryFunction = require( `@stdlib/utils/nary-function` ); - * var add = require( `@stdlib/math/base/ops/add` ); + * var naryFunction = require( './../../../nary-function' ); + * var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -269,8 +269,8 @@ interface Routine { * @returns output array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -279,9 +279,9 @@ interface Routine { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' @@ -296,8 +296,8 @@ interface Routine { * // returns [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var x = [ 1, 2, 3, 4, 5, 6 ]; * var y = [ 1, 1, 1, 1, 1, 1 ]; @@ -309,9 +309,9 @@ interface Routine { * // => [ 2, 3, 4, 5, 6, 7 ] * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic', diff --git a/map2d/docs/types/index.d.ts b/map2d/docs/types/index.d.ts index e71c275e..e6082b95 100644 --- a/map2d/docs/types/index.d.ts +++ b/map2d/docs/types/index.d.ts @@ -88,8 +88,8 @@ type Callback = Nullary | Unary | Binary | Tern * @returns array of arrays * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ -1, -2, -3 ], diff --git a/map3d/docs/types/index.d.ts b/map3d/docs/types/index.d.ts index ba51ceec..e80208b6 100644 --- a/map3d/docs/types/index.d.ts +++ b/map3d/docs/types/index.d.ts @@ -88,8 +88,8 @@ type Callback = Nullary | Unary | Binary | Tern * @returns three-dimensional nested array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ -1, -2, -3 ] ], diff --git a/map4d/docs/types/index.d.ts b/map4d/docs/types/index.d.ts index 5e9a02b6..6242bf68 100644 --- a/map4d/docs/types/index.d.ts +++ b/map4d/docs/types/index.d.ts @@ -88,8 +88,8 @@ type Callback = Nullary | Unary | Binary | Tern * @returns four-dimensional nested array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ [ -1, -2, -3 ] ] ], diff --git a/map5d/docs/types/index.d.ts b/map5d/docs/types/index.d.ts index 18c7dc59..2b5b882f 100644 --- a/map5d/docs/types/index.d.ts +++ b/map5d/docs/types/index.d.ts @@ -88,8 +88,8 @@ type Callback = Nullary | Unary | Binary | Tern * @returns five-dimensional nested array * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var abs = require( `@stdlib/math/base/special/abs` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var abs = require( '@stdlib/math/base/special/abs' ); * * var arr = [ * [ [ [ [ -1, -2, -3 ] ] ] ], diff --git a/named-typed-tuple/docs/types/index.d.ts b/named-typed-tuple/docs/types/index.d.ts index f798852b..11ffd81a 100644 --- a/named-typed-tuple/docs/types/index.d.ts +++ b/named-typed-tuple/docs/types/index.d.ts @@ -361,7 +361,7 @@ interface Tuple { * Offset (in bytes) of a tuple from the start of its underlying `ArrayBuffer`. * * @example - * var ArrayBuffer = require( `@stdlib/array/buffer` ); + * var ArrayBuffer = require( '@stdlib/array/buffer' ); * * var factory = namedtypedtuple( [ 'x', 'y' ] ); * @@ -1376,7 +1376,7 @@ interface Factory { * // returns -1.0 * * @example - * var Float64Array = require( `@stdlib/array/float64` ); + * var Float64Array = require( '@stdlib/array/float64' ); * * var factory = namedtypedtuple( [ 'x', 'y' ] ); * diff --git a/none/lib/main.js b/none/lib/main.js index 94112909..d4b74984 100644 --- a/none/lib/main.js +++ b/none/lib/main.js @@ -21,6 +21,7 @@ // MODULES // var isCollection = require( '@stdlib/assert/is-collection' ); +var base = require( '@stdlib/array/base/none' ); var format = require( '@stdlib/string/format' ); @@ -40,18 +41,10 @@ var format = require( '@stdlib/string/format' ); * // returns true */ function none( collection ) { - var len; - var i; if ( !isCollection( collection ) ) { throw new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) ); } - len = collection.length; - for ( i = 0; i < len; i++ ) { - if ( collection[ i ] ) { - return false; - } - } - return true; + return base( collection ); } diff --git a/nonenumerable-properties/docs/types/index.d.ts b/nonenumerable-properties/docs/types/index.d.ts index 7a02075f..659b2970 100644 --- a/nonenumerable-properties/docs/types/index.d.ts +++ b/nonenumerable-properties/docs/types/index.d.ts @@ -30,7 +30,7 @@ * @returns a list of own non-enumerable property names and symbols * * @example -* var defineProperty = require( `@stdlib/utils/define-property` ); +* var defineProperty = require( '@stdlib/utils/define-property' ); * * var obj = {}; * diff --git a/nonenumerable-property-names-in/docs/types/index.d.ts b/nonenumerable-property-names-in/docs/types/index.d.ts index 7c1f865f..9b89dd5b 100644 --- a/nonenumerable-property-names-in/docs/types/index.d.ts +++ b/nonenumerable-property-names-in/docs/types/index.d.ts @@ -30,7 +30,7 @@ * @returns a list of own and inherited non-enumerable property names * * @example -* var defineProperty = require( `@stdlib/utils/define-property` ); +* var defineProperty = require( '@stdlib/utils/define-property' ); * * var obj = {}; * diff --git a/nonenumerable-property-names/docs/types/index.d.ts b/nonenumerable-property-names/docs/types/index.d.ts index 89c17883..8fb257b2 100644 --- a/nonenumerable-property-names/docs/types/index.d.ts +++ b/nonenumerable-property-names/docs/types/index.d.ts @@ -30,7 +30,7 @@ * @returns a list of own non-enumerable property names * * @example -* var defineProperty = require( `@stdlib/utils/define-property` ); +* var defineProperty = require( '@stdlib/utils/define-property' ); * * var obj = {}; * diff --git a/pop/docs/types/index.d.ts b/pop/docs/types/index.d.ts index cd4158df..d2858e7c 100644 --- a/pop/docs/types/index.d.ts +++ b/pop/docs/types/index.d.ts @@ -41,7 +41,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/prepend/docs/types/index.d.ts b/prepend/docs/types/index.d.ts index 14a51b8d..eab31e8e 100644 --- a/prepend/docs/types/index.d.ts +++ b/prepend/docs/types/index.d.ts @@ -41,7 +41,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/push/docs/types/index.d.ts b/push/docs/types/index.d.ts index 31709c49..99bf6022 100644 --- a/push/docs/types/index.d.ts +++ b/push/docs/types/index.d.ts @@ -41,7 +41,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/reduce-right/docs/types/index.d.ts b/reduce-right/docs/types/index.d.ts index 1d591924..e8e69a9f 100644 --- a/reduce-right/docs/types/index.d.ts +++ b/reduce-right/docs/types/index.d.ts @@ -122,9 +122,9 @@ type ArrayReducer = Nullary | Unary | Binary | Ter * @returns accumulated result * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' diff --git a/reduce/docs/types/index.d.ts b/reduce/docs/types/index.d.ts index 994bfde3..1fa4c94f 100644 --- a/reduce/docs/types/index.d.ts +++ b/reduce/docs/types/index.d.ts @@ -122,9 +122,9 @@ type ArrayReducer = Nullary | Unary | Binary | Ter * @returns accumulated result * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); -* var array = require( `@stdlib/ndarray/array` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); +* var array = require( '@stdlib/ndarray/array' ); * * var opts = { * 'dtype': 'generic' diff --git a/reduce2d/docs/types/index.d.ts b/reduce2d/docs/types/index.d.ts index fdb1a9ff..73920272 100644 --- a/reduce2d/docs/types/index.d.ts +++ b/reduce2d/docs/types/index.d.ts @@ -98,8 +98,8 @@ type Reducer = Nullary | Unary | Binary | Ternary< * @returns accumulation results * * @example -* var naryFunction = require( `@stdlib/utils/nary-function` ); -* var add = require( `@stdlib/math/base/ops/add` ); +* var naryFunction = require( '@stdlib/utils/nary-function' ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var arr = [ * [ 1, 2, 3 ], diff --git a/shift/docs/types/index.d.ts b/shift/docs/types/index.d.ts index 9b76edc1..3af85c9c 100644 --- a/shift/docs/types/index.d.ts +++ b/shift/docs/types/index.d.ts @@ -41,7 +41,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/thunk/docs/types/index.d.ts b/thunk/docs/types/index.d.ts index 02dd52de..8d7c8c1d 100644 --- a/thunk/docs/types/index.d.ts +++ b/thunk/docs/types/index.d.ts @@ -26,7 +26,7 @@ * @returns thunk * * @example -* var add = require( `@stdlib/math/base/ops/add` ); +* var add = require( '@stdlib/math/base/ops/add' ); * * var f = thunk( add, 2, 3 ); * // returns diff --git a/try-catch/docs/types/index.d.ts b/try-catch/docs/types/index.d.ts index 80c97bee..96db9e85 100644 --- a/try-catch/docs/types/index.d.ts +++ b/try-catch/docs/types/index.d.ts @@ -26,7 +26,7 @@ * @returns either the return value of `x` or the provided argument `y` * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function x() { * if ( randu() < 0.5 ) { diff --git a/try-then/docs/types/index.d.ts b/try-then/docs/types/index.d.ts index 70817869..5f397692 100644 --- a/try-then/docs/types/index.d.ts +++ b/try-then/docs/types/index.d.ts @@ -56,7 +56,7 @@ type ErrorHandler = Nullary | Unary; * @returns the return value of either `x` or `y` * * @example -* var randu = require( `@stdlib/random/base/randu` ); +* var randu = require( '@stdlib/random/base/randu' ); * * function x() { * if ( randu() < 0.5 ) { diff --git a/unshift/docs/types/index.d.ts b/unshift/docs/types/index.d.ts index 8be6e4e7..d94a4bf4 100644 --- a/unshift/docs/types/index.d.ts +++ b/unshift/docs/types/index.d.ts @@ -41,7 +41,7 @@ import { Collection } from '@stdlib/types/array'; * // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] * * @example -* var Float64Array = require( `@stdlib/array/float64` ); +* var Float64Array = require( '@stdlib/array/float64' ); * * var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ] diff --git a/writable-property-names-in/docs/types/index.d.ts b/writable-property-names-in/docs/types/index.d.ts index 503b48bf..7300c0d8 100644 --- a/writable-property-names-in/docs/types/index.d.ts +++ b/writable-property-names-in/docs/types/index.d.ts @@ -30,7 +30,7 @@ * @returns a list of own and inherited writable property names * * @example -* var defineProperty = require( `@stdlib/utils/define-property` ); +* var defineProperty = require( '@stdlib/utils/define-property' ); * * var obj = { 'a': 'b' }; * diff --git a/writable-property-names/docs/types/index.d.ts b/writable-property-names/docs/types/index.d.ts index f5e77a79..c3a4903e 100644 --- a/writable-property-names/docs/types/index.d.ts +++ b/writable-property-names/docs/types/index.d.ts @@ -30,7 +30,7 @@ * @returns a list of own writable property names * * @example -* var defineProperty = require( `@stdlib/utils/define-property` ); +* var defineProperty = require( '@stdlib/utils/define-property' ); * * var obj = { 'a': 'b' }; *