From bcb529203a794f45f50000dda1c4486d642ea1cc Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 27 Nov 2024 02:26:29 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 8 +- CONTRIBUTORS | 6 +- README.md | 62 +++++++++++ benchmark/benchmark.map.js | 59 ++++++++++ benchmark/benchmark.map.length.js | 112 +++++++++++++++++++ dist/index.js | 2 +- dist/index.js.map | 6 +- lib/main.js | 50 ++++++++- package.json | 1 + test/test.map.js | 177 ++++++++++++++++++++++++++++++ 10 files changed, 471 insertions(+), 12 deletions(-) create mode 100644 benchmark/benchmark.map.js create mode 100644 benchmark/benchmark.map.length.js create mode 100644 test/test.map.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b014c8..3b2faf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,13 @@
-## Unreleased (2024-11-26) +## Unreleased (2024-11-27)
### Features +- [`1d217ba`](https://github.com/stdlib-js/stdlib/commit/1d217bad1d35210a57d65c8be67c596815589082) - add `map` method to `array/fixed-endian-factory` [(#3270)](https://github.com/stdlib-js/stdlib/pull/3270) - [`2df0e9b`](https://github.com/stdlib-js/stdlib/commit/2df0e9bb08b8ad1c573b7c2383ef39e492dd5436) - add `some` method to `array/fixed-endian-factory` [(#3241)](https://github.com/stdlib-js/stdlib/pull/3241) - [`e3a2173`](https://github.com/stdlib-js/stdlib/commit/e3a2173a24bd8634f333cace626fc2d71740ebd3) - add `every` method to `array/fixed-endian-factory` [(#3200)](https://github.com/stdlib-js/stdlib/pull/3200) - [`b34732c`](https://github.com/stdlib-js/stdlib/commit/b34732cf655db60fbc798e12952f88c3edb07eaf) - add `at` method to `array/fixed-endian-factory` [(#3184)](https://github.com/stdlib-js/stdlib/pull/3184) @@ -24,9 +25,9 @@ ### Closed Issues -A total of 3 issues were closed in this release: +A total of 4 issues were closed in this release: -[#3135](https://github.com/stdlib-js/stdlib/issues/3135), [#3138](https://github.com/stdlib-js/stdlib/issues/3138), [#3155](https://github.com/stdlib-js/stdlib/issues/3155) +[#3135](https://github.com/stdlib-js/stdlib/issues/3135), [#3138](https://github.com/stdlib-js/stdlib/issues/3138), [#3150](https://github.com/stdlib-js/stdlib/issues/3150), [#3155](https://github.com/stdlib-js/stdlib/issues/3155)
@@ -38,6 +39,7 @@ A total of 3 issues were closed in this release:
+- [`1d217ba`](https://github.com/stdlib-js/stdlib/commit/1d217bad1d35210a57d65c8be67c596815589082) - **feat:** add `map` method to `array/fixed-endian-factory` [(#3270)](https://github.com/stdlib-js/stdlib/pull/3270) _(by Aayush Khanna, Athan Reines)_ - [`2df0e9b`](https://github.com/stdlib-js/stdlib/commit/2df0e9bb08b8ad1c573b7c2383ef39e492dd5436) - **feat:** add `some` method to `array/fixed-endian-factory` [(#3241)](https://github.com/stdlib-js/stdlib/pull/3241) _(by Kshitij-Dale, Athan Reines)_ - [`abb0dc3`](https://github.com/stdlib-js/stdlib/commit/abb0dc38783210623e67f19a5bb95b3998f75ff7) - **docs:** update examples and descriptions _(by Athan Reines)_ - [`95d0bbc`](https://github.com/stdlib-js/stdlib/commit/95d0bbc4b76c57dba4b4edd343dcd046490d4a51) - **bench:** test for primitive value _(by Athan Reines)_ diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 30c8723..fd0e729 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3,8 +3,7 @@ # Contributors listed in alphabetical order. Aayush Khanna -Abhijit -AbhijitRaut04 <121740684+AbhijitRaut04@users.noreply.github.com> +Abhijit Raut Adarsh Palaskar Aditya Sapra AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> @@ -45,7 +44,6 @@ Joey Reed Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> Joris Labie Justin Dennison -Kaif Mohd Karthik Prakash <116057817+skoriop@users.noreply.github.com> Khaldon Kohantika Nath <145763549+kohantikanath@users.noreply.github.com> @@ -56,7 +54,7 @@ Marcus Fantham Matt Cochrane Mihir Pandit <129577900+MSP20086@users.noreply.github.com> Milan Raj -Mohammad Kaif <98884589+Kaif987@users.noreply.github.com> +Mohammad Kaif Momtchil Momtchev Muhammad Haris Naresh Jagadeesan diff --git a/README.md b/README.md index a2dc3c1..ef571f7 100644 --- a/README.md +++ b/README.md @@ -516,6 +516,68 @@ var v = arr.get( 100 ); // returns undefined ``` + + +#### TypedArray.prototype.map( callbackFn\[, thisArg] ) + +Returns a new array with each element being the result of a provided callback function. + +```javascript +function fcn( v ) { + return -v; +} + +var Float64ArrayFE = fixedEndianFactory( 'float64' ); + +var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +// returns + +var out = arr.map( fcn ); +// returns + +var z = out.get( 0 ); +// returns -1.0 + +z = out.get( 1 ); +// returns -2.0 + +z = out.get( 2 ); +// returns -3.0 +``` + +The callback function is provided three arguments: + +- **value**: current array element. +- **index**: current array element index. +- **arr**: the array on which this method was called. + +To set the function execution context, provide a `thisArg`. + +```javascript +function fcn( v, i ) { + this.count += i; + return -v; +} + +var Float64ArrayFE = fixedEndianFactory( 'float64' ); + +var arr = new Float64ArrayFE( 'little-endian', 3 ); + +arr.set( -1.0, 0 ); +arr.set( 1.0, 1 ); +arr.set( -1.0, 2 ); + +var context = { + 'count': 0 +}; + +var out = arr.map( fcn, context ); +// returns + +var count = context.count; +// returns 3; +``` + #### TypedArrayFE.prototype.set( arr\[, offset] ) diff --git a/benchmark/benchmark.map.js b/benchmark/benchmark.map.js new file mode 100644 index 0000000..1f546b0 --- /dev/null +++ b/benchmark/benchmark.map.js @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench-harness' ); +var pkg = require( './../package.json' ).name; +var factory = require( './../lib' ); + + +// VARIABLES // + +var Float64ArrayFE = factory( 'float64' ); + + +// MAIN // + +bench( pkg+':map', function benchmark( b ) { + var out; + var arr; + var i; + + arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = arr.map( identity ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( out instanceof Float64ArrayFE ) ) { + b.fail( 'should return a typed array' ); + } + b.pass( 'benchmark finished' ); + b.end(); + + function identity( v ) { + return v; + } +}); diff --git a/benchmark/benchmark.map.length.js b/benchmark/benchmark.map.length.js new file mode 100644 index 0000000..7c2e54f --- /dev/null +++ b/benchmark/benchmark.map.length.js @@ -0,0 +1,112 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench-harness' ); +var pow = require( '@stdlib/math-base-special-pow' ); +var zeroTo = require( '@stdlib/array-zero-to' ); +var pkg = require( './../package.json' ).name; +var factory = require( './../lib' ); + + +// VARIABLES // + +var Float64ArrayFE = factory( 'float64' ); + + +// FUNCTIONS // + +/** +* Identity function. +* +* @private +* @param {number} value - array element +* @param {NonNegativeInteger} idx - array element index +* @param {TypedArray} arr - array instance +* @returns {number} input array element +*/ +function identity( value ) { + return value; +} + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = arr.map( identity ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( out instanceof Float64ArrayFE ) ) { + b.fail( 'should return a TypedArray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':map:len='+len, f ); + } +} + +main(); diff --git a/dist/index.js b/dist/index.js index 48b8b2f..181b1a2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -"use strict";var B=function(f,i){return function(){return i||f((i={exports:{}}).exports,i),i.exports}};var N=B(function(mr,Y){"use strict";function Q(f){var i,h;for(i=[];h=f.next(),!h.done;)i.push(h.value);return i}Y.exports=Q});var D=B(function(yr,C){"use strict";function W(f,i,h){var y,p,u;for(y=[],u=-1;p=f.next(),!p.done;)u+=1,y.push(i.call(h,p.value,u));return y}C.exports=W});var K=B(function(wr,J){"use strict";var L=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,X=require("@stdlib/assert-is-integer").isPrimitive,O=require("@stdlib/assert-is-collection"),x=require("@stdlib/assert-is-arraybuffer"),U=require("@stdlib/assert-is-object"),c=require("@stdlib/assert-is-function"),Z=require("@stdlib/assert-is-string").isPrimitive,I=require("@stdlib/array-base-assert-is-byte-order"),$=require("@stdlib/string-base-lowercase"),rr=require("@stdlib/assert-has-iterator-symbol-support"),V=require("@stdlib/symbol-iterator"),g=require("@stdlib/utils-define-nonenumerable-read-only-property"),er=require("@stdlib/assert-is-prototype-of"),A=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),R=require("@stdlib/array-buffer"),d=require("@stdlib/array-dataview"),S=require("@stdlib/array-base-getter"),F=require("@stdlib/array-base-accessor-getter"),tr=require("@stdlib/array-base-assert-contains").factory,nr=require("@stdlib/ndarray-base-bytes-per-element"),ir=require("@stdlib/string-base-capitalize"),a=require("@stdlib/string-format"),G=N(),ar=D(),H=rr(),or=["float64","float32","int32","int16","uint32","uint16"],ur={float64:"setFloat64",float32:"setFloat32",int32:"setInt32",int16:"setInt16",uint32:"setUint32",uint16:"setUint16"},sr={float64:"getFloat64",float32:"getFloat32",int32:"getInt32",int16:"getInt16",uint32:"getUint32",uint16:"getUint16"},b={c:"a",f:"a",i:"an",u:"a",b:"a"},fr=tr(or);function P(f){return Z(f)?$(f):null}function z(f){return f==="little-endian"}function lr(f){return ir(f)+"ArrayFE"}function hr(f){var i,h,y,p;if(!fr(f))throw new TypeError(a("invalid argument. First argument must be a supported data type. Value: `%s`.",f));i=nr(f),h=lr(f),y=sr[f],p=ur[f];function u(){var o,e,t,n,r,l,s,w;if(t=arguments.length,!(this instanceof u))return t<2?new u(arguments[0]):t===2?new u(arguments[0],arguments[1]):t===3?new u(arguments[0],arguments[1],arguments[2]):new u(arguments[0],arguments[1],arguments[2],arguments[3]);if(e=P(arguments[0]),e===null||!I(e))throw new TypeError(a("invalid argument. First argument must be a supported byte order. Value: `%s`.",arguments[0]));if(n=z(e),t-=1,t===0)r=new d(new R(0));else if(t===1)if(s=arguments[t],L(s))r=new d(new R(s*i));else if(O(s))r=j(new d(new R(s.length*i)),s,n);else if(x(s))r=new d(s);else if(U(s)){if(H===!1)throw new TypeError(a("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",s));if(!c(s[V]))throw new TypeError(a("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",s));if(r=s[V](),!c(r.next))throw new TypeError(a("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",s));w=G(r),r=j(new d(new R(w.length*i)),w,n)}else throw new TypeError(a("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",s));else{if(r=arguments[1],!x(r))throw new TypeError(a("invalid argument. Must provide an ArrayBuffer. Value: `%s`.",r));if(o=arguments[2],!L(o))throw new TypeError(a("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",o));if(t===2)r=new d(r,o);else{if(l=arguments[3],!L(l))throw new TypeError(a("invalid argument. Length must be a nonnegative integer. Value: `%s`.",l));if(l*=i,l>r.byteLength-o)throw new RangeError(a("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",l));r=new d(r,o,l)}}return g(this,"_buffer",r),g(this,"_length",r.byteLength/i),g(this,"_isLE",n),this}return g(u,"BYTES_PER_ELEMENT",i),g(u,"name",h),g(u,"from",function(e,t){var n,r,l,s,w,v,m,q,M,_,E;if(!c(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!k(this))throw new TypeError(a("invalid invocation. `this` is not %s %s.",b[f[0]],h));if(r=P(e),r===null||!I(r))throw new TypeError(a("invalid argument. First argument must be a supported byte order. Value: `%s`.",e));if(w=z(r),l=arguments.length,l>2){if(s=arguments[2],!c(s))throw new TypeError(a("invalid argument. Third argument must be a function. Value: `%s`.",s));l>3&&(n=arguments[3])}if(O(t)){if(s){for(_=t.length,t.get&&t.set?M=F("default"):M=S("default"),v=new this(r,_),m=v._buffer,E=0;E<_;E++)m[p](E*i,s.call(n,M(t,E),E),w);return v}return new this(r,t)}if(U(t)&&H&&c(t[V])){if(m=t[V](),!c(m.next))throw new TypeError(a("invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.",t));for(s?q=ar(m,s,n):q=G(m),_=q.length,v=new this(r,_),m=v._buffer,E=0;E<_;E++)m[p](E*i,q[E],w);return v}throw new TypeError(a("invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.",t))}),g(u,"of",function(e){var t,n,r;if(!c(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!k(this))throw new TypeError(a("invalid invocation. `this` is not %s %s.",b[f[0]],h));if(t=P(e),t===null||!I(t))throw new TypeError(a("invalid argument. First argument must be a supported byte order. Value: `%s`.",e));for(n=[],r=1;r=t))return this._buffer[y](e*i,this._isLE)}),A(u.prototype,"buffer",function(){return this._buffer.buffer}),A(u.prototype,"byteLength",function(){return this._buffer.byteLength}),A(u.prototype,"byteOffset",function(){return this._buffer.byteOffset}),g(u.prototype,"BYTES_PER_ELEMENT",u.BYTES_PER_ELEMENT),g(u.prototype,"every",function(e,t){var n,r;if(!T(this))throw new TypeError(a("invalid invocation. `this` is not %s %s.",b[f[0]],h));if(!c(e))throw new TypeError(a("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;r=this._length))return this._buffer[y](e*i,this._isLE)}),A(u.prototype,"length",function(){return this._length}),g(u.prototype,"set",function(e){var t,n,r,l,s,w,v,m;if(!T(this))throw new TypeError(a("invalid invocation. `this` is not %s %s.",b[f[0]],h));if(r=this._buffer,arguments.length>1){if(n=arguments[1],!L(n))throw new TypeError(a("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(O(e)){if(w=e.length,n+w>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,t.get&&t.set?s=F("default"):s=S("default"),m=r.byteOffset+n*i,t.buffer===r.buffer&&t.byteOffsetm){for(l=[],v=0;v=this._length)throw new RangeError(a("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));r[p](n*i,e,this._isLE)}),g(u.prototype,"some",function(e,t){var n,r;if(!T(this))throw new TypeError(a("invalid invocation. `this` is not %s %s.",b[f[0]],h));if(!c(e))throw new TypeError(a("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,r=0;rr.byteLength-u)throw new RangeError(o("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",l));r=new d(r,u,l)}}return v(this,"_buffer",r),v(this,"_length",r.byteLength/a),v(this,"_isLE",i),this}return v(f,"BYTES_PER_ELEMENT",a),v(f,"name",h),v(f,"from",function(e,t){var i,r,l,n,m,g,E,q,S,_,p;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!P(this))throw new TypeError(o("invalid invocation. `this` is not %s %s.",c[s[0]],h));if(r=N(e),r===null||!O(r))throw new TypeError(o("invalid argument. First argument must be a supported byte order. Value: `%s`.",e));if(m=z(r),l=arguments.length,l>2){if(n=arguments[2],!b(n))throw new TypeError(o("invalid argument. Third argument must be a function. Value: `%s`.",n));l>3&&(i=arguments[3])}if(M(t)){if(n){for(_=t.length,t.get&&t.set?S=F("default"):S=R("default"),g=new this(r,_),E=g._buffer,p=0;p<_;p++)E[w](p*a,n.call(i,S(t,p),p),m);return g}return new this(r,t)}if(G(t)&&H&&b(t[A])){if(E=t[A](),!b(E.next))throw new TypeError(o("invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.",t));for(n?q=or(E,n,i):q=U(E),_=q.length,g=new this(r,_),E=g._buffer,p=0;p<_;p++)E[w](p*a,q[p],m);return g}throw new TypeError(o("invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.",t))}),v(f,"of",function(e){var t,i,r;if(!b(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!P(this))throw new TypeError(o("invalid invocation. `this` is not %s %s.",c[s[0]],h));if(t=N(e),t===null||!O(t))throw new TypeError(o("invalid argument. First argument must be a supported byte order. Value: `%s`.",e));for(i=[],r=1;r=t))return this._buffer[y](e*a,this._isLE)}),V(f.prototype,"buffer",function(){return this._buffer.buffer}),V(f.prototype,"byteLength",function(){return this._buffer.byteLength}),V(f.prototype,"byteOffset",function(){return this._buffer.byteOffset}),v(f.prototype,"BYTES_PER_ELEMENT",f.BYTES_PER_ELEMENT),v(f.prototype,"every",function(e,t){var i,r;if(!T(this))throw new TypeError(o("invalid invocation. `this` is not %s %s.",c[s[0]],h));if(!b(e))throw new TypeError(o("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,r=0;r=this._length))return this._buffer[y](e*a,this._isLE)}),V(f.prototype,"length",function(){return this._length}),v(f.prototype,"map",function(e,t){var i,r,l,n,m;if(!T(this))throw new TypeError(o("invalid invocation. `this` is not %s %s.",c[s[0]],h));if(!b(e))throw new TypeError(o("invalid argument. First argument must be a function. Value: `%s`.",e));for(l=this._buffer,r=new this.constructor(vr(this._isLE),this._length),i=r._buffer,n=0;n1){if(i=arguments[1],!L(i))throw new TypeError(o("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",i))}else i=0;if(M(e)){if(m=e.length,i+m>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=e,t.get&&t.set?n=F("default"):n=R("default"),E=r.byteOffset+i*a,t.buffer===r.buffer&&t.byteOffsetE){for(l=[],g=0;g=this._length)throw new RangeError(o("invalid argument. Index argument is out-of-bounds. Value: `%u`.",i));r[w](i*a,e,this._isLE)}),v(f.prototype,"some",function(e,t){var i,r;if(!T(this))throw new TypeError(o("invalid invocation. `this` is not %s %s.",c[s[0]],h));if(!b(e))throw new TypeError(o("invalid argument. First argument must be a function. Value: `%s`.",e));for(i=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction factory( dtype ) { // eslint-disable-line max-lines-per-function, stdlib/jsdoc-require-throws-tags\n\tvar BYTES_PER_ELEMENT;\n\tvar CTOR_NAME;\n\tvar GETTER;\n\tvar SETTER;\n\n\tif ( !isDataType( dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tBYTES_PER_ELEMENT = bytesPerElement( dtype );\n\tCTOR_NAME = dtype2ctor( dtype );\n\tGETTER = DTYPE2GET[ dtype ];\n\tSETTER = DTYPE2SET[ dtype ];\n\n\t/**\n\t* Typed array constructor which returns a typed array representing an array of values in a specified byte order.\n\t*\n\t* @private\n\t* @constructor\n\t* @param {string} endianness - byte order\n\t* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {NonNegativeInteger} [length] - view length\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n\t* @throws {TypeError} byte offset must be a nonnegative integer\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tfunction TypedArray() {\n\t\tvar byteOffset;\n\t\tvar endianness;\n\t\tvar nargs;\n\t\tvar isLE;\n\t\tvar buf;\n\t\tvar len;\n\t\tvar arg;\n\t\tvar tmp;\n\n\t\tnargs = arguments.length;\n\t\tif ( !(this instanceof TypedArray) ) {\n\t\t\tif ( nargs < 2 ) {\n\t\t\t\treturn new TypedArray( arguments[0] );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new TypedArray( arguments[0], arguments[1] );\n\t\t\t}\n\t\t\tif ( nargs === 3 ) {\n\t\t\t\treturn new TypedArray( arguments[0], arguments[1], arguments[2] );\n\t\t\t}\n\t\t\treturn new TypedArray( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t\t}\n\t\tendianness = byteOrder( arguments[ 0 ] );\n\t\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t\t}\n\t\tisLE = isLittleEndian( endianness );\n\n\t\tnargs -= 1;\n\n\t\t// Create the underlying data buffer...\n\t\tif ( nargs === 0 ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t\t} else if ( nargs === 1 ) {\n\t\t\targ = arguments[ nargs ];\n\t\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t\t} else if ( isCollection( arg ) ) {\n\t\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\t\tbuf = new DataView( arg );\n\t\t\t} else if ( isObject( arg ) ) {\n\t\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t\t} else {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t} else {\n\t\t\tbuf = arguments[ 1 ];\n\t\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbyteOffset = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t\t} else {\n\t\t\t\tlen = arguments[ 3 ];\n\t\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t\t}\n\t\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t\t}\n\t\t}\n\t\tsetReadOnly( this, '_buffer', buf );\n\t\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\t\tsetReadOnly( this, '_isLE', isLE );\n\n\t\treturn this;\n\t}\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof TypedArray\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( TypedArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof TypedArray\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetReadOnly( TypedArray, 'name', CTOR_NAME );\n\n\t/**\n\t* Creates a new typed array from an array-like object or an iterable.\n\t*\n\t* @private\n\t* @name from\n\t* @memberof TypedArray\n\t* @type {Function}\n\t* @param {string} endianness - byte order\n\t* @param {(Collection|Iterable)} src - array-like object or iterable\n\t* @param {Function} [clbk] - callback to invoke for each source element\n\t* @param {*} [thisArg] - context\n\t* @throws {TypeError} `this` context must be a constructor\n\t* @throws {TypeError} `this` must be a typed array constructor\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @throws {TypeError} second argument must be an array-like object or an iterable\n\t* @throws {TypeError} third argument must be a function\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tsetReadOnly( TypedArray, 'from', function from( endianness, src ) {\n\t\tvar thisArg;\n\t\tvar order;\n\t\tvar nargs;\n\t\tvar clbk;\n\t\tvar isLE;\n\t\tvar out;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isFunction( this ) ) {\n\t\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t\t}\n\t\tif ( !isTypedArrayConstructor( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\torder = byteOrder( endianness );\n\t\tif ( order === null || !isByteOrder( order ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t\t}\n\t\tisLE = isLittleEndian( order );\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs > 2 ) {\n\t\t\tclbk = arguments[ 2 ];\n\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t}\n\t\t\tif ( nargs > 3 ) {\n\t\t\t\tthisArg = arguments[ 3 ];\n\t\t\t}\n\t\t}\n\t\tif ( isCollection( src ) ) {\n\t\t\tif ( clbk ) {\n\t\t\t\tlen = src.length;\n\t\t\t\tif ( src.get && src.set ) {\n\t\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t\t} else {\n\t\t\t\t\tget = getter( 'default' );\n\t\t\t\t}\n\t\t\t\tout = new this( order, len );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ SETTER ]( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\treturn new this( order, src );\n\t\t}\n\t\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t}\n\t\t\tif ( clbk ) {\n\t\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t\t} else {\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t}\n\t\t\tlen = tmp.length;\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ SETTER ]( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t});\n\n\t/**\n\t* Creates a new typed array from a variable number of arguments.\n\t*\n\t* @private\n\t* @name of\n\t* @memberof TypedArray\n\t* @type {Function}\n\t* @param {string} endianness - byte order\n\t* @param {...*} element - array elements\n\t* @throws {TypeError} `this` context must be a constructor\n\t* @throws {TypeError} `this` must be a typed array constructor\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tsetReadOnly( TypedArray, 'of', function of( endianness ) {\n\t\tvar order;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( !isFunction( this ) ) {\n\t\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t\t}\n\t\tif ( !isTypedArrayConstructor( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\torder = byteOrder( endianness );\n\t\tif ( order === null || !isByteOrder( order ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn new this( order, args );\n\t});\n\n\t/**\n\t* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n\t*\n\t* @private\n\t* @name at\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {integer} idx - element index\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} must provide an integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'at', function at( idx ) {\n\t\tvar len;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tlen = this._length;\n\t\tif ( idx < 0 ) {\n\t\t\tidx += len;\n\t\t}\n\t\tif ( idx < 0 || idx >= len ) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._buffer[ GETTER ]( idx * BYTES_PER_ELEMENT, this._isLE );\n\t});\n\n\t/**\n\t* Pointer to the underlying data buffer.\n\t*\n\t* @private\n\t* @name buffer\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {ArrayBuffer}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'buffer', function get() {\n\t\treturn this._buffer.buffer;\n\t});\n\n\t/**\n\t* Size (in bytes) of the array.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'byteLength', function get() {\n\t\treturn this._buffer.byteLength;\n\t});\n\n\t/**\n\t* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\t*\n\t* @private\n\t* @name byteOffset\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'byteOffset', function get() {\n\t\treturn this._buffer.byteOffset;\n\t});\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'BYTES_PER_ELEMENT', TypedArray.BYTES_PER_ELEMENT );\n\n\t/**\n\t* Tests whether all elements in an array pass a test implemented by a predicate function.\n\t*\n\t* @name every\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} predicate - predicate function\n\t* @param {*} [thisArg] - predicate function execution context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t* @returns {boolean} boolean indicating whether all elements pass a test\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'every', function every( predicate, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( predicate ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tif ( !predicate.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n\n\t/**\n\t* Invokes a function once for each array element.\n\t*\n\t* @name forEach\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} fcn - function to invoke\n\t* @param {*} [thisArg] - function invocation context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tfcn.call( thisArg, buf[ GETTER ]( i*BYTES_PER_ELEMENT, this._isLE ), i, this );\n\t\t}\n\t});\n\n\t/**\n\t* Returns an array element.\n\t*\n\t* @private\n\t* @name get\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {NonNegativeInteger} idx - element index\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} must provide a nonnegative integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'get', function get( idx ) {\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._buffer[ GETTER ]( idx*BYTES_PER_ELEMENT, this._isLE );\n\t});\n\n\t/**\n\t* Number of array elements.\n\t*\n\t* @private\n\t* @name length\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'length', function get() {\n\t\treturn this._length;\n\t});\n\n\t/**\n\t* Sets an array element.\n\t*\n\t* ## Notes\n\t*\n\t* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n\t*\n\t* In the other overlapping scenario,\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n\t*\n\t* @private\n\t* @name set\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {(Collection|TypedArray|*)} value - value(s)\n\t* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} index argument must be a nonnegative integer\n\t* @throws {RangeError} index argument is out-of-bounds\n\t* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n\t* @returns {void}\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'set', function set( value ) {\n\t\tvar sbuf;\n\t\tvar idx;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tif ( arguments.length > 1 ) {\n\t\t\tidx = arguments[ 1 ];\n\t\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t\t}\n\t\t} else {\n\t\t\tidx = 0;\n\t\t}\n\t\tif ( isCollection( value ) ) {\n\t\t\tN = value.length;\n\t\t\tif ( idx+N > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\t\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = [];\n\t\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\t\tbuf[ SETTER ]( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tbuf[ SETTER ]( idx*BYTES_PER_ELEMENT, value, this._isLE );\n\t});\n\n\t/**\n\t* Tests whether at least one element in the typed array passes a test implemented by a predicate function.\n\t*\n\t* @name some\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} predicate - predicate function\n\t* @param {*} [thisArg] - predicate function execution context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t* @returns {boolean} boolean indicating whether at least one element passes a test\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'some', function some( predicate, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( predicate ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tif ( predicate.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\t/**\n\t* Serializes an array as a string.\n\t*\n\t* @private\n\t* @name toString\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @returns {string} string representation\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'toString', function toString() {\n\t\tvar out;\n\t\tvar buf;\n\t\tvar i;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tout = [];\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tout.push( buf[ GETTER ]( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t\t}\n\t\treturn out.join( ',' );\n\t});\n\n\treturn TypedArray;\n\n\t/**\n\t* Returns a boolean indicating if a value is a typed array constructor.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a typed array constructor\n\t*/\n\tfunction isTypedArrayConstructor( value ) {\n\t\treturn ( value === TypedArray );\n\t}\n\n\t/**\n\t* Returns a boolean indicating if a value is a typed array.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a typed array\n\t*/\n\tfunction isTypedArray( value ) {\n\t\treturn (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === CTOR_NAME ||\n\t\t\t\tisPrototypeOf( value, TypedArray.prototype )\n\t\t\t) &&\n\t\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t\t);\n\t}\n\n\t/**\n\t* Fills an output DataView with array values.\n\t*\n\t* @private\n\t* @param {DataView} view - output data view\n\t* @param {Array} arr - input array\n\t* @param {boolean} isLE - boolean indicating whether to store values in little-endian byte order\n\t* @returns {DataView} output data view\n\t*/\n\tfunction fromArray( view, arr, isLE ) {\n\t\tvar len;\n\t\tvar get;\n\t\tvar i;\n\n\t\tlen = arr.length;\n\t\tif ( arr.get && arr.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tview[ SETTER ]( i*BYTES_PER_ELEMENT, get( arr, i ), isLE );\n\t\t}\n\t\treturn view;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\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 typed array constructor for creating typed arrays having a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-factory\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA6BA,SAASC,EAAcC,EAAK,CAC3B,IAAIC,EACAC,EAGJ,IADAD,EAAM,CAAC,EAENC,EAAIF,EAAG,KAAK,EACP,CAAAE,EAAE,MAGPD,EAAI,KAAMC,EAAE,KAAM,EAEnB,OAAOD,CACR,CAKAH,EAAO,QAAUC,IC/CjB,IAAAI,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA+BA,SAASC,EAAiBC,EAAIC,EAAMC,EAAU,CAC7C,IAAIC,EACAC,EACAC,EAIJ,IAFAF,EAAM,CAAC,EACPE,EAAI,GAEHD,EAAIJ,EAAG,KAAK,EAC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,OAAOsB,CACR,CACD,CAKAnE,EAAO,QAAUoC,KC7uBjB,IAAIiC,GAAO,IAKX,OAAO,QAAUA", - "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isInteger", "isCollection", "isArrayBuffer", "isObject", "isFunction", "isString", "isByteOrder", "lowercase", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "isPrototypeOf", "setReadOnlyAccessor", "ArrayBuffer", "DataView", "getter", "accessorGetter", "contains", "bytesPerElement", "capitalize", "format", "fromIterator", "fromIteratorMap", "HAS_ITERATOR_SYMBOL", "DTYPES", "DTYPE2SET", "DTYPE2GET", "CHAR2ARTICLE", "isDataType", "byteOrder", "value", "isLittleEndian", "dtype2ctor", "dtype", "factory", "BYTES_PER_ELEMENT", "CTOR_NAME", "GETTER", "SETTER", "TypedArray", "byteOffset", "endianness", "nargs", "isLE", "buf", "len", "arg", "tmp", "fromArray", "src", "thisArg", "order", "clbk", "out", "get", "i", "isTypedArrayConstructor", "args", "idx", "isTypedArray", "predicate", "fcn", "sbuf", "N", "j", "view", "arr", "main"] + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( 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 ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 max-len, no-restricted-syntax, no-invalid-this, max-lines */\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' );\nvar isObject = require( '@stdlib/assert-is-object' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isByteOrder = require( '@stdlib/array-base-assert-is-byte-order' );\nvar lowercase = require( '@stdlib/string-base-lowercase' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' );\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isPrototypeOf = require( '@stdlib/assert-is-prototype-of' ); // eslint-disable-line stdlib/no-redeclare\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\nvar DataView = require( '@stdlib/array-dataview' );\nvar getter = require( '@stdlib/array-base-getter' );\nvar accessorGetter = require( '@stdlib/array-base-accessor-getter' );\nvar contains = require( '@stdlib/array-base-assert-contains' ).factory;\nvar bytesPerElement = require( '@stdlib/ndarray-base-bytes-per-element' );\nvar capitalize = require( '@stdlib/string-base-capitalize' );\nvar format = require( '@stdlib/string-format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\n\n\n// VARIABLES //\n\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\nvar LITTLE_ENDIAN = 'little-endian';\nvar BIG_ENDIAN = 'big-endian';\nvar DTYPES = [ 'float64', 'float32', 'int32', 'int16', 'uint32', 'uint16' ];\nvar DTYPE2SET = {\n\t'float64': 'setFloat64',\n\t'float32': 'setFloat32',\n\t'int32': 'setInt32',\n\t'int16': 'setInt16',\n\t'uint32': 'setUint32',\n\t'uint16': 'setUint16'\n};\nvar DTYPE2GET = {\n\t'float64': 'getFloat64',\n\t'float32': 'getFloat32',\n\t'int32': 'getInt32',\n\t'int16': 'getInt16',\n\t'uint32': 'getUint32',\n\t'uint16': 'getUint16'\n};\nvar CHAR2ARTICLE = {\n\t'c': 'a',\n\t'f': 'a',\n\t'i': 'an',\n\t'u': 'a',\n\t'b': 'a'\n};\nvar isDataType = contains( DTYPES );\n\n\n// FUNCTIONS //\n\n/**\n* Normalizes a byte order value.\n*\n* @private\n* @param {*} value - byte order\n* @returns {(string|null)} normalized byte order\n*/\nfunction byteOrder( value ) {\n\treturn ( isString( value ) ) ? lowercase( value ) : null;\n}\n\n/**\n* Tests whether a provided byte order is little-endian byte order.\n*\n* @private\n* @param {string} value - byte order\n* @returns {boolean} boolean indicating whether a byte order is little-endian byte order\n*/\nfunction isLittleEndian( value ) {\n\treturn ( value === LITTLE_ENDIAN );\n}\n\n/**\n* Resolves a byte order string from a boolean flag.\n*\n* @private\n* @param {boolean} isLE - flag indicating whether an array is little-endian\n* @returns {string} resolved byte order\n*/\nfunction flag2byteOrder( isLE ) {\n\treturn ( isLE ) ? LITTLE_ENDIAN : BIG_ENDIAN;\n}\n\n/**\n* Converts a data type string to a constructor name.\n*\n* @private\n* @param {string} dtype - data type\n* @returns {string} constructor name\n*\n* @example\n* var n = dtype2ctor( 'float64' );\n* // returns 'Float64ArrayFE'\n*\n* @example\n* var n = dtype2ctor( 'int32' );\n* // returns 'Int32ArrayFE'\n*/\nfunction dtype2ctor( dtype ) {\n\treturn capitalize( dtype ) + 'ArrayFE';\n}\n\n\n// MAIN //\n\n/**\n* Returns a typed array constructor for creating typed arrays having a specified byte order.\n*\n* @param {string} dtype - typed array data type\n* @throws {TypeError} first argument must be a supported data type\n* @returns {Function} typed array constructor\n*\n* @example\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction factory( dtype ) { // eslint-disable-line max-lines-per-function, stdlib/jsdoc-require-throws-tags\n\tvar BYTES_PER_ELEMENT;\n\tvar CTOR_NAME;\n\tvar GETTER;\n\tvar SETTER;\n\n\tif ( !isDataType( dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tBYTES_PER_ELEMENT = bytesPerElement( dtype );\n\tCTOR_NAME = dtype2ctor( dtype );\n\tGETTER = DTYPE2GET[ dtype ];\n\tSETTER = DTYPE2SET[ dtype ];\n\n\t/**\n\t* Typed array constructor which returns a typed array representing an array of values in a specified byte order.\n\t*\n\t* @private\n\t* @constructor\n\t* @param {string} endianness - byte order\n\t* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {NonNegativeInteger} [length] - view length\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n\t* @throws {TypeError} byte offset must be a nonnegative integer\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tfunction TypedArray() {\n\t\tvar byteOffset;\n\t\tvar endianness;\n\t\tvar nargs;\n\t\tvar isLE;\n\t\tvar buf;\n\t\tvar len;\n\t\tvar arg;\n\t\tvar tmp;\n\n\t\tnargs = arguments.length;\n\t\tif ( !(this instanceof TypedArray) ) {\n\t\t\tif ( nargs < 2 ) {\n\t\t\t\treturn new TypedArray( arguments[0] );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new TypedArray( arguments[0], arguments[1] );\n\t\t\t}\n\t\t\tif ( nargs === 3 ) {\n\t\t\t\treturn new TypedArray( arguments[0], arguments[1], arguments[2] );\n\t\t\t}\n\t\t\treturn new TypedArray( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t\t}\n\t\tendianness = byteOrder( arguments[ 0 ] );\n\t\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t\t}\n\t\tisLE = isLittleEndian( endianness );\n\n\t\tnargs -= 1;\n\n\t\t// Create the underlying data buffer...\n\t\tif ( nargs === 0 ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t\t} else if ( nargs === 1 ) {\n\t\t\targ = arguments[ nargs ];\n\t\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t\t} else if ( isCollection( arg ) ) {\n\t\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\t\tbuf = new DataView( arg );\n\t\t\t} else if ( isObject( arg ) ) {\n\t\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t\t} else {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t} else {\n\t\t\tbuf = arguments[ 1 ];\n\t\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbyteOffset = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t\t} else {\n\t\t\t\tlen = arguments[ 3 ];\n\t\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t\t}\n\t\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t\t}\n\t\t}\n\t\tsetReadOnly( this, '_buffer', buf );\n\t\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\t\tsetReadOnly( this, '_isLE', isLE );\n\n\t\treturn this;\n\t}\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof TypedArray\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( TypedArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof TypedArray\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetReadOnly( TypedArray, 'name', CTOR_NAME );\n\n\t/**\n\t* Creates a new typed array from an array-like object or an iterable.\n\t*\n\t* @private\n\t* @name from\n\t* @memberof TypedArray\n\t* @type {Function}\n\t* @param {string} endianness - byte order\n\t* @param {(Collection|Iterable)} src - array-like object or iterable\n\t* @param {Function} [clbk] - callback to invoke for each source element\n\t* @param {*} [thisArg] - context\n\t* @throws {TypeError} `this` context must be a constructor\n\t* @throws {TypeError} `this` must be a typed array constructor\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @throws {TypeError} second argument must be an array-like object or an iterable\n\t* @throws {TypeError} third argument must be a function\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tsetReadOnly( TypedArray, 'from', function from( endianness, src ) {\n\t\tvar thisArg;\n\t\tvar order;\n\t\tvar nargs;\n\t\tvar clbk;\n\t\tvar isLE;\n\t\tvar out;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isFunction( this ) ) {\n\t\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t\t}\n\t\tif ( !isTypedArrayConstructor( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\torder = byteOrder( endianness );\n\t\tif ( order === null || !isByteOrder( order ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t\t}\n\t\tisLE = isLittleEndian( order );\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs > 2 ) {\n\t\t\tclbk = arguments[ 2 ];\n\t\t\tif ( !isFunction( clbk ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t\t}\n\t\t\tif ( nargs > 3 ) {\n\t\t\t\tthisArg = arguments[ 3 ];\n\t\t\t}\n\t\t}\n\t\tif ( isCollection( src ) ) {\n\t\t\tif ( clbk ) {\n\t\t\t\tlen = src.length;\n\t\t\t\tif ( src.get && src.set ) {\n\t\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t\t} else {\n\t\t\t\t\tget = getter( 'default' );\n\t\t\t\t}\n\t\t\t\tout = new this( order, len );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ SETTER ]( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\treturn new this( order, src );\n\t\t}\n\t\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t\t}\n\t\t\tif ( clbk ) {\n\t\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t\t} else {\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t}\n\t\t\tlen = tmp.length;\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ SETTER ]( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t});\n\n\t/**\n\t* Creates a new typed array from a variable number of arguments.\n\t*\n\t* @private\n\t* @name of\n\t* @memberof TypedArray\n\t* @type {Function}\n\t* @param {string} endianness - byte order\n\t* @param {...*} element - array elements\n\t* @throws {TypeError} `this` context must be a constructor\n\t* @throws {TypeError} `this` must be a typed array constructor\n\t* @throws {TypeError} first argument must be a supported byte order\n\t* @returns {TypedArray} typed array instance\n\t*/\n\tsetReadOnly( TypedArray, 'of', function of( endianness ) {\n\t\tvar order;\n\t\tvar args;\n\t\tvar i;\n\t\tif ( !isFunction( this ) ) {\n\t\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t\t}\n\t\tif ( !isTypedArrayConstructor( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\torder = byteOrder( endianness );\n\t\tif ( order === null || !isByteOrder( order ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn new this( order, args );\n\t});\n\n\t/**\n\t* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n\t*\n\t* @private\n\t* @name at\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {integer} idx - element index\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} must provide an integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'at', function at( idx ) {\n\t\tvar len;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tlen = this._length;\n\t\tif ( idx < 0 ) {\n\t\t\tidx += len;\n\t\t}\n\t\tif ( idx < 0 || idx >= len ) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._buffer[ GETTER ]( idx * BYTES_PER_ELEMENT, this._isLE );\n\t});\n\n\t/**\n\t* Pointer to the underlying data buffer.\n\t*\n\t* @private\n\t* @name buffer\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {ArrayBuffer}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'buffer', function get() {\n\t\treturn this._buffer.buffer;\n\t});\n\n\t/**\n\t* Size (in bytes) of the array.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'byteLength', function get() {\n\t\treturn this._buffer.byteLength;\n\t});\n\n\t/**\n\t* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\t*\n\t* @private\n\t* @name byteOffset\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'byteOffset', function get() {\n\t\treturn this._buffer.byteOffset;\n\t});\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'BYTES_PER_ELEMENT', TypedArray.BYTES_PER_ELEMENT );\n\n\t/**\n\t* Tests whether all elements in an array pass a test implemented by a predicate function.\n\t*\n\t* @name every\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} predicate - predicate function\n\t* @param {*} [thisArg] - predicate function execution context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t* @returns {boolean} boolean indicating whether all elements pass a test\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'every', function every( predicate, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( predicate ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tif ( !predicate.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n\n\t/**\n\t* Invokes a function once for each array element.\n\t*\n\t* @name forEach\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} fcn - function to invoke\n\t* @param {*} [thisArg] - function invocation context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tfcn.call( thisArg, buf[ GETTER ]( i*BYTES_PER_ELEMENT, this._isLE ), i, this );\n\t\t}\n\t});\n\n\t/**\n\t* Returns an array element.\n\t*\n\t* @private\n\t* @name get\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {NonNegativeInteger} idx - element index\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} must provide a nonnegative integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'get', function get( idx ) {\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._buffer[ GETTER ]( idx*BYTES_PER_ELEMENT, this._isLE );\n\t});\n\n\t/**\n\t* Number of array elements.\n\t*\n\t* @private\n\t* @name length\n\t* @memberof TypedArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( TypedArray.prototype, 'length', function get() {\n\t\treturn this._length;\n\t});\n\n\t/**\n\t* Returns a new array with each element being the result of a provided callback function.\n\t*\n\t* @private\n\t* @name map\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} fcn - function to invoke\n\t* @param {*} [thisArg] - function invocation context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t* @returns {TypedArray} new typed array\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'map', function map( fcn, thisArg ) {\n\t\tvar obuf;\n\t\tvar out;\n\t\tvar buf;\n\t\tvar i;\n\t\tvar v;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tout = new this.constructor( flag2byteOrder( this._isLE ), this._length );\n\t\tobuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tv = fcn.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this );\n\t\t\tobuf[ SETTER ]( i * BYTES_PER_ELEMENT, v, this._isLE );\n\t\t}\n\t\treturn out;\n\t});\n\n\t/**\n\t* Sets an array element.\n\t*\n\t* ## Notes\n\t*\n\t* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n\t*\n\t* In the other overlapping scenario,\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n\t*\n\t* @private\n\t* @name set\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {(Collection|TypedArray|*)} value - value(s)\n\t* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} index argument must be a nonnegative integer\n\t* @throws {RangeError} index argument is out-of-bounds\n\t* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n\t* @returns {void}\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'set', function set( value ) {\n\t\tvar sbuf;\n\t\tvar idx;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tif ( arguments.length > 1 ) {\n\t\t\tidx = arguments[ 1 ];\n\t\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t\t}\n\t\t} else {\n\t\t\tidx = 0;\n\t\t}\n\t\tif ( isCollection( value ) ) {\n\t\t\tN = value.length;\n\t\t\tif ( idx+N > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\t\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = [];\n\t\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\t\tbuf[ SETTER ]( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tbuf[ SETTER ]( idx*BYTES_PER_ELEMENT, value, this._isLE );\n\t});\n\n\t/**\n\t* Tests whether at least one element in the typed array passes a test implemented by a predicate function.\n\t*\n\t* @name some\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @param {Function} predicate - predicate function\n\t* @param {*} [thisArg] - predicate function execution context\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @throws {TypeError} first argument must be a function\n\t* @returns {boolean} boolean indicating whether at least one element passes a test\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'some', function some( predicate, thisArg ) {\n\t\tvar buf;\n\t\tvar i;\n\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tif ( !isFunction( predicate ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tif ( predicate.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\t/**\n\t* Serializes an array as a string.\n\t*\n\t* @private\n\t* @name toString\n\t* @memberof TypedArray.prototype\n\t* @type {Function}\n\t* @throws {TypeError} `this` must be a typed array instance\n\t* @returns {string} string representation\n\t*/\n\tsetReadOnly( TypedArray.prototype, 'toString', function toString() {\n\t\tvar out;\n\t\tvar buf;\n\t\tvar i;\n\t\tif ( !isTypedArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) );\n\t\t}\n\t\tout = [];\n\t\tbuf = this._buffer;\n\t\tfor ( i = 0; i < this._length; i++ ) {\n\t\t\tout.push( buf[ GETTER ]( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t\t}\n\t\treturn out.join( ',' );\n\t});\n\n\treturn TypedArray;\n\n\t/**\n\t* Returns a boolean indicating if a value is a typed array constructor.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a typed array constructor\n\t*/\n\tfunction isTypedArrayConstructor( value ) {\n\t\treturn ( value === TypedArray );\n\t}\n\n\t/**\n\t* Returns a boolean indicating if a value is a typed array.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a typed array\n\t*/\n\tfunction isTypedArray( value ) {\n\t\treturn (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === CTOR_NAME ||\n\t\t\t\tisPrototypeOf( value, TypedArray.prototype )\n\t\t\t) &&\n\t\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t\t);\n\t}\n\n\t/**\n\t* Fills an output DataView with array values.\n\t*\n\t* @private\n\t* @param {DataView} view - output data view\n\t* @param {Array} arr - input array\n\t* @param {boolean} isLE - boolean indicating whether to store values in little-endian byte order\n\t* @returns {DataView} output data view\n\t*/\n\tfunction fromArray( view, arr, isLE ) {\n\t\tvar len;\n\t\tvar get;\n\t\tvar i;\n\n\t\tlen = arr.length;\n\t\tif ( arr.get && arr.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tview[ SETTER ]( i*BYTES_PER_ELEMENT, get( arr, i ), isLE );\n\t\t}\n\t\treturn view;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\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 typed array constructor for creating typed arrays having a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-factory\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var factory = require( '@stdlib/array-fixed-endian-factory' );\n*\n* var Float64ArrayFE = factory( 'float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA6BA,SAASC,EAAcC,EAAK,CAC3B,IAAIC,EACAC,EAGJ,IADAD,EAAM,CAAC,EAENC,EAAIF,EAAG,KAAK,EACP,CAAAE,EAAE,MAGPD,EAAI,KAAMC,EAAE,KAAM,EAEnB,OAAOD,CACR,CAKAH,EAAO,QAAUC,IC/CjB,IAAAI,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA+BA,SAASC,EAAiBC,EAAIC,EAAMC,EAAU,CAC7C,IAAIC,EACAC,EACAC,EAIJ,IAFAF,EAAM,CAAC,EACPE,EAAI,GAEHD,EAAIJ,EAAG,KAAK,EACP,CAAAI,EAAE,MAGPC,GAAK,EAC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,EAAM,KAAK,QACL,EAAI,EAAG,EAAI,KAAK,QAAS,IAC9BS,EAAI,KAAMT,EAAKN,CAAO,EAAG,EAAEF,EAAmB,KAAK,KAAM,CAAE,EAE5D,OAAOiB,EAAI,KAAM,GAAI,CACtB,CAAC,EAEMb,EASP,SAASgB,EAAyB3B,EAAQ,CACzC,OAASA,IAAUW,CACpB,CASA,SAASmB,EAAc9B,EAAQ,CAC9B,OACC,OAAOA,GAAU,UACjBA,IAAU,OAETA,EAAM,YAAY,OAASQ,GAC3B7B,GAAeqB,EAAOW,EAAW,SAAU,IAE5CX,EAAM,oBAAsBO,CAE9B,CAWA,SAASY,EAAWmB,EAAMC,EAAKpC,EAAO,CACrC,IAAIa,EACAS,EACAC,EAQJ,IANAV,EAAMuB,EAAI,OACLA,EAAI,KAAOA,EAAI,IACnBd,EAAMzC,EAAgB,SAAU,EAEhCyC,EAAM1C,EAAQ,SAAU,EAEnB2C,EAAI,EAAGA,EAAIV,EAAKU,IACrBY,EAAM5B,CAAO,EAAGgB,EAAEnB,EAAmBkB,EAAKc,EAAKb,CAAE,EAAGvB,CAAK,EAE1D,OAAOmC,CACR,CACD,CAKAxE,EAAO,QAAUwC,KC7xBjB,IAAIkC,GAAO,IAKX,OAAO,QAAUA", + "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isInteger", "isCollection", "isArrayBuffer", "isObject", "isFunction", "isString", "isByteOrder", "lowercase", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "isPrototypeOf", "setReadOnlyAccessor", "ArrayBuffer", "DataView", "getter", "accessorGetter", "contains", "bytesPerElement", "capitalize", "format", "fromIterator", "fromIteratorMap", "HAS_ITERATOR_SYMBOL", "LITTLE_ENDIAN", "BIG_ENDIAN", "DTYPES", "DTYPE2SET", "DTYPE2GET", "CHAR2ARTICLE", "isDataType", "byteOrder", "value", "isLittleEndian", "flag2byteOrder", "isLE", "dtype2ctor", "dtype", "factory", "BYTES_PER_ELEMENT", "CTOR_NAME", "GETTER", "SETTER", "TypedArray", "byteOffset", "endianness", "nargs", "buf", "len", "arg", "tmp", "fromArray", "src", "thisArg", "order", "clbk", "out", "get", "i", "isTypedArrayConstructor", "args", "idx", "isTypedArray", "predicate", "fcn", "obuf", "v", "sbuf", "N", "j", "view", "arr", "main"] } diff --git a/lib/main.js b/lib/main.js index e70684d..9ca066b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -51,6 +51,8 @@ var fromIteratorMap = require( './from_iterator_map.js' ); // VARIABLES // var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport(); +var LITTLE_ENDIAN = 'little-endian'; +var BIG_ENDIAN = 'big-endian'; var DTYPES = [ 'float64', 'float32', 'int32', 'int16', 'uint32', 'uint16' ]; var DTYPE2SET = { 'float64': 'setFloat64', @@ -99,7 +101,18 @@ function byteOrder( value ) { * @returns {boolean} boolean indicating whether a byte order is little-endian byte order */ function isLittleEndian( value ) { - return ( value === 'little-endian' ); + return ( value === LITTLE_ENDIAN ); +} + +/** +* Resolves a byte order string from a boolean flag. +* +* @private +* @param {boolean} isLE - flag indicating whether an array is little-endian +* @returns {string} resolved byte order +*/ +function flag2byteOrder( isLE ) { + return ( isLE ) ? LITTLE_ENDIAN : BIG_ENDIAN; } /** @@ -634,6 +647,41 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli return this._length; }); + /** + * Returns a new array with each element being the result of a provided callback function. + * + * @private + * @name map + * @memberof TypedArray.prototype + * @type {Function} + * @param {Function} fcn - function to invoke + * @param {*} [thisArg] - function invocation context + * @throws {TypeError} `this` must be a typed array instance + * @throws {TypeError} first argument must be a function + * @returns {TypedArray} new typed array + */ + setReadOnly( TypedArray.prototype, 'map', function map( fcn, thisArg ) { + var obuf; + var out; + var buf; + var i; + var v; + if ( !isTypedArray( this ) ) { + throw new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) ); + } + if ( !isFunction( fcn ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) ); + } + buf = this._buffer; + out = new this.constructor( flag2byteOrder( this._isLE ), this._length ); + obuf = out._buffer; // eslint-disable-line no-underscore-dangle + for ( i = 0; i < this._length; i++ ) { + v = fcn.call( thisArg, buf[ GETTER ]( i * BYTES_PER_ELEMENT, this._isLE ), i, this ); + obuf[ SETTER ]( i * BYTES_PER_ELEMENT, v, this._isLE ); + } + return out; + }); + /** * Sets an array element. * diff --git a/package.json b/package.json index 916e68e..a542a7e 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "@stdlib/math-base-assert-is-nan": "^0.2.2", "@stdlib/math-base-special-pow": "^0.3.0", "@stdlib/random-array-randu": "^0.2.1", + "@stdlib/utils-identity-function": "^0.2.2", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", "tap-min": "git+https://github.com/Planeshifter/tap-min.git", diff --git a/test/test.map.js b/test/test.map.js new file mode 100644 index 0000000..a4bb69c --- /dev/null +++ b/test/test.map.js @@ -0,0 +1,177 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var hasOwnProp = require( '@stdlib/assert-has-own-property' ); +var isFunction = require( '@stdlib/assert-is-function' ); +var identity = require( '@stdlib/utils-identity-function' ); +var factory = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a function', function test( t ) { + var ctor = factory( 'float64' ); + t.strictEqual( isFunction( ctor ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'attached to the prototype of the returned function is a `map` method', function test( t ) { + var ctor = factory( 'float64' ); + t.strictEqual( hasOwnProp( ctor.prototype, 'map' ), true, 'returns expected value' ); + t.strictEqual( isFunction( ctor.prototype.map ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the method throws an error if invoked with a `this` context which is not a typed array instance', function test( t ) { + var values; + var ctor; + var arr; + var i; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + {}, + [], + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + return arr.map.call( value, identity ); + }; + } +}); + +tape( 'the method throws an error if provided a first argument which is not a function', function test( t ) { + var values; + var ctor; + var arr; + var i; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] ); + + values = [ + '5', + 3.14, + NaN, + true, + false, + null, + void 0, + {}, + [] + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + return arr.map( value ); + }; + } +}); + +tape( 'the method returns an empty array if operating on an empty array', function test( t ) { + var ctor; + var arr; + var out; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian' ); + out = arr.map( identity ); + + t.strictEqual( out instanceof ctor, true, 'returns expected value' ); + t.strictEqual( out.length, 0, 'returns expected value' ); + t.notEqual( out, arr, 'returns a new instance' ); + t.end(); +}); + +tape( 'the method returns a new typed array containing elements which are the result of a provided callback function', function test( t ) { + var expected; + var actual; + var ctor; + var arr; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new ctor( 'little-endian', [ 2.0, 4.0, 6.0, 8.0 ] ); + actual = arr.map( scale ); + + t.strictEqual( actual instanceof ctor, true, 'returns expected value' ); + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + t.notEqual( actual, arr, 'returns a new instance' ); + t.end(); + + function scale( v ) { + return v * 2.0; + } +}); + +tape( 'the method supports providing an execution context', function test( t ) { + var expected; + var actual; + var ctor; + var arr; + var ctx; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] ); + expected = new ctor( 'little-endian', [ -1.0, -2.0, -3.0, -4.0 ] ); + + ctx = { + 'count': 0 + }; + actual = arr.map( fcn, ctx ); + + t.strictEqual( actual instanceof ctor, true, 'returns expected value' ); + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + t.strictEqual( ctx.count, 6, 'returns expected value' ); + t.end(); + + function fcn( v, i ) { + this.count += i; // eslint-disable-line no-invalid-this + return -v; + } +});