@stdlib/array-to-fancy 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -50,7 +50,7 @@ var x = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
50
50
  // Turn the plain array into a "fancy" array:
51
51
  var y = array2fancy( x );
52
52
 
53
- // Select the first 3 elements:
53
+ // Select the first three elements:
54
54
  var v = y[ ':3' ];
55
55
  // returns [ 1, 2, 3 ]
56
56
 
@@ -58,7 +58,7 @@ var v = y[ ':3' ];
58
58
  v = y[ '1::2' ];
59
59
  // returns [ 2, 4, 6, 8 ]
60
60
 
61
- // Select every other element, in reverse order, starting with the least element:
61
+ // Select every other element, in reverse order, starting with the last element:
62
62
  v = y[ '::-2' ];
63
63
  // returns [ 8, 6, 4, 2 ]
64
64
 
@@ -629,7 +629,7 @@ See [LICENSE][stdlib-license].
629
629
 
630
630
  ## Copyright
631
631
 
632
- Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
632
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
633
633
 
634
634
  </section>
635
635
 
@@ -642,8 +642,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
642
642
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-to-fancy.svg
643
643
  [npm-url]: https://npmjs.org/package/@stdlib/array-to-fancy
644
644
 
645
- [test-image]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml/badge.svg?branch=v0.2.0
646
- [test-url]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml?query=branch:v0.2.0
645
+ [test-image]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml/badge.svg?branch=v0.2.2
646
+ [test-url]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml?query=branch:v0.2.2
647
647
 
648
648
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-to-fancy/main.svg
649
649
  [coverage-url]: https://codecov.io/github/stdlib-js/array-to-fancy?branch=main
@@ -655,8 +655,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
655
655
 
656
656
  -->
657
657
 
658
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
659
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
658
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
659
+ [chat-url]: https://stdlib.zulipchat.com
660
660
 
661
661
  [stdlib]: https://github.com/stdlib-js/stdlib
662
662
 
package/dist/index.js CHANGED
@@ -1,59 +1,59 @@
1
- "use strict";var u=function(r,i){return function(){return i||r((i={exports:{}}).exports,i),i.exports}};var x=u(function(Xt,T){
2
- var kr=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),_r=require('@stdlib/assert-is-number/dist').isPrimitive;function Pr(r){return _r(r)?[r,0]:r}function Nr(r){return kr(r)?Pr:null}T.exports=Nr
3
- });var R=u(function(Yt,D){
4
- function Cr(r,i){return a;function a(t){return r(t,i)}}D.exports=Cr
5
- });var _=u(function($t,k){
1
+ "use strict";var u=function(r,i){return function(){return i||r((i={exports:{}}).exports,i),i.exports}};var D=u(function(Yt,T){
2
+ var kr=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),_r=require('@stdlib/assert-is-number/dist').isPrimitive;function Pr(r){return _r(r)?[r,0]:r}function Cr(r){return kr(r)?Pr:null}T.exports=Cr
3
+ });var R=u(function($t,x){
4
+ function Nr(r,i){return a;function a(t){return r(t,i)}}x.exports=Nr
5
+ });var _=u(function(Ht,k){
6
6
  var Vr=require('@stdlib/proxy-ctor/dist'),Ur=typeof Vr=="function";k.exports=Ur
7
- });var N=u(function(Ht,P){
7
+ });var C=u(function(Jt,P){
8
8
  var Or=require('@stdlib/array-index/dist');function Gr(){return{cache:Or,strict:!1}}P.exports=Gr
9
- });var U=u(function(Jt,V){
10
- var Br=require('@stdlib/assert-is-plain-object/dist'),C=require('@stdlib/assert-has-own-property/dist'),Fr=require('@stdlib/assert-is-boolean/dist').isPrimitive,Lr=require('@stdlib/assert-is-method-in/dist'),q=require('@stdlib/error-tools-fmtprodmsg/dist');function Mr(r,i){return Br(i)?C(i,"strict")&&(r.strict=i.strict,!Fr(r.strict))?new TypeError(q('1rX2o',"strict",r.strict)):C(i,"cache")&&(r.cache=i.cache,!Lr(r.cache,"get"))?new TypeError(q('1rXFb',"cache","get",r.cache)):null:new TypeError(q('1rX2V',i));}V.exports=Mr
11
- });var F=u(function(Kt,B){
9
+ });var U=u(function(Kt,V){
10
+ var Br=require('@stdlib/assert-is-plain-object/dist'),N=require('@stdlib/assert-has-own-property/dist'),Fr=require('@stdlib/assert-is-boolean/dist').isPrimitive,Lr=require('@stdlib/assert-is-method-in/dist'),q=require('@stdlib/error-tools-fmtprodmsg/dist');function Mr(r,i){return Br(i)?N(i,"strict")&&(r.strict=i.strict,!Fr(r.strict))?new TypeError(q('1rX2o',"strict",r.strict)):N(i,"cache")&&(r.cache=i.cache,!Lr(r.cache,"get"))?new TypeError(q('1rXFb',"cache","get",r.cache)):null:new TypeError(q('1rX2V',i));}V.exports=Mr
11
+ });var F=u(function(Zt,B){
12
12
  var f=require('@stdlib/assert-is-number/dist').isPrimitive,jr=require('@stdlib/assert-is-integer/dist').isPrimitive,zr=require('@stdlib/assert-is-boolean/dist').isPrimitive,p=require('@stdlib/assert-is-complex-like/dist'),Wr=require('@stdlib/array-base-assert-is-real-floating-point-data-type/dist'),Qr=require('@stdlib/array-base-assert-is-unsigned-integer-data-type/dist'),Xr=require('@stdlib/array-base-assert-is-signed-integer-data-type/dist'),Yr=require('@stdlib/array-base-assert-is-boolean-data-type/dist'),O=require('@stdlib/array-base-assert-is-safe-data-type-cast/dist'),G=require('@stdlib/array-min-dtype/dist'),$r=require('@stdlib/array-base-min-signed-integer-dtype/dist'),g=require('@stdlib/complex-dtype/dist'),v=require('@stdlib/error-tools-fmtprodmsg/dist');function Hr(){return null}function Jr(r,i){return zr(r)?null:new TypeError(v('1rXEw',typeof r,i));}function Kr(r,i){return f(r)?null:p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function Zr(r,i){return f(r)||p(r)?null:new TypeError(v('1rXEw',typeof r,i));}function re(r,i){var a;return f(r)?jr(r)?(a=$r(r),O(a,i)?null:new TypeError(v('1rXEw',a,i))):new TypeError(v('1rXEw',G(r),i)):p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function ee(r,i){var a;return f(r)?(a=G(r),O(a,i)?null:new TypeError(v('1rXEw',a,i))):p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function te(r){return r==="generic"||r===""?Hr:Wr(r)?Kr:Qr(r)?ee:Xr(r)?re:Yr(r)?Jr:Zr}B.exports=te
13
- });var M=u(function(Zt,L){
13
+ });var M=u(function(ra,L){
14
14
  function ae(r,i){return a;function a(t,n){var s,e;switch(e=n,e.length){case 0:s=new t;break;case 1:s=new t(e[0]);break;case 2:s=new t(e[0],e[1]);break;case 3:s=new t(e[0],e[1],e[2]);break;case 4:s=new t(e[0],e[1],e[2],e[3]);break;case 5:s=new t(e[0],e[1],e[2],e[3],e[4]);break;case 6:s=new t(e[0],e[1],e[2],e[3],e[4],e[5]);break;case 7:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6]);break;case 8:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);break;case 9:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);break;case 10:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]);break;default:s=t.apply(null,e)}return r(s,i)}}L.exports=ae
15
- });var z=u(function(ra,j){
15
+ });var z=u(function(ea,j){
16
16
  var ie=/^-?[0-9]+$/;j.exports=ie
17
- });var m=u(function(ea,W){
17
+ });var m=u(function(ta,W){
18
18
  var ne=require('@stdlib/assert-is-string/dist').isPrimitive,se=z();function ue(r){return ne(r)&&se.test(r)}W.exports=ue
19
- });var X=u(function(ta,Q){
19
+ });var X=u(function(aa,Q){
20
20
  var oe=/\s*ArrayIndex<[^>]+>\s*/;Q.exports=oe
21
- });var h=u(function(aa,Y){
21
+ });var h=u(function(ia,Y){
22
22
  var ce=require('@stdlib/assert-is-string/dist').isPrimitive,ve=X();function le(r){return ce(r)&&ve.test(r)}Y.exports=le
23
- });var w=u(function(ia,$){
23
+ });var w=u(function(na,$){
24
24
  var fe=require('@stdlib/string-base-trim/dist'),pe=require('@stdlib/error-tools-fmtprodmsg/dist');function ye(r){return r.substring(11,r.length-1)}function de(r,i){var a=i.get(ye(fe(r)));if(a===null)throw new Error(pe('1rXFa',r));return a}$.exports=de
25
- });var J=u(function(na,H){
25
+ });var J=u(function(sa,H){
26
26
  var qe=require('@stdlib/array-take/dist'),ge=require('@stdlib/array-mskfilter/dist'),me=require('@stdlib/array-mskreject/dist'),he=require('@stdlib/error-tools-fmtprodmsg/dist'),we=w();function Ee(r,i,a){var t=we(i,a.cache);if(t.type==="int")return a.postGetArray(qe(r,t.data));if(t.type==="bool")return a.postGetArray(ge(r,t.data));if(t.type==="mask")return a.postGetArray(me(r,t.data));throw new Error(he('1rXFZ',t.type))}H.exports=Ee
27
- });var E=u(function(sa,K){
27
+ });var E=u(function(ua,K){
28
28
  var be=require('@stdlib/ndarray-base-normalize-index/dist'),Se=require('@stdlib/error-tools-fmtprodmsg/dist');function Ie(r,i,a){var t,n;if(t=parseInt(r,10),n=be(t,i-1),n===-1){if(a)throw new RangeError(Se('1rXFY'));return t}return n}K.exports=Ie
29
- });var rr=u(function(ua,Z){
29
+ });var rr=u(function(oa,Z){
30
30
  var Ae=E();function Te(r,i,a){return a.getter(r,Ae(i,r.length,a.strict))}Z.exports=Te
31
- });var tr=u(function(oa,er){
32
- var xe=require('@stdlib/assert-is-function/dist');function De(r,i,a,t){var n=r[i];if(xe(n))return n===r.constructor?t.ctor:s;return n;function s(){var e,o;for(e=[],o=0;o<arguments.length;o++)e.push(arguments[o]);return n.apply(this===a?r:this,e)}}er.exports=De
33
- });var y=u(function(ca,ar){
31
+ });var tr=u(function(ca,er){
32
+ var De=require('@stdlib/assert-is-function/dist');function xe(r,i,a,t){var n=r[i];if(De(n))return n===r.constructor?t.ctor:s;return n;function s(){var e,o;for(e=[],o=0;o<arguments.length;o++)e.push(arguments[o]);return n.apply(this===a?r:this,e)}}er.exports=xe
33
+ });var y=u(function(va,ar){
34
34
  var Re=require('@stdlib/string-base-replace/dist');function ke(r){return Re(r,/^invalid arguments?/,"invalid operation")}ar.exports=ke
35
- });var nr=u(function(va,ir){
35
+ });var nr=u(function(la,ir){
36
36
  var _e=/:/;ir.exports=_e
37
- });var b=u(function(la,ur){
38
- var Pe=require('@stdlib/string-base-trim/dist'),sr=require('@stdlib/slice-base-seq2slice/dist'),Ne=require('@stdlib/slice-base-str2slice/dist'),Ce=require('@stdlib/string-base-starts-with/dist'),d=require('@stdlib/error-tools-fmtprodmsg/dist'),Ve=nr();function Ue(r){return r[0]==="S"&&Ce(r,"Slice(",0)&&r[r.length-1]===")"}function Oe(r){return Ve.test(r)}function Ge(r,i){var a=Ne(i);if(a===null)throw new Error(d('1rXEn',r));return a}function Be(r,i,a,t){var n=sr(i,a,!0);if(n.code){if(n.code==="ERR_SLICE_INVALID_INCREMENT")throw new Error(d('1rXEq',r));if(n.code==="ERR_SLICE_INVALID_SUBSEQUENCE")throw new Error(d('1rXEn',r));if(n.code==="ERR_SLICE_OUT_OF_BOUNDS"){if(t)throw new RangeError(d('1rXFU'));n=sr(i,a,!1)}}return n}function Fe(r,i,a){var t=Pe(i);return Ue(t)?Ge(i,t):Oe(t)?Be(i,t,r.length,a):null}ur.exports=Fe
39
- });var cr=u(function(fa,or){
37
+ });var b=u(function(fa,ur){
38
+ var Pe=require('@stdlib/string-base-trim/dist'),sr=require('@stdlib/slice-base-seq2slice/dist'),Ce=require('@stdlib/slice-base-str2slice/dist'),Ne=require('@stdlib/string-base-starts-with/dist'),d=require('@stdlib/error-tools-fmtprodmsg/dist'),Ve=nr();function Ue(r){return r[0]==="S"&&Ne(r,"Slice(",0)&&r[r.length-1]===")"}function Oe(r){return Ve.test(r)}function Ge(r,i){var a=Ce(i);if(a===null)throw new Error(d('1rXEn',r));return a}function Be(r,i,a,t){var n=sr(i,a,!0);if(n.code){if(n.code==="ERR_SLICE_INVALID_INCREMENT")throw new Error(d('1rXEq',r));if(n.code==="ERR_SLICE_INVALID_SUBSEQUENCE")throw new Error(d('1rXEn',r));if(n.code==="ERR_SLICE_OUT_OF_BOUNDS"){if(t)throw new RangeError(d('1rXFU'));n=sr(i,a,!1)}}return n}function Fe(r,i,a){var t=Pe(i);return Ue(t)?Ge(i,t):Oe(t)?Be(i,t,r.length,a):null}ur.exports=Fe
39
+ });var cr=u(function(pa,or){
40
40
  var Le=require('@stdlib/array-base-fancy-slice/dist'),Me=y(),je=b();function ze(r,i,a){var t=je(r,i,a.strict);if(t!==null)try{return a.postGetArray(Le(r,t,a.strict))}catch(n){throw new n.constructor(Me(n.message))}}or.exports=ze
41
- });var lr=u(function(pa,vr){
41
+ });var lr=u(function(ya,vr){
42
42
  var We=require('@stdlib/assert-is-string/dist').isPrimitive,Qe=require('@stdlib/assert-has-property/dist'),Xe=m(),Ye=h(),$e=J(),He=rr(),Je=tr(),Ke=cr();function Ze(r){return i;function i(a,t,n){return Xe(t)?He(a,t,r):Qe(a,t)||!We(t)?Je(a,t,n,r):Ye(t)?$e(a,t,r):Ke(a,t,r)}}vr.exports=Ze
43
- });var yr=u(function(ya,pr){
43
+ });var yr=u(function(da,pr){
44
44
  var rt=require('@stdlib/array-base-assert-is-mostly-safe-data-type-cast/dist'),et=require('@stdlib/array-base-assert-is-real-data-type/dist'),tt=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),at=require('@stdlib/assert-is-collection/dist'),it=require('@stdlib/array-from-scalar/dist'),nt=require('@stdlib/array-dtype/dist'),st=require('@stdlib/array-put/dist'),ut=require('@stdlib/array-place/dist'),ot=require('@stdlib/array-convert/dist'),ct=require('@stdlib/array-base-where/dist').assign,fr=require('@stdlib/error-tools-fmtprodmsg/dist'),vt=w(),S=y();function lt(r,i,a,t){var n,s,e,o,c;if(e=vt(i,t.cache),n=t.dtype||"generic",at(a))c=a;else{if(o=t.validator(a,n),o)throw o;t.preSetElement?c=t.preSetElement(a):c=a,c=it(c,n),s=n}if(e.type==="int"){try{st(r,e.data,c)}catch(l){throw new l.constructor(S(l.message))}return!0}if(e.type==="bool"){try{ut(r,e.data,c,{mode:"strict_broadcast"})}catch(l){throw new l.constructor(S(l.message))}return!0}if(s===void 0&&(s=nt(a)||"generic"),!rt(s,n))throw new TypeError(fr('1rXEw',s,n));if(tt(n)&&et(s)&&(c=ot(c,n)),e.type==="mask"){try{ct(e.data,r,c,r,1,0)}catch(l){throw new l.constructor(S(l.message))}return!0}throw new Error(fr('1rXFZ',e.type))}pr.exports=lt
45
- });var qr=u(function(da,dr){
45
+ });var qr=u(function(qa,dr){
46
46
  var ft=E();function pt(r,i,a,t){var n,s;if(n=t.validator(a,t.dtype),n)throw n;return t.preSetElement?s=t.preSetElement(a):s=a,t.setter(r,ft(i,r.length,t.strict),s),!0}dr.exports=pt
47
- });var mr=u(function(qa,gr){
47
+ });var mr=u(function(ga,gr){
48
48
  function yt(r,i,a){return r[i]=a,!0}gr.exports=yt
49
- });var wr=u(function(ga,hr){
49
+ });var wr=u(function(ma,hr){
50
50
  var dt=require('@stdlib/assert-is-collection/dist'),qt=require('@stdlib/array-base-fancy-slice-assign/dist'),gt=require('@stdlib/array-from-scalar/dist'),mt=b(),ht=y();function wt(r,i,a,t,n){var s,e,o;if(e=mt(r,i,n.strict),e===null)return!1;if(dt(a))o=a;else{if(s=n.validator(a,n.dtype),s)throw s;o=gt(a,n.dtype||"generic")}try{qt(o,t,e,n.strict)}catch(c){throw new c.constructor(ht(c.message))}return!0}hr.exports=wt
51
- });var Sr=u(function(ma,br){
52
- var Et=require('@stdlib/assert-is-string/dist').isPrimitive,bt=require('@stdlib/assert-has-property/dist'),St=m(),It=h(),At=yr(),Tt=qr(),Er=mr(),xt=wr();function Dt(r){return i;function i(a,t,n,s){var e;return St(t)?Tt(a,t,n,r):bt(t)||!Et(t)?Er(a,t,n,r):It(t)?At(a,t,n,r):(e=xt(a,t,n,s,r),e||Er(a,t,n,r))}}br.exports=Dt
53
- });var I=u(function(ha,Tr){
54
- var Rt=require('@stdlib/assert-is-array-like/dist'),Ir=require('@stdlib/proxy-ctor/dist'),kt=require('@stdlib/array-base-arraylike2object/dist'),_t=require('@stdlib/object-assign/dist'),Pt=require('@stdlib/error-tools-fmtprodmsg/dist'),Nt=x(),Ct=R(),Vt=_(),Ut=N(),Ar=U(),Ot=F(),Gt=M(),Bt=lr(),Ft=Sr();function Lt(){var r,i;if(r=Ut(),arguments.length&&(i=Ar(r,arguments[0]),i))throw i;return a;function a(t){var n,s,e,o,c;if(!Rt(t))throw new TypeError(Pt('1rX38',t));if(Vt){if(n=_t({},r),arguments.length>1&&(s=Ar(n,arguments[1]),s))throw s;return e=kt(t),o=e.dtype||"",c={ref:t,dtype:o,getter:e.accessors[0],setter:e.accessors[1],preSetElement:Nt(o),postGetArray:Ct(a,n),cache:n.cache,strict:n.strict,validator:Ot(o),array2fancy:a,ctor:new Ir(t.constructor||Array,{construct:Gt(a,n)})},new Ir(t,{get:Bt(c),set:Ft(c)})}return console.warn("WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available."),t}}Tr.exports=Lt
55
- });var Dr=u(function(wa,xr){
56
- var Mt=I(),jt=Mt();xr.exports=jt
57
- });var Rr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),zt=require('@stdlib/array-index/dist'),A=Dr(),Wt=I();Rr(A,"factory",Wt);Rr(A,"idx",zt);module.exports=A;
51
+ });var Sr=u(function(ha,br){
52
+ var Et=require('@stdlib/assert-is-string/dist').isPrimitive,bt=require('@stdlib/assert-has-property/dist'),St=m(),It=h(),At=yr(),Tt=qr(),Er=mr(),Dt=wr();function xt(r){return i;function i(a,t,n,s){var e;return St(t)?Tt(a,t,n,r):bt(a,t)||!Et(t)?Er(a,t,n,r):It(t)?At(a,t,n,r):(e=Dt(a,t,n,s,r),e||Er(a,t,n,r))}}br.exports=xt
53
+ });var I=u(function(wa,Tr){
54
+ var Rt=require('@stdlib/assert-is-collection/dist'),kt=require('@stdlib/assert-is-array-like/dist'),Ir=require('@stdlib/proxy-ctor/dist'),_t=require('@stdlib/array-base-arraylike2object/dist'),Pt=require('@stdlib/object-assign/dist'),Ct=require('@stdlib/error-tools-fmtprodmsg/dist'),Nt=D(),Vt=R(),Ut=_(),Ot=C(),Ar=U(),Gt=F(),Bt=M(),Ft=lr(),Lt=Sr();function Mt(){var r,i;if(r=Ot(),arguments.length&&(i=Ar(r,arguments[0]),i))throw i;return a;function a(t){var n,s,e,o,c;if(!kt(t)&&!Rt(t))throw new TypeError(Ct('1rX38',t));if(Ut){if(n=Pt({},r),arguments.length>1&&(s=Ar(n,arguments[1]),s))throw s;return e=_t(t),o=e.dtype||"",c={ref:t,dtype:o,getter:e.accessors[0],setter:e.accessors[1],preSetElement:Nt(o),postGetArray:Vt(a,n),cache:n.cache,strict:n.strict,validator:Gt(o),array2fancy:a,ctor:new Ir(t.constructor||Array,{construct:Bt(a,n)})},new Ir(t,{get:Ft(c),set:Lt(c)})}return console.warn("WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available."),t}}Tr.exports=Mt
55
+ });var xr=u(function(Ea,Dr){
56
+ var jt=I(),zt=jt();Dr.exports=zt
57
+ });var Rr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),Wt=require('@stdlib/array-index/dist'),A=xr(),Qt=I();Rr(A,"factory",Qt);Rr(A,"idx",Wt);module.exports=A;
58
58
  /** @license Apache-2.0 */
59
59
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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"],
4
- "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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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> => 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 <Slice>\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 <Slice>\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 isRealDataType = require( '@stdlib/array-base-assert-is-real-data-type' );\nvar isComplexDataType = require( '@stdlib/array-base-assert-is-complex-floating-point-data-type' );\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 place = require( '@stdlib/array-place' );\nvar convert = require( '@stdlib/array-convert' );\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 tdt;\n\tvar vdt;\n\tvar idx;\n\tvar err;\n\tvar v;\n\n\tidx = prop2array( property, ctx.cache );\n\ttdt = ctx.dtype || 'generic';\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} 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, tdt );\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, tdt );\n\t\tvdt = tdt;\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\tif ( idx.type === 'bool' ) {\n\t\ttry {\n\t\t\tplace( target, idx.data, v, {\n\t\t\t\t'mode': 'strict_broadcast'\n\t\t\t});\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\tif ( vdt === void 0 ) {\n\t\tvdt = dtype( value ) || 'generic';\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( vdt, tdt ) ) {\n\t\tthrow new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, tdt ) );\n\t}\n\t// When performing a real-to-complex assignment, interpret the real-valued array as containing real components with implied imaginary components equal to zero and explicitly convert to a complex-valued array...\n\tif ( isComplexDataType( tdt ) && isRealDataType( vdt ) ) {\n\t\tv = convert( v, tdt );\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\t// NOTE: we intentionally deviate from boolean array indexing here and interpret the mask as applying to both the target and values array, thus requiring that the assigned value array be broadcast compatible with the target array and NOT just the selected elements as in boolean array indexing\n\t\ttry {\n\t\t\twhere( idx.data, target, v, target, 1, 0 );\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\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 || 'generic' );\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 <Array>\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 <Array>\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 <Array>\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 <Array>\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"],
5
- "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,QAAUE,KCvCjB,IAAAC,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAa,QAAS,qBAAsB,EAehD,SAASC,IAAW,CACnB,MAAO,CACN,MAASD,GACT,OAAU,EACX,CACD,CAKAD,EAAO,QAAUE,KC/CjB,IAAAC,EAAAC,EAAA,SAAA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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",
6
- "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", "isRealDataType", "isComplexDataType", "isCollection", "scalar2array", "dtype", "put", "place", "convert", "where", "format", "prop2array", "errMessage", "setElements", "target", "property", "value", "ctx", "tdt", "vdt", "idx", "err", "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"]
4
+ "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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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 <TypeError>\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* @param {Function} opts.cache - cache for resolving array index objects\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> => 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* @throws {RangeError} index exceeds array bounds\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 <Slice>\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 <Slice>\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 isRealDataType = require( '@stdlib/array-base-assert-is-real-data-type' );\nvar isComplexDataType = require( '@stdlib/array-base-assert-is-complex-floating-point-data-type' );\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 place = require( '@stdlib/array-place' );\nvar convert = require( '@stdlib/array-convert' );\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 tdt;\n\tvar vdt;\n\tvar idx;\n\tvar err;\n\tvar v;\n\n\tidx = prop2array( property, ctx.cache );\n\ttdt = ctx.dtype || 'generic';\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} 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, tdt );\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, tdt );\n\t\tvdt = tdt;\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\tif ( idx.type === 'bool' ) {\n\t\ttry {\n\t\t\tplace( target, idx.data, v, {\n\t\t\t\t'mode': 'strict_broadcast'\n\t\t\t});\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\tif ( vdt === void 0 ) {\n\t\tvdt = dtype( value ) || 'generic';\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( vdt, tdt ) ) {\n\t\tthrow new TypeError( format( 'invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].', vdt, tdt ) );\n\t}\n\t// When performing a real-to-complex assignment, interpret the real-valued array as containing real components with implied imaginary components equal to zero and explicitly convert to a complex-valued array...\n\tif ( isComplexDataType( tdt ) && isRealDataType( vdt ) ) {\n\t\tv = convert( v, tdt );\n\t}\n\tif ( idx.type === 'mask' ) {\n\t\t// NOTE: we intentionally deviate from boolean array indexing here and interpret the mask as applying to both the target and values array, thus requiring that the assigned value array be broadcast compatible with the target array and NOT just the selected elements as in boolean array indexing\n\t\ttry {\n\t\t\twhere( idx.data, target, v, target, 1, 0 );\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\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* @throws {RangeError} index exceeds array bounds\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 || 'generic' );\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 {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( target, 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 isCollection = require( '@stdlib/assert-is-collection' );\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 <Array>\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 <Array>\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 ) && !isCollection( 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 <Array>\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 <Array>\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, '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C,EACAC,EACJ,GAAK,CAACtB,GAAakB,CAAE,GAAK,CAACnB,GAAcmB,CAAE,EAC1C,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,CAKApB,GAAO,QAAUgB,KCzKjB,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",
6
+ "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", "isRealDataType", "isComplexDataType", "isCollection", "scalar2array", "dtype", "put", "place", "convert", "where", "format", "prop2array", "errMessage", "setElements", "target", "property", "value", "ctx", "tdt", "vdt", "idx", "err", "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", "isCollection", "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"]
7
7
  }
@@ -1,4 +1,4 @@
1
- /**
1
+ /*
2
2
  * @license Apache-2.0
3
3
  *
4
4
  * Copyright (c) 2024 The Stdlib Authors.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /// <reference types="@stdlib/types"/>
22
22
 
23
- import { Collection, ArrayLike, AccessorArrayLike, ComplexTypedArray, TypedArray, BooleanTypedArray, ArrayIndexObject } from '@stdlib/types/array';
23
+ import { Collection, ArrayLike, AccessorArrayLike, ComplexTypedArray, TypedArray, BooleanTypedArray, IndexArrayObject } from '@stdlib/types/array';
24
24
  import ArrayIndex = require( '@stdlib/array-index' );
25
25
 
26
26
  /**
@@ -33,7 +33,7 @@ interface Cache {
33
33
  * @param id - identifier
34
34
  * @returns index data
35
35
  */
36
- get( id: any ): ArrayIndexObject | null;
36
+ get( id: any ): IndexArrayObject | null;
37
37
  }
38
38
 
39
39
  /**
package/lib/ctor.js CHANGED
@@ -27,6 +27,7 @@
27
27
  * @param {Function} array2fancy - function for creating a proxied array
28
28
  * @param {Object} opts - options
29
29
  * @param {boolean} opts.strict - boolean indicating whether to perform strict bounds checking
30
+ * @param {Function} opts.cache - cache for resolving array index objects
30
31
  * @returns {Function} handler
31
32
  */
32
33
  function factory( array2fancy, opts ) {
package/lib/factory.js CHANGED
@@ -20,6 +20,7 @@
20
20
 
21
21
  // MODULES //
22
22
 
23
+ var isCollection = require( '@stdlib/assert-is-collection' );
23
24
  var isArrayLike = require( '@stdlib/assert-is-array-like' );
24
25
  var Proxy = require( '@stdlib/proxy-ctor' );
25
26
  var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
@@ -124,7 +125,7 @@ function factory() {
124
125
  var arr;
125
126
  var dt;
126
127
  var o;
127
- if ( !isArrayLike( x ) ) {
128
+ if ( !isArrayLike( x ) && !isCollection( x ) ) {
128
129
  throw new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );
129
130
  }
130
131
  if ( hasProxySupport ) {
@@ -34,6 +34,7 @@ var resolveIndex = require( './resolve_index.js' );
34
34
  * @param {Object} ctx - context object
35
35
  * @param {Function} ctx.getter - accessor for retrieving array elements
36
36
  * @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking
37
+ * @throws {RangeError} index exceeds array bounds
37
38
  * @returns {*} result
38
39
  */
39
40
  function getElement( target, property, ctx ) {
package/lib/set.js CHANGED
@@ -37,7 +37,6 @@ var setSlice = require( './set_slice.js' );
37
37
  *
38
38
  * @private
39
39
  * @param {Object} ctx - context object
40
- * @param {Function} ctx.setter - accessor for setting array elements
41
40
  * @param {string} ctx.dtype - array data type
42
41
  * @param {boolean} ctx.strict - boolean indicating whether to enforce strict bounds checking
43
42
  * @param {Function} ctx.validator - function for validating new values
@@ -70,7 +69,7 @@ function factory( ctx ) {
70
69
  if ( isIntegerString( property ) ) {
71
70
  return setElement( target, property, value, ctx );
72
71
  }
73
- if ( hasProperty( property ) || !isString( property ) ) {
72
+ if ( hasProperty( target, property ) || !isString( property ) ) {
74
73
  return setValue( target, property, value, ctx );
75
74
  }
76
75
  if ( isArrayIndexString( property ) ) {
@@ -40,6 +40,7 @@ var resolveIndex = require( './resolve_index.js' );
40
40
  * @param {(Function|null)} ctx.preSetElement - function for normalizing new values (if necessary)
41
41
  * @throws {TypeError} assigned value cannot be safely cast to the target array data type
42
42
  * @throws {TypeError} target array must have a supported data type
43
+ * @throws {RangeError} index exceeds array bounds
43
44
  * @returns {boolean} boolean indicating whether assignment succeeded
44
45
  */
45
46
  function setElement( target, property, value, ctx ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/array-to-fancy",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Convert an array to an object supporting fancy indexing.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -30,53 +30,53 @@
30
30
  "url": "https://github.com/stdlib-js/stdlib/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@stdlib/array-base-arraylike2object": "^0.2.1",
34
- "@stdlib/array-base-assert-is-boolean-data-type": "^0.0.1",
35
- "@stdlib/array-base-assert-is-complex-floating-point-data-type": "^0.2.1",
36
- "@stdlib/array-base-assert-is-mostly-safe-data-type-cast": "^0.2.2",
37
- "@stdlib/array-base-assert-is-real-data-type": "^0.2.1",
38
- "@stdlib/array-base-assert-is-real-floating-point-data-type": "^0.2.1",
39
- "@stdlib/array-base-assert-is-safe-data-type-cast": "^0.3.2",
40
- "@stdlib/array-base-assert-is-signed-integer-data-type": "^0.2.1",
41
- "@stdlib/array-base-assert-is-unsigned-integer-data-type": "^0.2.1",
42
- "@stdlib/array-base-fancy-slice": "^0.3.1",
43
- "@stdlib/array-base-fancy-slice-assign": "^0.2.1",
44
- "@stdlib/array-base-min-signed-integer-dtype": "^0.2.2",
45
- "@stdlib/array-base-where": "^0.0.2",
46
- "@stdlib/array-convert": "^0.2.1",
47
- "@stdlib/array-dtype": "^0.3.0",
48
- "@stdlib/array-from-scalar": "^0.2.1",
49
- "@stdlib/array-index": "^0.3.0",
50
- "@stdlib/array-min-dtype": "^0.3.0",
51
- "@stdlib/array-mskfilter": "^0.1.1",
52
- "@stdlib/array-mskreject": "^0.1.2",
53
- "@stdlib/array-place": "^0.1.1",
54
- "@stdlib/array-put": "^0.0.2",
55
- "@stdlib/array-take": "^0.1.2",
56
- "@stdlib/assert-has-own-property": "^0.2.2",
57
- "@stdlib/assert-has-property": "^0.2.2",
58
- "@stdlib/assert-is-array-like": "^0.2.2",
59
- "@stdlib/assert-is-boolean": "^0.2.2",
60
- "@stdlib/assert-is-collection": "^0.2.2",
61
- "@stdlib/assert-is-complex-like": "^0.2.2",
62
- "@stdlib/assert-is-function": "^0.2.2",
63
- "@stdlib/assert-is-integer": "^0.2.2",
64
- "@stdlib/assert-is-method-in": "^0.2.2",
65
- "@stdlib/assert-is-number": "^0.2.2",
66
- "@stdlib/assert-is-plain-object": "^0.2.2",
67
- "@stdlib/assert-is-string": "^0.2.2",
68
- "@stdlib/complex-dtype": "^0.2.2",
69
- "@stdlib/ndarray-base-normalize-index": "^0.2.2",
70
- "@stdlib/object-assign": "^0.2.2",
71
- "@stdlib/proxy-ctor": "^0.2.2",
72
- "@stdlib/slice-base-seq2slice": "^0.2.2",
73
- "@stdlib/slice-base-str2slice": "^0.2.2",
74
- "@stdlib/string-base-replace": "^0.2.2",
75
- "@stdlib/string-base-starts-with": "^0.2.2",
76
- "@stdlib/string-base-trim": "^0.2.2",
77
- "@stdlib/string-format": "^0.2.2",
78
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
79
- "@stdlib/error-tools-fmtprodmsg": "^0.2.2"
33
+ "@stdlib/array-base-arraylike2object": "^0.2.2",
34
+ "@stdlib/array-base-assert-is-boolean-data-type": "^0.0.2",
35
+ "@stdlib/array-base-assert-is-complex-floating-point-data-type": "^0.2.2",
36
+ "@stdlib/array-base-assert-is-mostly-safe-data-type-cast": "^0.2.3",
37
+ "@stdlib/array-base-assert-is-real-data-type": "^0.2.2",
38
+ "@stdlib/array-base-assert-is-real-floating-point-data-type": "^0.2.2",
39
+ "@stdlib/array-base-assert-is-safe-data-type-cast": "^0.3.3",
40
+ "@stdlib/array-base-assert-is-signed-integer-data-type": "^0.2.2",
41
+ "@stdlib/array-base-assert-is-unsigned-integer-data-type": "^0.2.2",
42
+ "@stdlib/array-base-fancy-slice": "^0.3.2",
43
+ "@stdlib/array-base-fancy-slice-assign": "^0.2.2",
44
+ "@stdlib/array-base-min-signed-integer-dtype": "^0.2.3",
45
+ "@stdlib/array-base-where": "^0.0.3",
46
+ "@stdlib/array-convert": "^0.3.1",
47
+ "@stdlib/array-dtype": "^0.3.1",
48
+ "@stdlib/array-from-scalar": "^0.3.1",
49
+ "@stdlib/array-index": "^0.3.1",
50
+ "@stdlib/array-min-dtype": "^0.3.1",
51
+ "@stdlib/array-mskfilter": "^0.1.2",
52
+ "@stdlib/array-mskreject": "^0.1.3",
53
+ "@stdlib/array-place": "^0.1.2",
54
+ "@stdlib/array-put": "^0.0.3",
55
+ "@stdlib/array-take": "^0.1.3",
56
+ "@stdlib/assert-has-own-property": "^0.2.3",
57
+ "@stdlib/assert-has-property": "^0.2.3",
58
+ "@stdlib/assert-is-array-like": "^0.2.3",
59
+ "@stdlib/assert-is-boolean": "^0.2.3",
60
+ "@stdlib/assert-is-collection": "^0.2.3",
61
+ "@stdlib/assert-is-complex-like": "^0.2.4",
62
+ "@stdlib/assert-is-function": "^0.2.3",
63
+ "@stdlib/assert-is-integer": "^0.2.3",
64
+ "@stdlib/assert-is-method-in": "^0.2.3",
65
+ "@stdlib/assert-is-number": "^0.2.3",
66
+ "@stdlib/assert-is-plain-object": "^0.2.3",
67
+ "@stdlib/assert-is-string": "^0.2.3",
68
+ "@stdlib/complex-dtype": "^0.2.3",
69
+ "@stdlib/ndarray-base-normalize-index": "^0.2.3",
70
+ "@stdlib/object-assign": "^0.2.3",
71
+ "@stdlib/proxy-ctor": "^0.2.3",
72
+ "@stdlib/slice-base-seq2slice": "^0.2.3",
73
+ "@stdlib/slice-base-str2slice": "^0.2.3",
74
+ "@stdlib/string-base-replace": "^0.2.3",
75
+ "@stdlib/string-base-starts-with": "^0.2.3",
76
+ "@stdlib/string-base-trim": "^0.2.3",
77
+ "@stdlib/string-format": "^0.2.3",
78
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.3",
79
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.3"
80
80
  },
81
81
  "devDependencies": {},
82
82
  "engines": {
@@ -1,53 +0,0 @@
1
- /**
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2024 The Stdlib Authors.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- 'use strict';
20
-
21
- // MODULES //
22
-
23
- var isRangeError = require( '@stdlib/assert-is-range-error' );
24
- var isTypeError = require( '@stdlib/assert-is-type-error' );
25
- var isSyntaxError = require( '@stdlib/assert-is-syntax-error' );
26
-
27
-
28
- // MAIN //
29
-
30
- /**
31
- * Returns the error constructor for a provided error object.
32
- *
33
- * @private
34
- * @param {Error} err - error object
35
- * @returns {Function} error constructor
36
- */
37
- function errConstructor( err ) {
38
- if ( isRangeError( err ) ) {
39
- return RangeError;
40
- }
41
- if ( isTypeError( err ) ) {
42
- return TypeError;
43
- }
44
- if ( isSyntaxError( err ) ) {
45
- return SyntaxError;
46
- }
47
- return Error;
48
- }
49
-
50
-
51
- // EXPORTS //
52
-
53
- module.exports = errConstructor;