From 68e112f77dc26152e1782226607b0527355f9588 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 19 Jun 2024 07:41:47 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 1 + dist/index.js | 2 +- dist/index.js.map | 4 ++-- lib/set_elements.js | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dded66..5c9b27b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@
+- [`b981bc3`](https://github.com/stdlib-js/stdlib/commit/b981bc30e83a7f88cdc2c0efca082fb31f9e1ac0) - **refactor:** avoid repeated property access _(by Athan Reines)_ - [`550285b`](https://github.com/stdlib-js/stdlib/commit/550285bf4a57dd3dabc8ed3998e7b612515fe082) - **feat:** add support for boolean and mask array assignment _(by Athan Reines)_ - [`074cbef`](https://github.com/stdlib-js/stdlib/commit/074cbef3f9d616c37c2be856a949e257481ff2fc) - **docs:** add note concerning broadcasting of nested array elements _(by Athan Reines)_ - [`b079d65`](https://github.com/stdlib-js/stdlib/commit/b079d653226019925581555fdaf9aa927ec69c0e) - **feat:** add support for integer array indexing assignment _(by Athan Reines)_ diff --git a/dist/index.js b/dist/index.js index 3804fa4..e02bafd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41,7 +41,7 @@ var Fe=require('@stdlib/array-base-fancy-slice/dist'),Le=p(),Me=E();function je( });var cr=u(function(oa,or){ var ze=require('@stdlib/assert-is-string/dist').isPrimitive,We=require('@stdlib/assert-has-property/dist'),Qe=g(),Xe=m(),Ye=$(),$e=K(),He=rr(),Je=ur();function Ke(r){return i;function i(a,e,n){return Qe(e)?$e(a,e,r):We(a,e)||!ze(e)?He(a,e,n,r):Xe(e)?Ye(a,e,r):Je(a,e,r)}}or.exports=Ke });var pr=u(function(ca,fr){ -var Ze=require('@stdlib/array-base-assert-is-mostly-safe-data-type-cast/dist'),rt=require('@stdlib/assert-is-collection/dist'),et=require('@stdlib/array-from-scalar/dist'),tt=require('@stdlib/array-dtype/dist'),at=require('@stdlib/array-put/dist'),vr=require('@stdlib/array-base-where/dist').assign,lr=require('@stdlib/error-tools-fmtprodmsg/dist'),it=h(),nt=p();function st(r,i,a,e){var n,s,t,o;if(n=it(i,e.cache),rt(a))o=a,t=tt(a)||"generic";else{if(s=e.validator(a,e.dtype),s)throw s;e.preSetElement?o=e.preSetElement(a):o=a,o=et(o,e.dtype),t=e.dtype}if(n.type==="int"){try{at(r,n.data,o)}catch(v){throw new v.constructor(nt(v.message))}return!0}if(!Ze(t,e.dtype))throw new TypeError(lr('1rXEw',t,e.dtype));if(n.type==="bool")return vr(n.data,o,r,r,1,0),!0;if(n.type==="mask")return vr(n.data,r,o,r,1,0),!0;throw new Error(lr('1rXFZ',n.type))}fr.exports=st +var Ze=require('@stdlib/array-base-assert-is-mostly-safe-data-type-cast/dist'),rt=require('@stdlib/assert-is-collection/dist'),et=require('@stdlib/array-from-scalar/dist'),tt=require('@stdlib/array-dtype/dist'),at=require('@stdlib/array-put/dist'),vr=require('@stdlib/array-base-where/dist').assign,lr=require('@stdlib/error-tools-fmtprodmsg/dist'),it=h(),nt=p();function st(r,i,a,e){var n,s,t,o;if(n=it(i,e.cache),rt(a))o=a,t=tt(a)||"generic";else{if(t=e.dtype,s=e.validator(a,t),s)throw s;e.preSetElement?o=e.preSetElement(a):o=a,o=et(o,t)}if(n.type==="int"){try{at(r,n.data,o)}catch(v){throw new v.constructor(nt(v.message))}return!0}if(!Ze(t,e.dtype))throw new TypeError(lr('1rXEw',t,e.dtype));if(n.type==="bool")return vr(n.data,o,r,r,1,0),!0;if(n.type==="mask")return vr(n.data,r,o,r,1,0),!0;throw new Error(lr('1rXFZ',n.type))}fr.exports=st });var dr=u(function(va,yr){ var ut=w();function ot(r,i,a,e){var n,s;if(n=e.validator(a,e.dtype),n)throw n;return e.preSetElement?s=e.preSetElement(a):s=a,e.setter(r,ut(i,r.length,e.strict),s),!0}yr.exports=ot });var gr=u(function(la,qr){ diff --git a/dist/index.js.map b/dist/index.js.map index d457f27..e0bd031 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/set_element_wrapper.js", "../lib/get_array_wrapper.js", "../lib/has_proxy_support.js", "../lib/defaults.js", "../lib/validate.js", "../lib/validator.js", "../lib/ctor.js", "../lib/re_integer.js", "../lib/is_integer_string.js", "../lib/re_array_index.js", "../lib/is_array_index_string.js", "../lib/prop2array.js", "../lib/get_elements.js", "../lib/resolve_index.js", "../lib/get_element.js", "../lib/get_value.js", "../lib/error_message.js", "../lib/re_subseq.js", "../lib/prop2slice.js", "../lib/get_slice.js", "../lib/get.js", "../lib/set_elements.js", "../lib/set_element.js", "../lib/set_value.js", "../lib/set_slice.js", "../lib/set.js", "../lib/factory.js", "../lib/main.js", "../lib/index.js"], - "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// MODULES //\n\nvar isComplexDataType = require( '@stdlib/array-base-assert-is-complex-floating-point-data-type' );\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\n\n\n// FUNCTIONS //\n\n/**\n* Normalizes values assigned to complex number arrays.\n*\n* @private\n* @param {*} value - input value\n* @returns {(ComplexLike|*)} output value\n*/\nfunction wrapComplex( value ) {\n\t// Wrap real-valued scalars as valid input arguments to complex number arrays...\n\tif ( isNumber( value ) ) {\n\t\treturn [ value, 0.0 ]; // note: we're assuming that a ComplexXXArray setter accepts an array of interleaved real and imaginary components\n\t}\n\t// For everything other than a real-valued scalar, we delegate validation to the target complex number array:\n\treturn value;\n}\n\n\n// MAIN //\n\n/**\n* Returns a wrapper function for processing scalar input values before assignment.\n*\n* @private\n* @param {string} dtype - array data type\n* @returns {(Function|null)} wrapper function or null\n*/\nfunction wrapper( dtype ) {\n\tif ( isComplexDataType( dtype ) ) {\n\t\treturn wrapComplex;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\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 a wrapper function for processing arrays after retrieval.\n*\n* @private\n* @param {Function} array2fancy - function for creating a proxied array\n* @param {Object} opts - options\n* @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking\n* @param {Function} opts.cache - cache for resolving array index objects\n* @returns {Function} wrapper function\n*/\nfunction wrapper( array2fancy, opts ) {\n\treturn wrap;\n\n\t/**\n\t* Returns a proxied array.\n\t*\n\t* @private\n\t* @param {Array} x - input array\n\t* @returns {Array} proxied array\n\t*/\n\tfunction wrap( x ) {\n\t\treturn array2fancy( x, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\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// MODULES //\n\nvar Proxy = require( '@stdlib/proxy-ctor' );\n\n\n// MAIN //\n\n/**\n* Boolean indicating if an environment has Proxy support.\n*\n* @private\n* @name hasSupport\n* @type {boolean}\n*/\nvar hasSupport = ( typeof Proxy === 'function' ); // NOTE: cannot use `@stdlib/assert/has-proxy-support` here, as that API uses code evaluation and might violate CSPs; consequently, this is a relatively weak check for proxy support\n\n\n// EXPORTS //\n\nmodule.exports = hasSupport;\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// MODULES //\n\nvar ArrayIndex = require( '@stdlib/array-index' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t'cache': ArrayIndex,\n\t\t'strict': false\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\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// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isMethodIn = require( '@stdlib/assert-is-method-in' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {boolean} [options.strict] - boolean indicating whether to enforce strict bounds checking\n* @param {Function} [options.cache] - cache for resolving array index objects\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'strict': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'strict' ) ) {\n\t\topts.strict = options.strict;\n\t\tif ( !isBoolean( opts.strict ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'strict', opts.strict ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'cache' ) ) {\n\t\topts.cache = options.cache;\n\t\tif ( !isMethodIn( opts.cache, 'get' ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option is missing a `%s` method. Option: `%s`.', 'cache', 'get', opts.cache ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 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// MODULES //\n\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isRealFloatingDataType = require( '@stdlib/array-base-assert-is-real-floating-point-data-type' );\nvar isUnsignedIntegerDataType = require( '@stdlib/array-base-assert-is-unsigned-integer-data-type' );\nvar isSignedIntegerDataType = require( '@stdlib/array-base-assert-is-signed-integer-data-type' );\nvar isBooleanDataType = require( '@stdlib/array-base-assert-is-boolean-data-type' );\nvar isSafeCast = require( '@stdlib/array-base-assert-is-safe-data-type-cast' );\nvar minDataType = require( '@stdlib/array-min-dtype' );\nvar minSignedIntegerDataType = require( '@stdlib/array-base-min-signed-integer-dtype' );\nvar complexDataType = require( '@stdlib/complex-dtype' );\nvar format = require( '@stdlib/string-format' );\n\n\n// FUNCTIONS //\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a \"generic\" or unknown data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {null} null\n*\n* @example\n* var err = validateGeneric( 3, 'generic' );\n* // returns null\n*/\nfunction validateGeneric() {\n\treturn null;\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a boolean data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateBoolean( true, 'bool' );\n* // returns null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateBoolean( new Complex128( 5.0, 6.0 ), 'bool' );\n* // returns \n*/\nfunction validateBoolean( value, dtype ) {\n\tif ( isBoolean( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a real-valued floating-point data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateRealFloating( 3.14, 'float64' );\n* // returns null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateRealFloating( new Complex128( 5.0, 6.0 ), 'float64' );\n* // returns \n*/\nfunction validateRealFloating( value, dtype ) {\n\tif ( isNumber( value ) ) {\n\t\treturn null;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a complex-valued floating-point data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateComplexFloating( new Complex128( 5.0, 6.0 ), 'complex128' );\n* // returns null\n*\n* @example\n* var err = validateComplexFloating( {}, 'complex128' );\n* // returns \n*/\nfunction validateComplexFloating( value, dtype ) {\n\tif ( isNumber( value ) || isComplexLike( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a signed integer data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateSignedInteger( 3, 'int32' );\n* // returns null\n*\n* @example\n* var err = validateSignedInteger( 3.14, 'int32' );\n* // returns \n*/\nfunction validateSignedInteger( value, dtype ) {\n\tvar vdt;\n\tif ( isNumber( value ) ) {\n\t\tif ( !isInteger( value ) ) {\n\t\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', minDataType( value ), dtype ) );\n\t\t}\n\t\tvdt = minSignedIntegerDataType( value );\n\t\tif ( isSafeCast( vdt, dtype ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, dtype ) );\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having an unsigned integer data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateUnsignedInteger( 3, 'uint32' );\n* // returns null\n*\n* @example\n* var err = validateUnsignedInteger( -3, 'uint32' );\n* // returns \n*/\nfunction validateUnsignedInteger( value, dtype ) {\n\tvar vdt;\n\tif ( isNumber( value ) ) {\n\t\tvdt = minDataType( value ); // note: we rely on data type resolution to handle the case where `value` is a non-integer value. In that case, `vdt` will resolve to a floating-point data type and `isSafeCast` will evaluate to `false`\n\t\tif ( isSafeCast( vdt, dtype ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, dtype ) );\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n\n// MAIN //\n\n/**\n* Returns a validation function for verifying whether a provided value can be safely assigned to an element in an array having a specified data type.\n*\n* @private\n* @param {string} dtype - array data type\n* @returns {Function} validation function\n*\n* @example\n* var fcn = validator( 'int32' );\n*\n* var err = fcn( 3, 'int32' );\n* // returns null\n*\n* err = fcn( 3.14, 'int32' );\n* // returns \n*/\nfunction validator( dtype ) {\n\tif ( dtype === 'generic' || dtype === '' ) {\n\t\treturn validateGeneric;\n\t}\n\tif ( isRealFloatingDataType( dtype ) ) {\n\t\treturn validateRealFloating;\n\t}\n\tif ( isUnsignedIntegerDataType( dtype ) ) {\n\t\treturn validateUnsignedInteger;\n\t}\n\tif ( isSignedIntegerDataType( dtype ) ) {\n\t\treturn validateSignedInteger;\n\t}\n\tif ( isBooleanDataType( dtype ) ) {\n\t\treturn validateBoolean;\n\t}\n\t// Case: isComplexDataType( dtype ) === true\n\treturn validateComplexFloating;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validator;\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 a trap for constructing new array instances.\n*\n* @private\n* @param {Function} array2fancy - function for creating a proxied array\n* @param {Object} opts - options\n* @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking\n* @returns {Function} handler\n*/\nfunction factory( array2fancy, opts ) {\n\treturn constructor;\n\n\t/**\n\t* Trap for constructing new array instances.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {Array} args - list of constructor arguments\n\t* @param {Object} newTarget - constructor that was originally called\n\t* @returns {*} new instance\n\t*/\n\tfunction constructor( target, args ) {\n\t\tvar x;\n\t\tvar a;\n\n\t\ta = args;\n\t\tswitch ( a.length ) {\n\t\tcase 0:\n\t\t\tx = new target();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tx = new target( a[0] );\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tx = new target( a[0], a[1] );\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tx = new target( a[0], a[1], a[2] );\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tx = new target( a[0], a[1], a[2], a[3] );\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4] );\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5] );\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6] );\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7] );\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8] ); // eslint-disable-line max-len\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9] ); // eslint-disable-line max-len\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Fallback to using `apply`; however, some constructors may error if the constructor is not callable (i.e., if a constructor always requires `new`):\n\t\t\tx = target.apply( null, a );\n\t\t}\n\t\treturn array2fancy( x, opts );\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// MAIN //\n\n/**\n* Regular expression for testing whether a string is an integer string.\n*\n* @private\n* @name RE_INTEGER\n* @type {RegExp}\n*\n* @example\n* var bool = RE_INTEGER.test( '10' );\n* // returns true\n*\n* @example\n* var bool = RE_INTEGER.test( '-1' );\n* // returns true\n*\n* @example\n* var bool = RE_INTEGER.test( '0:10:2' );\n* // returns false\n*/\nvar RE_INTEGER = /^-?[0-9]+$/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_INTEGER;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar RE_INTEGER = require( './re_integer.js' );\n\n\n// MAIN //\n\n/**\n* Tests if an indexing expression is an integer.\n*\n* @private\n* @param {(string|symbol)} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isIntegerString( '1' );\n* // returns true\n*\n* @example\n* var out = isIntegerString( ':' );\n* // returns false\n*/\nfunction isIntegerString( prop ) {\n\treturn ( isString( prop ) && RE_INTEGER.test( prop ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isIntegerString;\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* Regular expression for testing whether a string is a serialized array index.\n*\n* @private\n* @name RE_ARRAY_INDEX\n* @type {RegExp}\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( 'ArrayIndex<0>' );\n* // returns true\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( '0' );\n* // returns false\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( 'Slice(0,10,2)' );\n* // returns false\n*/\nvar RE_ARRAY_INDEX = /\\s*ArrayIndex<[^>]+>\\s*/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_ARRAY_INDEX;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar RE_ARRAY_INDEX = require( './re_array_index.js' );\n\n\n// MAIN //\n\n/**\n* Tests if an indexing expression is a serialized array index.\n*\n* @private\n* @param {(string|symbol)} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isArrayIndexString( 'ArrayIndex<0>' );\n* // returns true\n*\n* @example\n* var out = isArrayIndexString( ':' );\n* // returns false\n*/\nfunction isArrayIndexString( prop ) {\n\treturn ( isString( prop ) && RE_ARRAY_INDEX.test( prop ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isArrayIndexString;\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// MODULES //\n\nvar trim = require( '@stdlib/string-base-trim' );\nvar format = require( '@stdlib/string-format' );\n\n\n// FUNCTIONS //\n\n/**\n* Extracts an array index identifier from an array index indexing expression.\n*\n* @private\n* @param {string} str - input string\n* @returns {string} identifier\n*\n* @example\n* var str = 'ArrayIndex<0>';\n*\n* var id = getIdentifier( str );\n* // returns '0'\n*/\nfunction getIdentifier( str ) {\n\treturn str.substring( 11, str.length-1 ); // ArrayIndex => XX\n}\n\n\n// MAIN //\n\n/**\n* Converts an indexing expression to an array index.\n*\n* @private\n* @param {string} property - property name\n* @param {Object} cache - cache for resolving array index objects\n* @throws {Error} invalid array index\n* @returns {(Object|null)} index object (or null)\n*/\nfunction prop2array( property, cache ) {\n\tvar o = cache.get( getIdentifier( trim( property ) ) );\n\tif ( o === null ) {\n\t\tthrow new Error( format( 'invalid operation. Unable to resolve array index. Value: `%s`.', property ) );\n\t}\n\treturn o;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prop2array;\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// MODULES //\n\nvar take = require( '@stdlib/array-take' );\nvar mskfilter = require( '@stdlib/array-mskfilter' );\nvar mskreject = require( '@stdlib/array-mskreject' );\nvar format = require( '@stdlib/string-format' );\nvar prop2array = require( './prop2array.js' );\n\n\n// MAIN //\n\n/**\n* Returns the elements specified by an array index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {Object} ctx - context object\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @throws {Error} invalid array index\n* @throws {RangeError} index exceeds array bounds\n* @returns {Collection} result\n*/\nfunction getElements( target, property, ctx ) {\n\tvar idx = prop2array( property, ctx.cache );\n\tif ( idx.type === 'int' ) {\n\t\treturn ctx.postGetArray( take( target, idx.data ) );\n\t}\n\tif ( idx.type === 'bool' ) {\n\t\treturn ctx.postGetArray( mskfilter( target, idx.data ) );\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\treturn ctx.postGetArray( mskreject( target, idx.data ) );\n\t}\n\tthrow new Error( format( 'invalid operation. Unrecognized array index type. Value: `%s`.', idx.type ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getElements;\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// MODULES //\n\nvar normalizeIndex = require( '@stdlib/ndarray-base-normalize-index' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Resolves an integer index from an integer string.\n*\n* @private\n* @param {string} str - integer string\n* @param {NonNegativeInteger} max - index upper bound (exclusive)\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {RangeError} index exceeds array bounds\n* @returns {integer} integer index\n*\n* @example\n* var idx = resolveIndex( '-1', 10, false );\n* // returns 9\n*\n* @example\n* var idx = resolveIndex( '-20', 10, false );\n* // returns -20\n*/\nfunction resolveIndex( str, max, strict ) {\n\tvar idx;\n\tvar i;\n\n\tidx = parseInt( str, 10 );\n\ti = normalizeIndex( idx, max-1 );\n\tif ( i === -1 ) {\n\t\tif ( strict ) {\n\t\t\tthrow new RangeError( format( 'invalid operation. Index exceeds array bounds.' ) );\n\t\t}\n\t\t// Return the non-normalized index, as this should fallback to default property handling and returning \"undefined\":\n\t\treturn idx;\n\t}\n\treturn i;\n}\n\n\n// EXPORTS //\n\nmodule.exports = resolveIndex;\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// MODULES //\n\nvar resolveIndex = require( './resolve_index.js' );\n\n\n// MAIN //\n\n/**\n* Returns the element associated with a specified index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {Object} ctx - context object\n* @param {Function} ctx.getter - accessor for retrieving array elements\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @returns {*} result\n*/\nfunction getElement( target, property, ctx ) {\n\treturn ctx.getter( target, resolveIndex( property, target.length, ctx.strict ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = getElement;\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// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\n\n\n// MAIN //\n\n/**\n* Returns the property value associated with a specified property.\n*\n* @private\n* @param {Object} target - target object\n* @param {(string|symbol)} property - property\n* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n* @param {Object} ctx - context object\n* @param {Function} ctx.ctor - proxied array constructor\n* @returns {*} result\n*/\nfunction getValue( target, property, receiver, ctx ) {\n\tvar value = target[ property ];\n\tif ( isFunction( value ) ) {\n\t\tif ( value === target.constructor ) {\n\t\t\treturn ctx.ctor;\n\t\t}\n\t\treturn wrapper;\n\t}\n\treturn value;\n\n\t/**\n\t* Method wrapper.\n\t*\n\t* @private\n\t* @returns {*} results\n\t*/\n\tfunction wrapper() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn value.apply( ( this === receiver ) ? target : this, args ); // eslint-disable-line no-invalid-this\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = getValue;\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// MODULES //\n\nvar replace = require( '@stdlib/string-base-replace' );\n\n\n// MAIN //\n\n/**\n* Returns an updated error message for trapped errors.\n*\n* @private\n* @param {string} msg - error message\n* @returns {string} updated message\n*/\nfunction errMessage( msg ) {\n\treturn replace( msg, /^invalid arguments?/, 'invalid operation' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = errMessage;\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* Regular expression for testing whether a string is a subsequence string.\n*\n* @private\n* @name RE_SUBSEQ\n* @type {RegExp}\n*\n* @example\n* var bool = RE_SUBSEQ.test( '0:10:2' );\n* // returns true\n*\n* @example\n* var bool = RE_SUBSEQ.test( '0' );\n* // returns false\n*\n* @example\n* var bool = RE_SUBSEQ.test( 'Slice(0,10,2)' );\n* // returns false\n*/\nvar RE_SUBSEQ = /:/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_SUBSEQ;\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// MODULES //\n\nvar trim = require( '@stdlib/string-base-trim' );\nvar seq2slice = require( '@stdlib/slice-base-seq2slice' );\nvar str2slice = require( '@stdlib/slice-base-str2slice' );\nvar startsWith = require( '@stdlib/string-base-starts-with' );\nvar format = require( '@stdlib/string-format' );\nvar RE_SUBSEQ = require( './re_subseq.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Tests if an indexing expression is a serialized Slice object.\n*\n* @private\n* @param {string} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isSlice( 'Slice(null,null,1)' );\n* // returns true\n*\n* @example\n* var out = isSlice( ':' );\n* // returns false\n*/\nfunction isSlice( prop ) {\n\treturn (\n\t\tprop[ 0 ] === 'S' &&\n\t\tstartsWith( prop, 'Slice(', 0 ) &&\n\t\tprop[ prop.length-1 ] === ')'\n\t);\n}\n\n/**\n* Tests if an indexing expression is a subsequence.\n*\n* @private\n* @param {string} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isSubsequence( '::-2' );\n* // returns true\n*\n* @example\n* var out = isSubsequence( '-2' );\n* // returns false\n*/\nfunction isSubsequence( prop ) {\n\t// TODO: consider whether to make this check more robust (e.g., should we actually throw if someone tries to access `foo:bar`? If we make this check more exact, how would we distinguish between a non-existent `foo:bar` property and an actual error in the subsequence string?)\n\treturn RE_SUBSEQ.test( prop );\n}\n\n/**\n* Parses a serialized Slice object.\n*\n* @private\n* @param {string} raw - original unprocessed input string\n* @param {string} str - serialized Slice object\n* @throws {Error} invalid slice operation\n* @returns {Slice} Slice object\n*\n* @example\n* var s = parseSlice( ' Slice(null,null,1) ', 'Slice(null,null,1)' );\n* // returns \n*/\nfunction parseSlice( raw, str ) {\n\tvar s = str2slice( str );\n\tif ( s === null ) {\n\t\tthrow new Error( format( 'invalid operation. Unsupported slice operation. Value: `%s`.', raw ) );\n\t}\n\treturn s;\n}\n\n/**\n* Parses a subsequence string.\n*\n* @private\n* @param {string} raw - original unprocessed input string\n* @param {string} str - subsequence string\n* @param {NonNegativeInteger} max - index upper bound\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {Slice} Slice object\n*\n* @example\n* var s = parseSubsequence( ' ::-2 ', '::-2', 10, false );\n* // returns \n*/\nfunction parseSubsequence( raw, str, max, strict ) {\n\tvar s = seq2slice( str, max, true );\n\tif ( s.code ) {\n\t\tif ( s.code === 'ERR_SLICE_INVALID_INCREMENT' ) {\n\t\t\tthrow new Error( format( 'invalid operation. A subsequence increment must be a non-zero integer. Value: `%s`.', raw ) );\n\t\t}\n\t\tif ( s.code === 'ERR_SLICE_INVALID_SUBSEQUENCE' ) {\n\t\t\tthrow new Error( format( 'invalid operation. Unsupported slice operation. Value: `%s`.', raw ) );\n\t\t}\n\t\t// NOTE: the following error check must come last due to fall-through when in non-strict mode...\n\t\tif ( s.code === 'ERR_SLICE_OUT_OF_BOUNDS' ) {\n\t\t\tif ( strict ) {\n\t\t\t\tthrow new RangeError( format( 'invalid operation. Slice exceeds array bounds.' ) );\n\t\t\t}\n\t\t\t// Repeat parsing, this time allowing for out-of-bounds slices:\n\t\t\ts = seq2slice( str, max, false );\n\t\t}\n\t}\n\treturn s;\n}\n\n\n// MAIN //\n\n/**\n* Converts an indexing expression to a Slice object.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property name\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {(Slice|null)} slice object (or null)\n*/\nfunction prop2slice( target, property, strict ) {\n\tvar prop = trim( property );\n\tif ( isSlice( prop ) ) {\n\t\treturn parseSlice( property, prop );\n\t}\n\tif ( isSubsequence( prop ) ) {\n\t\treturn parseSubsequence( property, prop, target.length, strict );\n\t}\n\t// Everything else (including undefined/non-existent properties):\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prop2slice;\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// MODULES //\n\nvar slice = require( '@stdlib/array-base-fancy-slice' );\nvar errMessage = require( './error_message.js' );\nvar prop2slice = require( './prop2slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a copy.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property name\n* @param {Object} ctx - context object\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {(Collection|void)} result\n*/\nfunction getSlice( target, property, ctx ) {\n\tvar s = prop2slice( target, property, ctx.strict );\n\tif ( s === null ) {\n\t\t// Ensure consistency with normal array behavior by returning `undefined` for any \"unrecognized\" property name:\n\t\treturn;\n\t}\n\ttry {\n\t\treturn ctx.postGetArray( slice( target, s, ctx.strict ) );\n\t} catch ( err ) {\n\t\t// In principle, we should only error when in \"strict\" mode and a slice exceeds array bounds...\n\t\tthrow new err.constructor( errMessage( err.message ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = getSlice;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar hasProperty = require( '@stdlib/assert-has-property' );\nvar isIntegerString = require( './is_integer_string.js' );\nvar isArrayIndexString = require( './is_array_index_string.js' );\nvar getElements = require( './get_elements.js' );\nvar getElement = require( './get_element.js' );\nvar getValue = require( './get_value.js' );\nvar getSlice = require( './get_slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a trap for retrieving property values.\n*\n* @private\n* @param {Object} ctx - context object\n* @param {Function} ctx.getter - accessor for retrieving array elements\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.ctor - proxied array constructor\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @returns {Function} handler\n*/\nfunction factory( ctx ) {\n\treturn get;\n\n\t/**\n\t* Trap for retrieving property values.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {(string|symbol)} property - property name\n\t* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n\t* @throws {Error} invalid slice operation\n\t* @throws {RangeError} slice exceeds array bounds\n\t* @throws {RangeError} index exceeds array bounds\n\t* @returns {*} result\n\t*/\n\tfunction get( target, property, receiver ) {\n\t\tif ( isIntegerString( property ) ) {\n\t\t\treturn getElement( target, property, ctx );\n\t\t}\n\t\tif ( hasProperty( target, property ) || !isString( property ) ) {\n\t\t\treturn getValue( target, property, receiver, ctx );\n\t\t}\n\t\tif ( isArrayIndexString( property ) ) {\n\t\t\treturn getElements( target, property, ctx );\n\t\t}\n\t\treturn getSlice( target, property, ctx );\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// MODULES //\n\nvar isMostlySafeCast = require( '@stdlib/array-base-assert-is-mostly-safe-data-type-cast' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar scalar2array = require( '@stdlib/array-from-scalar' );\nvar dtype = require( '@stdlib/array-dtype' );\nvar put = require( '@stdlib/array-put' );\nvar where = require( '@stdlib/array-base-where' ).assign;\nvar format = require( '@stdlib/string-format' );\nvar prop2array = require( './prop2array.js' );\nvar errMessage = require( './error_message.js' );\n\n\n// MAIN //\n\n/**\n* Replaces the elements specified by an array index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {*} value - new value(s)\n* @param {Object} ctx - context object\n* @param {string} ctx.dtype - array data type\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @param {Function} ctx.validator - function for validating new values\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @throws {Error} invalid array index\n* @throws {RangeError} index exceeds array bounds\n* @throws {Error} assigned value must be broadcast compatible with target array selection\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setElements( target, property, value, ctx ) {\n\tvar idx;\n\tvar err;\n\tvar dt;\n\tvar v;\n\n\tidx = prop2array( property, ctx.cache );\n\tif ( isCollection( value ) ) {\n\t\t// When handling collections, we delegate to implementation APIs (see below) to perform argument validation (e.g., ensuring a (mostly) safe cast, broadcast compatibility, etc), so we just reassign the value here:\n\t\tv = value;\n\t\tdt = dtype( value ) || 'generic';\n\t} else {\n\t\t// When provided a \"scalar\", we need to check whether the value can be safely cast to the target array data type:\n\t\terr = ctx.validator( value, ctx.dtype );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( ctx.preSetElement ) {\n\t\t\tv = ctx.preSetElement( value );\n\t\t} else {\n\t\t\tv = value;\n\t\t}\n\t\t// As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during assignment:\n\t\tv = scalar2array( v, ctx.dtype );\n\t\tdt = ctx.dtype;\n\t}\n\tif ( idx.type === 'int' ) {\n\t\ttry {\n\t\t\tput( target, idx.data, v ); // note: defer to `put` for ensuring a mostly safe cast\n\t\t} catch ( err ) {\n\t\t\tthrow new err.constructor( errMessage( err.message ) );\n\t\t}\n\t\treturn true;\n\t}\n\t// Safe casts are always allowed and allow same kind casts (i.e., downcasts) only when the target array data type is floating-point...\n\tif ( !isMostlySafeCast( dt, ctx.dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', dt, ctx.dtype ) );\n\t}\n\tif ( idx.type === 'bool' ) {\n\t\twhere( idx.data, v, target, target, 1, 0 );\n\t\treturn true;\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\twhere( idx.data, target, v, target, 1, 0 );\n\t\treturn true;\n\t}\n\tthrow new Error( format( 'invalid operation. Unrecognized array index type. Value: `%s`.', idx.type ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = setElements;\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// MODULES //\n\nvar resolveIndex = require( './resolve_index.js' );\n\n\n// MAIN //\n\n/**\n* Sets the element associated with a specified index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {*} value - new value\n* @param {Object} ctx - context object\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {string} ctx.dtype - target array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setElement( target, property, value, ctx ) {\n\tvar err;\n\tvar v;\n\n\terr = ctx.validator( value, ctx.dtype );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( ctx.preSetElement ) {\n\t\tv = ctx.preSetElement( value );\n\t} else {\n\t\tv = value;\n\t}\n\tctx.setter( target, resolveIndex( property, target.length, ctx.strict ), v ); // eslint-disable-line max-len\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setElement;\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* Sets the value associated with a specified property.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property\n* @param {*} value - new value\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setValue( target, property, value ) {\n\ttarget[ property ] = value;\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setValue;\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// MODULES //\n\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar sliceAssign = require( '@stdlib/array-base-fancy-slice-assign' );\nvar scalar2array = require( '@stdlib/array-from-scalar' );\nvar prop2slice = require( './prop2slice.js' );\nvar errMessage = require( './error_message.js' );\n\n\n// MAIN //\n\n/**\n* Sets element values belonging to the array view specified by an indexing expression.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - indexing expression\n* @param {*} value - new value\n* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n* @param {Object} ctx - context object\n* @param {string} ctx.dtype - array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @throws {Error} assigned value must be broadcast compatible with target array view\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setSlice( target, property, value, receiver, ctx ) {\n\tvar err;\n\tvar s;\n\tvar v;\n\n\ts = prop2slice( target, property, ctx.strict );\n\tif ( s === null ) {\n\t\t// If unable to parse the property as an indexing expression, signal that we were unable to perform slice assignment:\n\t\treturn false;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// When handling collections, we delegate to `sliceAssign` (see below) to perform argument validation (e.g., ensuring a (mostly) safe cast, broadcast compatibility, etc), so we just reassign the value here:\n\t\tv = value;\n\t} else {\n\t\t// When provided a \"scalar\", we need to check whether the value can be safely cast to the target array data type:\n\t\terr = ctx.validator( value, ctx.dtype );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\t// As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during slice assignment:\n\t\tv = scalar2array( value, ctx.dtype );\n\t}\n\ttry {\n\t\tsliceAssign( v, receiver, s, ctx.strict );\n\t} catch ( err ) {\n\t\tthrow new err.constructor( errMessage( err.message ) );\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setSlice;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar hasProperty = require( '@stdlib/assert-has-property' );\nvar isIntegerString = require( './is_integer_string.js' );\nvar isArrayIndexString = require( './is_array_index_string.js' );\nvar setElements = require( './set_elements.js' );\nvar setElement = require( './set_element.js' );\nvar setValue = require( './set_value.js' );\nvar setSlice = require( './set_slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a trap for setting property values.\n*\n* @private\n* @param {Object} ctx - context object\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {string} ctx.dtype - array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @returns {Function} handler\n*/\nfunction factory( ctx ) {\n\treturn set;\n\n\t/**\n\t* Trap for setting property values.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {(string|symbol)} property - property name\n\t* @param {*} value - new value\n\t* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n\t* @throws {Error} invalid slice operation\n\t* @throws {Error} assigned value must be broadcast compatible with output array view\n\t* @throws {TypeError} assigned value cannot be safely cast to the output array data type\n\t* @throws {TypeError} slice exceeds array bounds\n\t* @throws {TypeError} index exceeds array bounds\n\t* @returns {boolean} boolean indicating whether assignment succeeded\n\t*/\n\tfunction set( target, property, value, receiver ) {\n\t\tvar out;\n\n\t\t// Note that we need to check for an integer string *before* checking for an own property, as we want to explicitly handle *all* indexed properties, not just negative integers, in order to perform assignment validation...\n\t\tif ( isIntegerString( property ) ) {\n\t\t\treturn setElement( target, property, value, ctx );\n\t\t}\n\t\tif ( hasProperty( property ) || !isString( property ) ) {\n\t\t\treturn setValue( target, property, value, ctx );\n\t\t}\n\t\tif ( isArrayIndexString( property ) ) {\n\t\t\treturn setElements( target, property, value, ctx );\n\t\t}\n\t\tout = setSlice( target, property, value, receiver, ctx );\n\t\tif ( out ) {\n\t\t\treturn out;\n\t\t}\n\t\t// If we were unsuccessful (e.g., due to an invalid subsequence, etc), set the \"property\" in the same way as would any normal property (e.g., if an indexing expression is an invalid subsequence, assign as would a regular property: `i = 'a:b:c'` => `x[i] = 1` => `v = x[i]` => `v === 1`):\n\t\treturn setValue( target, property, value, ctx );\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// MODULES //\n\nvar isArrayLike = require( '@stdlib/assert-is-array-like' );\nvar Proxy = require( '@stdlib/proxy-ctor' );\nvar arraylike2object = require( '@stdlib/array-base-arraylike2object' );\nvar assign = require( '@stdlib/object-assign' );\nvar format = require( '@stdlib/string-format' );\nvar setElementWrapper = require( './set_element_wrapper.js' );\nvar getArrayWrapper = require( './get_array_wrapper.js' );\nvar hasProxySupport = require( './has_proxy_support.js' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar validator = require( './validator.js' );\nvar ctor = require( './ctor.js' );\nvar get = require( './get.js' );\nvar set = require( './set.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for converting an array to an object supporting fancy indexing.\n*\n* @param {Options} options - function options\n* @param {boolean} [options.strict=false] - boolean indicating whether to enforce strict bounds checking by default\n* @param {Function} [options.cache] - default cache for resolving array index objects\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function for converting an array to an object supporting fancy indexing\n*\n* @example\n* var array2fancy = factory();\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\nfunction factory() {\n\tvar OPTIONS;\n\tvar err;\n\n\tOPTIONS = defaults();\n\tif ( arguments.length ) {\n\t\terr = validate( OPTIONS, arguments[ 0 ] );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\treturn array2fancy;\n\n\t/**\n\t* Converts an array to an object supporting fancy indexing.\n\t*\n\t* @private\n\t* @param {ArrayLike} x - input array\n\t* @param {Options} [options] - function options\n\t* @param {boolean} [options.strict] - boolean indicating whether to enforce strict bounds checking\n\t* @param {Function} [options.cache] - cache for resolving array index objects\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} fancy array\n\t*\n\t* @example\n\t* var x = [ 1, 2, 3, 4, 5, 6 ];\n\t*\n\t* var y = array2fancy( x );\n\t* // returns \n\t*\n\t* var z = y[ '1::2' ];\n\t* // returns [ 2, 4, 6 ]\n\t*\n\t* var len = z.length;\n\t* // returns 3\n\t*\n\t* var v = z[ 0 ];\n\t* // returns 2\n\t*\n\t* v = z[ 1 ];\n\t* // returns 4\n\t*\n\t* v = z[ 2 ];\n\t* // returns 6\n\t*/\n\tfunction array2fancy( x ) {\n\t\tvar opts;\n\t\tvar err;\n\t\tvar arr;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isArrayLike( x ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( hasProxySupport ) {\n\t\t\topts = assign( {}, OPTIONS );\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\terr = validate( opts, arguments[ 1 ] );\n\t\t\t\tif ( err ) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr = arraylike2object( x );\n\t\t\tdt = arr.dtype || '';\n\t\t\to = {\n\t\t\t\t'ref': x,\n\t\t\t\t'dtype': dt,\n\t\t\t\t'getter': arr.accessors[ 0 ],\n\t\t\t\t'setter': arr.accessors[ 1 ],\n\t\t\t\t'preSetElement': setElementWrapper( dt ),\n\t\t\t\t'postGetArray': getArrayWrapper( array2fancy, opts ),\n\t\t\t\t'cache': opts.cache,\n\t\t\t\t'strict': opts.strict,\n\t\t\t\t'validator': validator( dt ),\n\t\t\t\t'array2fancy': array2fancy,\n\t\t\t\t'ctor': new Proxy( x.constructor || Array, {\n\t\t\t\t\t'construct': ctor( array2fancy, opts )\n\t\t\t\t})\n\t\t\t};\n\t\t\treturn new Proxy( x, {\n\t\t\t\t'get': get( o ),\n\t\t\t\t'set': set( o )\n\t\t\t});\n\t\t}\n\t\t// TODO: replace with `@stdlib/console/warn` (or equivalent once available)\n\t\tconsole.warn( 'WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available.' ); // eslint-disable-line no-console\n\t\treturn x;\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// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Converts an array to an object supporting fancy indexing.\n*\n* @name array2fancy\n* @type {Function}\n* @param {ArrayLike} x - input array\n* @param {Options} [options] - function options\n* @param {boolean} [options.strict=false] - boolean indicating whether to enforce strict bounds checking\n* @param {Function} [options.cache] - cache for resolving array index objects\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} fancy array\n*\n* @example\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\nvar array2fancy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = array2fancy;\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* Convert an array to an object supporting fancy indexing.\n*\n* @module @stdlib/array-to-fancy\n*\n* @example\n* var array2fancy = require( '@stdlib/array-to-fancy' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar ArrayIndex = require( '@stdlib/array-index' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\nsetReadOnly( main, 'idx', ArrayIndex );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAoB,QAAS,+DAAgE,EAC7FC,GAAW,QAAS,0BAA2B,EAAE,YAYrD,SAASC,GAAaC,EAAQ,CAE7B,OAAKF,GAAUE,CAAM,EACb,CAAEA,EAAO,CAAI,EAGdA,CACR,CAYA,SAASC,GAASC,EAAQ,CACzB,OAAKL,GAAmBK,CAAM,EACtBH,GAED,IACR,CAKAH,EAAO,QAAUK,KChEjB,IA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sBA,IAAIC,GAAU,IAwCVC,GAAcD,GAAQ,EAK1BD,GAAO,QAAUE,KChBjB,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAa,QAAS,qBAAsB,EAC5CC,EAAO,KACPC,GAAU,IAKdH,GAAaE,EAAM,UAAWC,EAAQ,EACtCH,GAAaE,EAAM,MAAOD,EAAW,EAKrC,OAAO,QAAUC", + "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// MODULES //\n\nvar isComplexDataType = require( '@stdlib/array-base-assert-is-complex-floating-point-data-type' );\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\n\n\n// FUNCTIONS //\n\n/**\n* Normalizes values assigned to complex number arrays.\n*\n* @private\n* @param {*} value - input value\n* @returns {(ComplexLike|*)} output value\n*/\nfunction wrapComplex( value ) {\n\t// Wrap real-valued scalars as valid input arguments to complex number arrays...\n\tif ( isNumber( value ) ) {\n\t\treturn [ value, 0.0 ]; // note: we're assuming that a ComplexXXArray setter accepts an array of interleaved real and imaginary components\n\t}\n\t// For everything other than a real-valued scalar, we delegate validation to the target complex number array:\n\treturn value;\n}\n\n\n// MAIN //\n\n/**\n* Returns a wrapper function for processing scalar input values before assignment.\n*\n* @private\n* @param {string} dtype - array data type\n* @returns {(Function|null)} wrapper function or null\n*/\nfunction wrapper( dtype ) {\n\tif ( isComplexDataType( dtype ) ) {\n\t\treturn wrapComplex;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\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 a wrapper function for processing arrays after retrieval.\n*\n* @private\n* @param {Function} array2fancy - function for creating a proxied array\n* @param {Object} opts - options\n* @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking\n* @param {Function} opts.cache - cache for resolving array index objects\n* @returns {Function} wrapper function\n*/\nfunction wrapper( array2fancy, opts ) {\n\treturn wrap;\n\n\t/**\n\t* Returns a proxied array.\n\t*\n\t* @private\n\t* @param {Array} x - input array\n\t* @returns {Array} proxied array\n\t*/\n\tfunction wrap( x ) {\n\t\treturn array2fancy( x, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrapper;\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// MODULES //\n\nvar Proxy = require( '@stdlib/proxy-ctor' );\n\n\n// MAIN //\n\n/**\n* Boolean indicating if an environment has Proxy support.\n*\n* @private\n* @name hasSupport\n* @type {boolean}\n*/\nvar hasSupport = ( typeof Proxy === 'function' ); // NOTE: cannot use `@stdlib/assert/has-proxy-support` here, as that API uses code evaluation and might violate CSPs; consequently, this is a relatively weak check for proxy support\n\n\n// EXPORTS //\n\nmodule.exports = hasSupport;\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// MODULES //\n\nvar ArrayIndex = require( '@stdlib/array-index' );\n\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t'cache': ArrayIndex,\n\t\t'strict': false\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\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// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isMethodIn = require( '@stdlib/assert-is-method-in' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {boolean} [options.strict] - boolean indicating whether to enforce strict bounds checking\n* @param {Function} [options.cache] - cache for resolving array index objects\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'strict': false\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'strict' ) ) {\n\t\topts.strict = options.strict;\n\t\tif ( !isBoolean( opts.strict ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'strict', opts.strict ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'cache' ) ) {\n\t\topts.cache = options.cache;\n\t\tif ( !isMethodIn( opts.cache, 'get' ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option is missing a `%s` method. Option: `%s`.', 'cache', 'get', opts.cache ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 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// MODULES //\n\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isRealFloatingDataType = require( '@stdlib/array-base-assert-is-real-floating-point-data-type' );\nvar isUnsignedIntegerDataType = require( '@stdlib/array-base-assert-is-unsigned-integer-data-type' );\nvar isSignedIntegerDataType = require( '@stdlib/array-base-assert-is-signed-integer-data-type' );\nvar isBooleanDataType = require( '@stdlib/array-base-assert-is-boolean-data-type' );\nvar isSafeCast = require( '@stdlib/array-base-assert-is-safe-data-type-cast' );\nvar minDataType = require( '@stdlib/array-min-dtype' );\nvar minSignedIntegerDataType = require( '@stdlib/array-base-min-signed-integer-dtype' );\nvar complexDataType = require( '@stdlib/complex-dtype' );\nvar format = require( '@stdlib/string-format' );\n\n\n// FUNCTIONS //\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a \"generic\" or unknown data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {null} null\n*\n* @example\n* var err = validateGeneric( 3, 'generic' );\n* // returns null\n*/\nfunction validateGeneric() {\n\treturn null;\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a boolean data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateBoolean( true, 'bool' );\n* // returns null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateBoolean( new Complex128( 5.0, 6.0 ), 'bool' );\n* // returns \n*/\nfunction validateBoolean( value, dtype ) {\n\tif ( isBoolean( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a real-valued floating-point data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateRealFloating( 3.14, 'float64' );\n* // returns null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateRealFloating( new Complex128( 5.0, 6.0 ), 'float64' );\n* // returns \n*/\nfunction validateRealFloating( value, dtype ) {\n\tif ( isNumber( value ) ) {\n\t\treturn null;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a complex-valued floating-point data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var err = validateComplexFloating( new Complex128( 5.0, 6.0 ), 'complex128' );\n* // returns null\n*\n* @example\n* var err = validateComplexFloating( {}, 'complex128' );\n* // returns \n*/\nfunction validateComplexFloating( value, dtype ) {\n\tif ( isNumber( value ) || isComplexLike( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having a signed integer data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateSignedInteger( 3, 'int32' );\n* // returns null\n*\n* @example\n* var err = validateSignedInteger( 3.14, 'int32' );\n* // returns \n*/\nfunction validateSignedInteger( value, dtype ) {\n\tvar vdt;\n\tif ( isNumber( value ) ) {\n\t\tif ( !isInteger( value ) ) {\n\t\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', minDataType( value ), dtype ) );\n\t\t}\n\t\tvdt = minSignedIntegerDataType( value );\n\t\tif ( isSafeCast( vdt, dtype ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, dtype ) );\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n/**\n* Verifies whether a provided value can be safely assigned to an element in an array having an unsigned integer data type.\n*\n* @private\n* @param {*} value - input value\n* @param {string} dtype - array data type\n* @returns {(Error|null)} error object or null\n*\n* @example\n* var err = validateUnsignedInteger( 3, 'uint32' );\n* // returns null\n*\n* @example\n* var err = validateUnsignedInteger( -3, 'uint32' );\n* // returns \n*/\nfunction validateUnsignedInteger( value, dtype ) {\n\tvar vdt;\n\tif ( isNumber( value ) ) {\n\t\tvdt = minDataType( value ); // note: we rely on data type resolution to handle the case where `value` is a non-integer value. In that case, `vdt` will resolve to a floating-point data type and `isSafeCast` will evaluate to `false`\n\t\tif ( isSafeCast( vdt, dtype ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, dtype ) );\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', complexDataType( value ), dtype ) );\n\t}\n\treturn new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', typeof value, dtype ) );\n}\n\n\n// MAIN //\n\n/**\n* Returns a validation function for verifying whether a provided value can be safely assigned to an element in an array having a specified data type.\n*\n* @private\n* @param {string} dtype - array data type\n* @returns {Function} validation function\n*\n* @example\n* var fcn = validator( 'int32' );\n*\n* var err = fcn( 3, 'int32' );\n* // returns null\n*\n* err = fcn( 3.14, 'int32' );\n* // returns \n*/\nfunction validator( dtype ) {\n\tif ( dtype === 'generic' || dtype === '' ) {\n\t\treturn validateGeneric;\n\t}\n\tif ( isRealFloatingDataType( dtype ) ) {\n\t\treturn validateRealFloating;\n\t}\n\tif ( isUnsignedIntegerDataType( dtype ) ) {\n\t\treturn validateUnsignedInteger;\n\t}\n\tif ( isSignedIntegerDataType( dtype ) ) {\n\t\treturn validateSignedInteger;\n\t}\n\tif ( isBooleanDataType( dtype ) ) {\n\t\treturn validateBoolean;\n\t}\n\t// Case: isComplexDataType( dtype ) === true\n\treturn validateComplexFloating;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validator;\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 a trap for constructing new array instances.\n*\n* @private\n* @param {Function} array2fancy - function for creating a proxied array\n* @param {Object} opts - options\n* @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking\n* @returns {Function} handler\n*/\nfunction factory( array2fancy, opts ) {\n\treturn constructor;\n\n\t/**\n\t* Trap for constructing new array instances.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {Array} args - list of constructor arguments\n\t* @param {Object} newTarget - constructor that was originally called\n\t* @returns {*} new instance\n\t*/\n\tfunction constructor( target, args ) {\n\t\tvar x;\n\t\tvar a;\n\n\t\ta = args;\n\t\tswitch ( a.length ) {\n\t\tcase 0:\n\t\t\tx = new target();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tx = new target( a[0] );\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tx = new target( a[0], a[1] );\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tx = new target( a[0], a[1], a[2] );\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tx = new target( a[0], a[1], a[2], a[3] );\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4] );\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5] );\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6] );\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7] );\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8] ); // eslint-disable-line max-len\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tx = new target( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9] ); // eslint-disable-line max-len\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Fallback to using `apply`; however, some constructors may error if the constructor is not callable (i.e., if a constructor always requires `new`):\n\t\t\tx = target.apply( null, a );\n\t\t}\n\t\treturn array2fancy( x, opts );\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// MAIN //\n\n/**\n* Regular expression for testing whether a string is an integer string.\n*\n* @private\n* @name RE_INTEGER\n* @type {RegExp}\n*\n* @example\n* var bool = RE_INTEGER.test( '10' );\n* // returns true\n*\n* @example\n* var bool = RE_INTEGER.test( '-1' );\n* // returns true\n*\n* @example\n* var bool = RE_INTEGER.test( '0:10:2' );\n* // returns false\n*/\nvar RE_INTEGER = /^-?[0-9]+$/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_INTEGER;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar RE_INTEGER = require( './re_integer.js' );\n\n\n// MAIN //\n\n/**\n* Tests if an indexing expression is an integer.\n*\n* @private\n* @param {(string|symbol)} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isIntegerString( '1' );\n* // returns true\n*\n* @example\n* var out = isIntegerString( ':' );\n* // returns false\n*/\nfunction isIntegerString( prop ) {\n\treturn ( isString( prop ) && RE_INTEGER.test( prop ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isIntegerString;\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* Regular expression for testing whether a string is a serialized array index.\n*\n* @private\n* @name RE_ARRAY_INDEX\n* @type {RegExp}\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( 'ArrayIndex<0>' );\n* // returns true\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( '0' );\n* // returns false\n*\n* @example\n* var bool = RE_ARRAY_INDEX.test( 'Slice(0,10,2)' );\n* // returns false\n*/\nvar RE_ARRAY_INDEX = /\\s*ArrayIndex<[^>]+>\\s*/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_ARRAY_INDEX;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar RE_ARRAY_INDEX = require( './re_array_index.js' );\n\n\n// MAIN //\n\n/**\n* Tests if an indexing expression is a serialized array index.\n*\n* @private\n* @param {(string|symbol)} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isArrayIndexString( 'ArrayIndex<0>' );\n* // returns true\n*\n* @example\n* var out = isArrayIndexString( ':' );\n* // returns false\n*/\nfunction isArrayIndexString( prop ) {\n\treturn ( isString( prop ) && RE_ARRAY_INDEX.test( prop ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isArrayIndexString;\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// MODULES //\n\nvar trim = require( '@stdlib/string-base-trim' );\nvar format = require( '@stdlib/string-format' );\n\n\n// FUNCTIONS //\n\n/**\n* Extracts an array index identifier from an array index indexing expression.\n*\n* @private\n* @param {string} str - input string\n* @returns {string} identifier\n*\n* @example\n* var str = 'ArrayIndex<0>';\n*\n* var id = getIdentifier( str );\n* // returns '0'\n*/\nfunction getIdentifier( str ) {\n\treturn str.substring( 11, str.length-1 ); // ArrayIndex => XX\n}\n\n\n// MAIN //\n\n/**\n* Converts an indexing expression to an array index.\n*\n* @private\n* @param {string} property - property name\n* @param {Object} cache - cache for resolving array index objects\n* @throws {Error} invalid array index\n* @returns {(Object|null)} index object (or null)\n*/\nfunction prop2array( property, cache ) {\n\tvar o = cache.get( getIdentifier( trim( property ) ) );\n\tif ( o === null ) {\n\t\tthrow new Error( format( 'invalid operation. Unable to resolve array index. Value: `%s`.', property ) );\n\t}\n\treturn o;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prop2array;\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// MODULES //\n\nvar take = require( '@stdlib/array-take' );\nvar mskfilter = require( '@stdlib/array-mskfilter' );\nvar mskreject = require( '@stdlib/array-mskreject' );\nvar format = require( '@stdlib/string-format' );\nvar prop2array = require( './prop2array.js' );\n\n\n// MAIN //\n\n/**\n* Returns the elements specified by an array index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {Object} ctx - context object\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @throws {Error} invalid array index\n* @throws {RangeError} index exceeds array bounds\n* @returns {Collection} result\n*/\nfunction getElements( target, property, ctx ) {\n\tvar idx = prop2array( property, ctx.cache );\n\tif ( idx.type === 'int' ) {\n\t\treturn ctx.postGetArray( take( target, idx.data ) );\n\t}\n\tif ( idx.type === 'bool' ) {\n\t\treturn ctx.postGetArray( mskfilter( target, idx.data ) );\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\treturn ctx.postGetArray( mskreject( target, idx.data ) );\n\t}\n\tthrow new Error( format( 'invalid operation. Unrecognized array index type. Value: `%s`.', idx.type ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getElements;\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// MODULES //\n\nvar normalizeIndex = require( '@stdlib/ndarray-base-normalize-index' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Resolves an integer index from an integer string.\n*\n* @private\n* @param {string} str - integer string\n* @param {NonNegativeInteger} max - index upper bound (exclusive)\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {RangeError} index exceeds array bounds\n* @returns {integer} integer index\n*\n* @example\n* var idx = resolveIndex( '-1', 10, false );\n* // returns 9\n*\n* @example\n* var idx = resolveIndex( '-20', 10, false );\n* // returns -20\n*/\nfunction resolveIndex( str, max, strict ) {\n\tvar idx;\n\tvar i;\n\n\tidx = parseInt( str, 10 );\n\ti = normalizeIndex( idx, max-1 );\n\tif ( i === -1 ) {\n\t\tif ( strict ) {\n\t\t\tthrow new RangeError( format( 'invalid operation. Index exceeds array bounds.' ) );\n\t\t}\n\t\t// Return the non-normalized index, as this should fallback to default property handling and returning \"undefined\":\n\t\treturn idx;\n\t}\n\treturn i;\n}\n\n\n// EXPORTS //\n\nmodule.exports = resolveIndex;\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// MODULES //\n\nvar resolveIndex = require( './resolve_index.js' );\n\n\n// MAIN //\n\n/**\n* Returns the element associated with a specified index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {Object} ctx - context object\n* @param {Function} ctx.getter - accessor for retrieving array elements\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @returns {*} result\n*/\nfunction getElement( target, property, ctx ) {\n\treturn ctx.getter( target, resolveIndex( property, target.length, ctx.strict ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = getElement;\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// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\n\n\n// MAIN //\n\n/**\n* Returns the property value associated with a specified property.\n*\n* @private\n* @param {Object} target - target object\n* @param {(string|symbol)} property - property\n* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n* @param {Object} ctx - context object\n* @param {Function} ctx.ctor - proxied array constructor\n* @returns {*} result\n*/\nfunction getValue( target, property, receiver, ctx ) {\n\tvar value = target[ property ];\n\tif ( isFunction( value ) ) {\n\t\tif ( value === target.constructor ) {\n\t\t\treturn ctx.ctor;\n\t\t}\n\t\treturn wrapper;\n\t}\n\treturn value;\n\n\t/**\n\t* Method wrapper.\n\t*\n\t* @private\n\t* @returns {*} results\n\t*/\n\tfunction wrapper() {\n\t\tvar args;\n\t\tvar i;\n\n\t\targs = [];\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\treturn value.apply( ( this === receiver ) ? target : this, args ); // eslint-disable-line no-invalid-this\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = getValue;\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// MODULES //\n\nvar replace = require( '@stdlib/string-base-replace' );\n\n\n// MAIN //\n\n/**\n* Returns an updated error message for trapped errors.\n*\n* @private\n* @param {string} msg - error message\n* @returns {string} updated message\n*/\nfunction errMessage( msg ) {\n\treturn replace( msg, /^invalid arguments?/, 'invalid operation' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = errMessage;\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* Regular expression for testing whether a string is a subsequence string.\n*\n* @private\n* @name RE_SUBSEQ\n* @type {RegExp}\n*\n* @example\n* var bool = RE_SUBSEQ.test( '0:10:2' );\n* // returns true\n*\n* @example\n* var bool = RE_SUBSEQ.test( '0' );\n* // returns false\n*\n* @example\n* var bool = RE_SUBSEQ.test( 'Slice(0,10,2)' );\n* // returns false\n*/\nvar RE_SUBSEQ = /:/;\n\n\n// EXPORTS //\n\nmodule.exports = RE_SUBSEQ;\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// MODULES //\n\nvar trim = require( '@stdlib/string-base-trim' );\nvar seq2slice = require( '@stdlib/slice-base-seq2slice' );\nvar str2slice = require( '@stdlib/slice-base-str2slice' );\nvar startsWith = require( '@stdlib/string-base-starts-with' );\nvar format = require( '@stdlib/string-format' );\nvar RE_SUBSEQ = require( './re_subseq.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Tests if an indexing expression is a serialized Slice object.\n*\n* @private\n* @param {string} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isSlice( 'Slice(null,null,1)' );\n* // returns true\n*\n* @example\n* var out = isSlice( ':' );\n* // returns false\n*/\nfunction isSlice( prop ) {\n\treturn (\n\t\tprop[ 0 ] === 'S' &&\n\t\tstartsWith( prop, 'Slice(', 0 ) &&\n\t\tprop[ prop.length-1 ] === ')'\n\t);\n}\n\n/**\n* Tests if an indexing expression is a subsequence.\n*\n* @private\n* @param {string} prop - property name\n* @returns {boolean} result\n*\n* @example\n* var out = isSubsequence( '::-2' );\n* // returns true\n*\n* @example\n* var out = isSubsequence( '-2' );\n* // returns false\n*/\nfunction isSubsequence( prop ) {\n\t// TODO: consider whether to make this check more robust (e.g., should we actually throw if someone tries to access `foo:bar`? If we make this check more exact, how would we distinguish between a non-existent `foo:bar` property and an actual error in the subsequence string?)\n\treturn RE_SUBSEQ.test( prop );\n}\n\n/**\n* Parses a serialized Slice object.\n*\n* @private\n* @param {string} raw - original unprocessed input string\n* @param {string} str - serialized Slice object\n* @throws {Error} invalid slice operation\n* @returns {Slice} Slice object\n*\n* @example\n* var s = parseSlice( ' Slice(null,null,1) ', 'Slice(null,null,1)' );\n* // returns \n*/\nfunction parseSlice( raw, str ) {\n\tvar s = str2slice( str );\n\tif ( s === null ) {\n\t\tthrow new Error( format( 'invalid operation. Unsupported slice operation. Value: `%s`.', raw ) );\n\t}\n\treturn s;\n}\n\n/**\n* Parses a subsequence string.\n*\n* @private\n* @param {string} raw - original unprocessed input string\n* @param {string} str - subsequence string\n* @param {NonNegativeInteger} max - index upper bound\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {Slice} Slice object\n*\n* @example\n* var s = parseSubsequence( ' ::-2 ', '::-2', 10, false );\n* // returns \n*/\nfunction parseSubsequence( raw, str, max, strict ) {\n\tvar s = seq2slice( str, max, true );\n\tif ( s.code ) {\n\t\tif ( s.code === 'ERR_SLICE_INVALID_INCREMENT' ) {\n\t\t\tthrow new Error( format( 'invalid operation. A subsequence increment must be a non-zero integer. Value: `%s`.', raw ) );\n\t\t}\n\t\tif ( s.code === 'ERR_SLICE_INVALID_SUBSEQUENCE' ) {\n\t\t\tthrow new Error( format( 'invalid operation. Unsupported slice operation. Value: `%s`.', raw ) );\n\t\t}\n\t\t// NOTE: the following error check must come last due to fall-through when in non-strict mode...\n\t\tif ( s.code === 'ERR_SLICE_OUT_OF_BOUNDS' ) {\n\t\t\tif ( strict ) {\n\t\t\t\tthrow new RangeError( format( 'invalid operation. Slice exceeds array bounds.' ) );\n\t\t\t}\n\t\t\t// Repeat parsing, this time allowing for out-of-bounds slices:\n\t\t\ts = seq2slice( str, max, false );\n\t\t}\n\t}\n\treturn s;\n}\n\n\n// MAIN //\n\n/**\n* Converts an indexing expression to a Slice object.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property name\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {(Slice|null)} slice object (or null)\n*/\nfunction prop2slice( target, property, strict ) {\n\tvar prop = trim( property );\n\tif ( isSlice( prop ) ) {\n\t\treturn parseSlice( property, prop );\n\t}\n\tif ( isSubsequence( prop ) ) {\n\t\treturn parseSubsequence( property, prop, target.length, strict );\n\t}\n\t// Everything else (including undefined/non-existent properties):\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prop2slice;\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// MODULES //\n\nvar slice = require( '@stdlib/array-base-fancy-slice' );\nvar errMessage = require( './error_message.js' );\nvar prop2slice = require( './prop2slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a copy.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property name\n* @param {Object} ctx - context object\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @returns {(Collection|void)} result\n*/\nfunction getSlice( target, property, ctx ) {\n\tvar s = prop2slice( target, property, ctx.strict );\n\tif ( s === null ) {\n\t\t// Ensure consistency with normal array behavior by returning `undefined` for any \"unrecognized\" property name:\n\t\treturn;\n\t}\n\ttry {\n\t\treturn ctx.postGetArray( slice( target, s, ctx.strict ) );\n\t} catch ( err ) {\n\t\t// In principle, we should only error when in \"strict\" mode and a slice exceeds array bounds...\n\t\tthrow new err.constructor( errMessage( err.message ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = getSlice;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar hasProperty = require( '@stdlib/assert-has-property' );\nvar isIntegerString = require( './is_integer_string.js' );\nvar isArrayIndexString = require( './is_array_index_string.js' );\nvar getElements = require( './get_elements.js' );\nvar getElement = require( './get_element.js' );\nvar getValue = require( './get_value.js' );\nvar getSlice = require( './get_slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a trap for retrieving property values.\n*\n* @private\n* @param {Object} ctx - context object\n* @param {Function} ctx.getter - accessor for retrieving array elements\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.ctor - proxied array constructor\n* @param {Function} ctx.postGetArray - function to process a retrieved array\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @returns {Function} handler\n*/\nfunction factory( ctx ) {\n\treturn get;\n\n\t/**\n\t* Trap for retrieving property values.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {(string|symbol)} property - property name\n\t* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n\t* @throws {Error} invalid slice operation\n\t* @throws {RangeError} slice exceeds array bounds\n\t* @throws {RangeError} index exceeds array bounds\n\t* @returns {*} result\n\t*/\n\tfunction get( target, property, receiver ) {\n\t\tif ( isIntegerString( property ) ) {\n\t\t\treturn getElement( target, property, ctx );\n\t\t}\n\t\tif ( hasProperty( target, property ) || !isString( property ) ) {\n\t\t\treturn getValue( target, property, receiver, ctx );\n\t\t}\n\t\tif ( isArrayIndexString( property ) ) {\n\t\t\treturn getElements( target, property, ctx );\n\t\t}\n\t\treturn getSlice( target, property, ctx );\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// MODULES //\n\nvar isMostlySafeCast = require( '@stdlib/array-base-assert-is-mostly-safe-data-type-cast' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar scalar2array = require( '@stdlib/array-from-scalar' );\nvar dtype = require( '@stdlib/array-dtype' );\nvar put = require( '@stdlib/array-put' );\nvar where = require( '@stdlib/array-base-where' ).assign;\nvar format = require( '@stdlib/string-format' );\nvar prop2array = require( './prop2array.js' );\nvar errMessage = require( './error_message.js' );\n\n\n// MAIN //\n\n/**\n* Replaces the elements specified by an array index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {*} value - new value(s)\n* @param {Object} ctx - context object\n* @param {string} ctx.dtype - array data type\n* @param {Object} ctx.cache - cache for resolving array index objects\n* @param {Function} ctx.validator - function for validating new values\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @throws {Error} invalid array index\n* @throws {RangeError} index exceeds array bounds\n* @throws {Error} assigned value must be broadcast compatible with target array selection\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setElements( target, property, value, ctx ) {\n\tvar idx;\n\tvar err;\n\tvar dt;\n\tvar v;\n\n\tidx = prop2array( property, ctx.cache );\n\tif ( isCollection( value ) ) {\n\t\t// When handling collections, we delegate to implementation APIs (see below) to perform argument validation (e.g., ensuring a (mostly) safe cast, broadcast compatibility, etc), so we just reassign the value here:\n\t\tv = value;\n\t\tdt = dtype( value ) || 'generic';\n\t} else {\n\t\t// When provided a \"scalar\", we need to check whether the value can be safely cast to the target array data type:\n\t\tdt = ctx.dtype;\n\t\terr = ctx.validator( value, dt );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( ctx.preSetElement ) {\n\t\t\tv = ctx.preSetElement( value );\n\t\t} else {\n\t\t\tv = value;\n\t\t}\n\t\t// As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during assignment:\n\t\tv = scalar2array( v, dt );\n\t}\n\tif ( idx.type === 'int' ) {\n\t\ttry {\n\t\t\tput( target, idx.data, v ); // note: defer to `put` for ensuring a mostly safe cast\n\t\t} catch ( err ) {\n\t\t\tthrow new err.constructor( errMessage( err.message ) );\n\t\t}\n\t\treturn true;\n\t}\n\t// Safe casts are always allowed and allow same kind casts (i.e., downcasts) only when the target array data type is floating-point...\n\tif ( !isMostlySafeCast( dt, ctx.dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', dt, ctx.dtype ) );\n\t}\n\tif ( idx.type === 'bool' ) {\n\t\twhere( idx.data, v, target, target, 1, 0 );\n\t\treturn true;\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\twhere( idx.data, target, v, target, 1, 0 );\n\t\treturn true;\n\t}\n\tthrow new Error( format( 'invalid operation. Unrecognized array index type. Value: `%s`.', idx.type ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = setElements;\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// MODULES //\n\nvar resolveIndex = require( './resolve_index.js' );\n\n\n// MAIN //\n\n/**\n* Sets the element associated with a specified index.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - index string\n* @param {*} value - new value\n* @param {Object} ctx - context object\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {string} ctx.dtype - target array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setElement( target, property, value, ctx ) {\n\tvar err;\n\tvar v;\n\n\terr = ctx.validator( value, ctx.dtype );\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( ctx.preSetElement ) {\n\t\tv = ctx.preSetElement( value );\n\t} else {\n\t\tv = value;\n\t}\n\tctx.setter( target, resolveIndex( property, target.length, ctx.strict ), v ); // eslint-disable-line max-len\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setElement;\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* Sets the value associated with a specified property.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - property\n* @param {*} value - new value\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setValue( target, property, value ) {\n\ttarget[ property ] = value;\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setValue;\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// MODULES //\n\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar sliceAssign = require( '@stdlib/array-base-fancy-slice-assign' );\nvar scalar2array = require( '@stdlib/array-from-scalar' );\nvar prop2slice = require( './prop2slice.js' );\nvar errMessage = require( './error_message.js' );\n\n\n// MAIN //\n\n/**\n* Sets element values belonging to the array view specified by an indexing expression.\n*\n* @private\n* @param {Object} target - target object\n* @param {string} property - indexing expression\n* @param {*} value - new value\n* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n* @param {Object} ctx - context object\n* @param {string} ctx.dtype - array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @throws {Error} invalid slice operation\n* @throws {RangeError} slice exceeds array bounds\n* @throws {Error} assigned value must be broadcast compatible with target array view\n* @throws {TypeError} assigned value cannot be safely cast to the target array data type\n* @throws {TypeError} target array must have a supported data type\n* @returns {boolean} boolean indicating whether assignment succeeded\n*/\nfunction setSlice( target, property, value, receiver, ctx ) {\n\tvar err;\n\tvar s;\n\tvar v;\n\n\ts = prop2slice( target, property, ctx.strict );\n\tif ( s === null ) {\n\t\t// If unable to parse the property as an indexing expression, signal that we were unable to perform slice assignment:\n\t\treturn false;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// When handling collections, we delegate to `sliceAssign` (see below) to perform argument validation (e.g., ensuring a (mostly) safe cast, broadcast compatibility, etc), so we just reassign the value here:\n\t\tv = value;\n\t} else {\n\t\t// When provided a \"scalar\", we need to check whether the value can be safely cast to the target array data type:\n\t\terr = ctx.validator( value, ctx.dtype );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\t// As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during slice assignment:\n\t\tv = scalar2array( value, ctx.dtype );\n\t}\n\ttry {\n\t\tsliceAssign( v, receiver, s, ctx.strict );\n\t} catch ( err ) {\n\t\tthrow new err.constructor( errMessage( err.message ) );\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setSlice;\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// MODULES //\n\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar hasProperty = require( '@stdlib/assert-has-property' );\nvar isIntegerString = require( './is_integer_string.js' );\nvar isArrayIndexString = require( './is_array_index_string.js' );\nvar setElements = require( './set_elements.js' );\nvar setElement = require( './set_element.js' );\nvar setValue = require( './set_value.js' );\nvar setSlice = require( './set_slice.js' );\n\n\n// MAIN //\n\n/**\n* Returns a trap for setting property values.\n*\n* @private\n* @param {Object} ctx - context object\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {string} ctx.dtype - array data type\n* @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking\n* @param {Function} ctx.validator - function for validating new values\n* @param {Function} ctx.setter - accessor for setting array elements\n* @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)\n* @returns {Function} handler\n*/\nfunction factory( ctx ) {\n\treturn set;\n\n\t/**\n\t* Trap for setting property values.\n\t*\n\t* @private\n\t* @param {Object} target - target object\n\t* @param {(string|symbol)} property - property name\n\t* @param {*} value - new value\n\t* @param {Object} receiver - the proxy object or an object inheriting from the proxy\n\t* @throws {Error} invalid slice operation\n\t* @throws {Error} assigned value must be broadcast compatible with output array view\n\t* @throws {TypeError} assigned value cannot be safely cast to the output array data type\n\t* @throws {TypeError} slice exceeds array bounds\n\t* @throws {TypeError} index exceeds array bounds\n\t* @returns {boolean} boolean indicating whether assignment succeeded\n\t*/\n\tfunction set( target, property, value, receiver ) {\n\t\tvar out;\n\n\t\t// Note that we need to check for an integer string *before* checking for an own property, as we want to explicitly handle *all* indexed properties, not just negative integers, in order to perform assignment validation...\n\t\tif ( isIntegerString( property ) ) {\n\t\t\treturn setElement( target, property, value, ctx );\n\t\t}\n\t\tif ( hasProperty( property ) || !isString( property ) ) {\n\t\t\treturn setValue( target, property, value, ctx );\n\t\t}\n\t\tif ( isArrayIndexString( property ) ) {\n\t\t\treturn setElements( target, property, value, ctx );\n\t\t}\n\t\tout = setSlice( target, property, value, receiver, ctx );\n\t\tif ( out ) {\n\t\t\treturn out;\n\t\t}\n\t\t// If we were unsuccessful (e.g., due to an invalid subsequence, etc), set the \"property\" in the same way as would any normal property (e.g., if an indexing expression is an invalid subsequence, assign as would a regular property: `i = 'a:b:c'` => `x[i] = 1` => `v = x[i]` => `v === 1`):\n\t\treturn setValue( target, property, value, ctx );\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// MODULES //\n\nvar isArrayLike = require( '@stdlib/assert-is-array-like' );\nvar Proxy = require( '@stdlib/proxy-ctor' );\nvar arraylike2object = require( '@stdlib/array-base-arraylike2object' );\nvar assign = require( '@stdlib/object-assign' );\nvar format = require( '@stdlib/string-format' );\nvar setElementWrapper = require( './set_element_wrapper.js' );\nvar getArrayWrapper = require( './get_array_wrapper.js' );\nvar hasProxySupport = require( './has_proxy_support.js' );\nvar defaults = require( './defaults.js' );\nvar validate = require( './validate.js' );\nvar validator = require( './validator.js' );\nvar ctor = require( './ctor.js' );\nvar get = require( './get.js' );\nvar set = require( './set.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for converting an array to an object supporting fancy indexing.\n*\n* @param {Options} options - function options\n* @param {boolean} [options.strict=false] - boolean indicating whether to enforce strict bounds checking by default\n* @param {Function} [options.cache] - default cache for resolving array index objects\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function for converting an array to an object supporting fancy indexing\n*\n* @example\n* var array2fancy = factory();\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\nfunction factory() {\n\tvar OPTIONS;\n\tvar err;\n\n\tOPTIONS = defaults();\n\tif ( arguments.length ) {\n\t\terr = validate( OPTIONS, arguments[ 0 ] );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\treturn array2fancy;\n\n\t/**\n\t* Converts an array to an object supporting fancy indexing.\n\t*\n\t* @private\n\t* @param {ArrayLike} x - input array\n\t* @param {Options} [options] - function options\n\t* @param {boolean} [options.strict] - boolean indicating whether to enforce strict bounds checking\n\t* @param {Function} [options.cache] - cache for resolving array index objects\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} fancy array\n\t*\n\t* @example\n\t* var x = [ 1, 2, 3, 4, 5, 6 ];\n\t*\n\t* var y = array2fancy( x );\n\t* // returns \n\t*\n\t* var z = y[ '1::2' ];\n\t* // returns [ 2, 4, 6 ]\n\t*\n\t* var len = z.length;\n\t* // returns 3\n\t*\n\t* var v = z[ 0 ];\n\t* // returns 2\n\t*\n\t* v = z[ 1 ];\n\t* // returns 4\n\t*\n\t* v = z[ 2 ];\n\t* // returns 6\n\t*/\n\tfunction array2fancy( x ) {\n\t\tvar opts;\n\t\tvar err;\n\t\tvar arr;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isArrayLike( x ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( hasProxySupport ) {\n\t\t\topts = assign( {}, OPTIONS );\n\t\t\tif ( arguments.length > 1 ) {\n\t\t\t\terr = validate( opts, arguments[ 1 ] );\n\t\t\t\tif ( err ) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr = arraylike2object( x );\n\t\t\tdt = arr.dtype || '';\n\t\t\to = {\n\t\t\t\t'ref': x,\n\t\t\t\t'dtype': dt,\n\t\t\t\t'getter': arr.accessors[ 0 ],\n\t\t\t\t'setter': arr.accessors[ 1 ],\n\t\t\t\t'preSetElement': setElementWrapper( dt ),\n\t\t\t\t'postGetArray': getArrayWrapper( array2fancy, opts ),\n\t\t\t\t'cache': opts.cache,\n\t\t\t\t'strict': opts.strict,\n\t\t\t\t'validator': validator( dt ),\n\t\t\t\t'array2fancy': array2fancy,\n\t\t\t\t'ctor': new Proxy( x.constructor || Array, {\n\t\t\t\t\t'construct': ctor( array2fancy, opts )\n\t\t\t\t})\n\t\t\t};\n\t\t\treturn new Proxy( x, {\n\t\t\t\t'get': get( o ),\n\t\t\t\t'set': set( o )\n\t\t\t});\n\t\t}\n\t\t// TODO: replace with `@stdlib/console/warn` (or equivalent once available)\n\t\tconsole.warn( 'WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available.' ); // eslint-disable-line no-console\n\t\treturn x;\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// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Converts an array to an object supporting fancy indexing.\n*\n* @name array2fancy\n* @type {Function}\n* @param {ArrayLike} x - input array\n* @param {Options} [options] - function options\n* @param {boolean} [options.strict=false] - boolean indicating whether to enforce strict bounds checking\n* @param {Function} [options.cache] - cache for resolving array index objects\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} fancy array\n*\n* @example\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\nvar array2fancy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = array2fancy;\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* Convert an array to an object supporting fancy indexing.\n*\n* @module @stdlib/array-to-fancy\n*\n* @example\n* var array2fancy = require( '@stdlib/array-to-fancy' );\n*\n* var x = [ 1, 2, 3, 4, 5, 6 ];\n*\n* var y = array2fancy( x );\n* // returns \n*\n* var z = y[ '1::2' ];\n* // returns [ 2, 4, 6 ]\n*\n* var len = z.length;\n* // returns 3\n*\n* var v = z[ 0 ];\n* // returns 2\n*\n* v = z[ 1 ];\n* // returns 4\n*\n* v = z[ 2 ];\n* // returns 6\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar ArrayIndex = require( '@stdlib/array-index' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\nsetReadOnly( main, 'idx', ArrayIndex );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAoB,QAAS,+DAAgE,EAC7FC,GAAW,QAAS,0BAA2B,EAAE,YAYrD,SAASC,GAAaC,EAAQ,CAE7B,OAAKF,GAAUE,CAAM,EACb,CAAEA,EAAO,CAAI,EAGdA,CACR,CAYA,SAASC,GAASC,EAAQ,CACzB,OAAKL,GAAmBK,CAAM,EACtBH,GAED,IACR,CAKAH,EAAO,QAAUK,KChEjB,IAAAE,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAgCA,SAASC,GAASC,EAAaC,EAAO,CACrC,OAAOC,EASP,SAASA,EAAMC,EAAI,CAClB,OAAOH,EAAaG,EAAGF,CAAK,CAC7B,CACD,CAKAH,EAAO,QAAUC,KClDjB,IAAAK,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAQ,QAAS,oBAAqB,EAYtCC,GAAe,OAAOD,IAAU,WAKpCD,EAAO,QAAU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,EAAaC,EAAI,CACzB,IAAIC,EACAH,EACAI,EACAC,EACAC,EACJ,GAAK,CAACtB,GAAakB,CAAE,EACpB,MAAM,IAAI,UAAWd,GAAQ,oEAAqEc,CAAE,CAAE,EAEvG,GAAKX,GAAkB,CAEtB,GADAY,EAAOhB,GAAQ,CAAC,EAAGY,CAAQ,EACtB,UAAU,OAAS,IACvBC,EAAMP,GAAUU,EAAM,UAAW,CAAE,CAAE,EAChCH,GACJ,MAAMA,EAGR,OAAAI,EAAMlB,GAAkBgB,CAAE,EAC1BG,EAAKD,EAAI,OAAS,GAClBE,EAAI,CACH,IAAOJ,EACP,MAASG,EACT,OAAUD,EAAI,UAAW,CAAE,EAC3B,OAAUA,EAAI,UAAW,CAAE,EAC3B,cAAiBf,GAAmBgB,CAAG,EACvC,aAAgBf,GAAiBW,EAAaE,CAAK,EACnD,MAASA,EAAK,MACd,OAAUA,EAAK,OACf,UAAaT,GAAWW,CAAG,EAC3B,YAAeJ,EACf,KAAQ,IAAIhB,GAAOiB,EAAE,aAAe,MAAO,CAC1C,UAAaP,GAAMM,EAAaE,CAAK,CACtC,CAAC,CACF,EACO,IAAIlB,GAAOiB,EAAG,CACpB,IAAON,GAAKU,CAAE,EACd,IAAOT,GAAKS,CAAE,CACf,CAAC,CACF,CAEA,eAAQ,KAAM,4HAA6H,EACpIJ,CACR,CACD,CAKAnB,GAAO,QAAUe,KCxKjB,IAAAS,GAAAC,EAAA,SAAAC,GAAAC,GAAA,cAsBA,IAAIC,GAAU,IAwCVC,GAAcD,GAAQ,EAK1BD,GAAO,QAAUE,KChBjB,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAa,QAAS,qBAAsB,EAC5CC,EAAO,KACPC,GAAU,IAKdH,GAAaE,EAAM,UAAWC,EAAQ,EACtCH,GAAaE,EAAM,MAAOD,EAAW,EAKrC,OAAO,QAAUC", "names": ["require_set_element_wrapper", "__commonJSMin", "exports", "module", "isComplexDataType", "isNumber", "wrapComplex", "value", "wrapper", "dtype", "require_get_array_wrapper", "__commonJSMin", "exports", "module", "wrapper", "array2fancy", "opts", "wrap", "x", "require_has_proxy_support", "__commonJSMin", "exports", "module", "Proxy", "hasSupport", "require_defaults", "__commonJSMin", "exports", "module", "ArrayIndex", "defaults", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isMethodIn", "format", "validate", "opts", "options", "require_validator", "__commonJSMin", "exports", "module", "isNumber", "isInteger", "isBoolean", "isComplexLike", "isRealFloatingDataType", "isUnsignedIntegerDataType", "isSignedIntegerDataType", "isBooleanDataType", "isSafeCast", "minDataType", "minSignedIntegerDataType", "complexDataType", "format", "validateGeneric", "validateBoolean", "value", "dtype", "validateRealFloating", "validateComplexFloating", "validateSignedInteger", "vdt", "validateUnsignedInteger", "validator", "require_ctor", "__commonJSMin", "exports", "module", "factory", "array2fancy", "opts", "constructor", "target", "args", "x", "a", "require_re_integer", "__commonJSMin", "exports", "module", "RE_INTEGER", "require_is_integer_string", "__commonJSMin", "exports", "module", "isString", "RE_INTEGER", "isIntegerString", "prop", "require_re_array_index", "__commonJSMin", "exports", "module", "RE_ARRAY_INDEX", "require_is_array_index_string", "__commonJSMin", "exports", "module", "isString", "RE_ARRAY_INDEX", "isArrayIndexString", "prop", "require_prop2array", "__commonJSMin", "exports", "module", "trim", "format", "getIdentifier", "str", "prop2array", "property", "cache", "o", "require_get_elements", "__commonJSMin", "exports", "module", "take", "mskfilter", "mskreject", "format", "prop2array", "getElements", "target", "property", "ctx", "idx", "require_resolve_index", "__commonJSMin", "exports", "module", "normalizeIndex", "format", "resolveIndex", "str", "max", "strict", "idx", "i", "require_get_element", "__commonJSMin", "exports", "module", "resolveIndex", "getElement", "target", "property", "ctx", "require_get_value", "__commonJSMin", "exports", "module", "isFunction", "getValue", "target", "property", "receiver", "ctx", "value", "wrapper", "args", "i", "require_error_message", "__commonJSMin", "exports", "module", "replace", "errMessage", "msg", "require_re_subseq", "__commonJSMin", "exports", "module", "RE_SUBSEQ", "require_prop2slice", "__commonJSMin", "exports", "module", "trim", "seq2slice", "str2slice", "startsWith", "format", "RE_SUBSEQ", "isSlice", "prop", "isSubsequence", "parseSlice", "raw", "str", "s", "parseSubsequence", "max", "strict", "prop2slice", "target", "property", "require_get_slice", "__commonJSMin", "exports", "module", "slice", "errMessage", "prop2slice", "getSlice", "target", "property", "ctx", "s", "err", "require_get", "__commonJSMin", "exports", "module", "isString", "hasProperty", "isIntegerString", "isArrayIndexString", "getElements", "getElement", "getValue", "getSlice", "factory", "ctx", "get", "target", "property", "receiver", "require_set_elements", "__commonJSMin", "exports", "module", "isMostlySafeCast", "isCollection", "scalar2array", "dtype", "put", "where", "format", "prop2array", "errMessage", "setElements", "target", "property", "value", "ctx", "idx", "err", "dt", "v", "require_set_element", "__commonJSMin", "exports", "module", "resolveIndex", "setElement", "target", "property", "value", "ctx", "err", "v", "require_set_value", "__commonJSMin", "exports", "module", "setValue", "target", "property", "value", "require_set_slice", "__commonJSMin", "exports", "module", "isCollection", "sliceAssign", "scalar2array", "prop2slice", "errMessage", "setSlice", "target", "property", "value", "receiver", "ctx", "err", "s", "v", "require_set", "__commonJSMin", "exports", "module", "isString", "hasProperty", "isIntegerString", "isArrayIndexString", "setElements", "setElement", "setValue", "setSlice", "factory", "ctx", "set", "target", "property", "value", "receiver", "out", "require_factory", "__commonJSMin", "exports", "module", "isArrayLike", "Proxy", "arraylike2object", "assign", "format", "setElementWrapper", "getArrayWrapper", "hasProxySupport", "defaults", "validate", "validator", "ctor", "get", "set", "factory", "OPTIONS", "err", "array2fancy", "x", "opts", "arr", "dt", "o", "require_main", "__commonJSMin", "exports", "module", "factory", "array2fancy", "setReadOnly", "ArrayIndex", "main", "factory"] } diff --git a/lib/set_elements.js b/lib/set_elements.js index 52958fd..085482b 100644 --- a/lib/set_elements.js +++ b/lib/set_elements.js @@ -65,7 +65,8 @@ function setElements( target, property, value, ctx ) { dt = dtype( value ) || 'generic'; } else { // When provided a "scalar", we need to check whether the value can be safely cast to the target array data type: - err = ctx.validator( value, ctx.dtype ); + dt = ctx.dtype; + err = ctx.validator( value, dt ); if ( err ) { throw err; } @@ -75,8 +76,7 @@ function setElements( target, property, value, ctx ) { v = value; } // As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during assignment: - v = scalar2array( v, ctx.dtype ); - dt = ctx.dtype; + v = scalar2array( v, dt ); } if ( idx.type === 'int' ) { try {