@stdlib/array-base-cuevery 0.0.1 → 0.1.0

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/README.md CHANGED
@@ -166,8 +166,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
166
166
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-cuevery.svg
167
167
  [npm-url]: https://npmjs.org/package/@stdlib/array-base-cuevery
168
168
 
169
- [test-image]: https://github.com/stdlib-js/array-base-cuevery/actions/workflows/test.yml/badge.svg?branch=v0.0.1
170
- [test-url]: https://github.com/stdlib-js/array-base-cuevery/actions/workflows/test.yml?query=branch:v0.0.1
169
+ [test-image]: https://github.com/stdlib-js/array-base-cuevery/actions/workflows/test.yml/badge.svg?branch=v0.1.0
170
+ [test-url]: https://github.com/stdlib-js/array-base-cuevery/actions/workflows/test.yml?query=branch:v0.1.0
171
171
 
172
172
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-cuevery/main.svg
173
173
  [coverage-url]: https://codecov.io/github/stdlib-js/array-base-cuevery?branch=main
@@ -199,7 +199,6 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
199
199
 
200
200
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-base-cuevery/main/LICENSE
201
201
 
202
-
203
202
  </section>
204
203
 
205
204
  <!-- /.links -->
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var f=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var l=f(function(D,p){
2
- var m=require('@stdlib/array-base-assert-is-complex128array/dist'),A=require('@stdlib/array-base-assert-is-complex64array/dist'),g=require('@stdlib/array-base-arraylike2object/dist'),C=require('@stdlib/strided-base-reinterpret-complex128/dist'),P=require('@stdlib/strided-base-reinterpret-complex64/dist');function b(r,e,s,u){var a,t,i;for(a=!0,t=u,i=0;i<r.length;i++)a===!0&&!r[i]&&(a=!1),e[t]=a,t+=s;return e}function j(r,e,s,u){var a,t,i,o,n,c,v;for(a=r.data,t=e.data,i=r.accessors[0],o=e.accessors[1],n=!0,c=u,v=0;v<a.length;v++)n===!0&&!i(a,v)&&(n=!1),o(t,c,n),c+=s;return t}function q(r,e,s,u){var a,t,i,o,n;for(t=e.accessors[1],a=e.data,i=!0,o=u,n=0;n<r.length;n+=2)i===!0&&!(r[n]||r[n+1])&&(i=!1),t(a,o,i),o+=s;return a}function k(r,e,s,u){var a=g(r),t=g(e);return a.accessorProtocol||t.accessorProtocol?(m(r)?q(C(r,0),t,s,u):A(r)?q(P(r,0),t,s,u):j(a,t,s,u),e):(b(r,e,s,u),e)}p.exports=k
3
- });var y=f(function(E,d){
4
- var O=require('@stdlib/array-base-filled/dist'),R=l();function w(r){var e=O(!0,r.length);return R(r,e,1,0)}d.exports=w
5
- });var x=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),h=y(),z=l();x(h,"assign",z);module.exports=h;
1
+ "use strict";var f=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var l=f(function(H,p){
2
+ var m=require('@stdlib/array-base-assert-is-complex128array/dist'),A=require('@stdlib/array-base-assert-is-complex64array/dist'),b=require('@stdlib/array-base-assert-is-booleanarray/dist'),g=require('@stdlib/array-base-arraylike2object/dist'),B=require('@stdlib/strided-base-reinterpret-complex128/dist'),C=require('@stdlib/strided-base-reinterpret-complex64/dist'),P=require('@stdlib/strided-base-reinterpret-boolean/dist');function j(r,e,o,u){var a,t,i;for(a=!0,t=u,i=0;i<r.length;i++)a===!0&&!r[i]&&(a=!1),e[t]=a,t+=o;return e}function k(r,e,o,u){var a,t,i,n,s,c,v;for(a=r.data,t=e.data,i=r.accessors[0],n=e.accessors[1],s=!0,c=u,v=0;v<a.length;v++)s===!0&&!i(a,v)&&(s=!1),n(t,c,s),c+=o;return t}function q(r,e,o,u){var a,t,i,n,s;for(t=e.accessors[1],a=e.data,i=!0,n=u,s=0;s<r.length;s+=2)i===!0&&!(r[s]||r[s+1])&&(i=!1),t(a,n,i),n+=o;return a}function O(r,e,o,u){var a,t,i,n,s;for(t=e.accessors[1],a=e.data,i=!0,n=u,s=0;s<r.length;s++)i===!0&&!r[s]&&(i=!1),t(a,n,i),n+=o;return a}function R(r,e,o,u){var a=g(r),t=g(e);return a.accessorProtocol||t.accessorProtocol?(m(r)?q(B(r,0),t,o,u):A(r)?q(C(r,0),t,o,u):b(r)?O(P(r,0),t,o,u):k(a,t,o,u),e):(j(r,e,o,u),e)}p.exports=R
3
+ });var y=f(function(I,d){
4
+ var w=require('@stdlib/array-base-filled/dist'),z=l();function D(r){var e=w(!0,r.length);return z(r,e,1,0)}d.exports=D
5
+ });var E=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),h=y(),F=l();E(h,"assign",F);module.exports=h;
6
6
  /** @license Apache-2.0 */
7
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/assign.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 isComplex128Array = require( '@stdlib/array-base-assert-is-complex128array' );\nvar isComplex64Array = require( '@stdlib/array-base-assert-is-complex64array' );\nvar arraylike2object = require( '@stdlib/array-base-arraylike2object' );\nvar reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );\n\n\n// FUNCTIONS //\n\n/**\n* Cumulatively tests whether every element in an indexed array is truthy.\n*\n* @private\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = indexed( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*/\nfunction indexed( x, y, stride, offset ) {\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === true && !x[ i ] ) {\n\t\t\tflg = false;\n\t\t}\n\t\ty[ io ] = flg;\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Cumulatively tests whether every element in a provided accessor array is truthy.\n*\n* @private\n* @param {Object} x - input array object\n* @param {Object} y - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array-base-arraylike2object' );\n*\n* var x = toAccessorArray( [ true, true, true, false, true ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = accessors( arraylike2object( x ), arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns true\n*\n* v = y.get( 2 );\n* // returns true\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns false\n*\n* v = y.get( 8 );\n* // returns false\n*/\nfunction accessors( x, y, stride, offset ) {\n\tvar xdata;\n\tvar ydata;\n\tvar xget;\n\tvar yset;\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\txdata = x.data;\n\tydata = y.data;\n\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tif ( flg === true && !xget( xdata, i ) ) {\n\t\t\tflg = false;\n\t\t}\n\t\tyset( ydata, io, flg );\n\t\tio += stride;\n\t}\n\treturn ydata;\n}\n\n/**\n* Cumulatively tests whether every element in a provided complex number array is truthy.\n*\n* @private\n* @param {Collection} x - array containing interleaved real and imaginary components\n* @param {Object} y - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array-base-arraylike2object' );\n*\n* var x = new Float64Array( [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, true, null ] );\n*\n* var arr = complex( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns true\n*\n* v = y.get( 2 );\n* // returns true\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns false\n*\n* v = y.get( 8 );\n* // returns false\n*/\nfunction complex( x, y, stride, offset ) {\n\tvar ydata;\n\tvar yset;\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tyset = y.accessors[ 1 ];\n\tydata = y.data;\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i += 2 ) {\n\t\tif ( flg === true && !( x[ i ] || x[ i+1 ] ) ) {\n\t\t\tflg = false;\n\t\t}\n\t\tyset( ydata, io, flg );\n\t\tio += stride;\n\t}\n\treturn ydata;\n}\n\n\n// MAIN //\n\n/**\n* Cumulatively tests whether every element in an array is truthy and assigns results to provided output array.\n*\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = assign( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\nfunction assign( x, y, stride, offset ) {\n\tvar xo = arraylike2object( x );\n\tvar yo = arraylike2object( y );\n\tif (\n\t\txo.accessorProtocol ||\n\t\tyo.accessorProtocol\n\t) {\n\t\t// If provided a complex number array, reinterpret as a real typed array and test interleaved real and imaginary components, where we consider a complex number to be truthy if at least one component is non-zero...\n\t\tif ( isComplex128Array( x ) ) {\n\t\t\tcomplex( reinterpret128( x, 0 ), yo, stride, offset );\n\t\t} else if ( isComplex64Array( x ) ) {\n\t\t\tcomplex( reinterpret64( x, 0 ), yo, stride, offset );\n\t\t} else {\n\t\t\taccessors( xo, yo, stride, offset );\n\t\t}\n\t\treturn y;\n\t}\n\tindexed( x, y, stride, offset );\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = assign;\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 filled = require( '@stdlib/array-base-filled' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Cumulatively tests whether at every element in a provided array is truthy.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n*\n* var y = cuevery( x );\n* // returns [ true, true, true, false, false ];\n*/\nfunction cuevery( x ) {\n\tvar y = filled( true, x.length );\n\treturn assign( x, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cuevery;\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* Cumulatively test whether every element in a provided array is truthy.\n*\n* @module @stdlib/array-base-cuevery\n*\n* @example\n* var cuevery = require( '@stdlib/array-base-cuevery' );\n*\n* var x = [ true, true, true, false, true ]\n*\n* var y = cuevery( x );\n* // returns [ true, true, true, false, false ]\n*\n* @example\n* var cuevery = require( '@stdlib/array-base-cuevery' );\n*\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var arr = cuevery.assign( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,8CAA+C,EAC5EC,EAAmB,QAAS,6CAA8C,EAC1EC,EAAmB,QAAS,qCAAsC,EAClEC,EAAiB,QAAS,6CAA8C,EACxEC,EAAgB,QAAS,4CAA6C,EAsB1E,SAASC,EAASC,EAAGC,EAAGC,EAAQC,EAAS,CACxC,IAAIC,EACAC,EACA,EAIJ,IAFAD,EAAM,GACNC,EAAKF,EACC,EAAI,EAAG,EAAIH,EAAE,OAAQ,IACrBI,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QC,CAAO,EAE5BF,IAERF,EAASC,EAAGC,EAAGC,EAAQC,CAAO,EACvBF,EACR,CAKAR,EAAO,QAAUoB,ICrOjB,IAAAG,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,2BAA4B,EAC9CC,EAAS,IAiBb,SAASC,EAASC,EAAI,CACrB,IAAIC,EAAIJ,EAAQ,GAAMG,EAAE,MAAO,EAC/B,OAAOF,EAAQE,EAAGC,EAAG,EAAG,CAAE,CAC3B,CAKAL,EAAO,QAAUG,ICHjB,IAAIG,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAS,IAKbF,EAAaC,EAAM,SAAUC,CAAO,EAKpC,OAAO,QAAUD",
6
- "names": ["require_assign", "__commonJSMin", "exports", "module", "isComplex128Array", "isComplex64Array", "arraylike2object", "reinterpret128", "reinterpret64", "indexed", "x", "y", "stride", "offset", "flg", "io", "accessors", "xdata", "ydata", "xget", "yset", "i", "complex", "assign", "xo", "yo", "require_main", "__commonJSMin", "exports", "module", "filled", "assign", "cuevery", "x", "y", "setReadOnly", "main", "assign"]
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 isComplex128Array = require( '@stdlib/array-base-assert-is-complex128array' );\nvar isComplex64Array = require( '@stdlib/array-base-assert-is-complex64array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar arraylike2object = require( '@stdlib/array-base-arraylike2object' );\nvar reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );\nvar reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\n\n\n// FUNCTIONS //\n\n/**\n* Cumulatively tests whether every element in an indexed array is truthy.\n*\n* @private\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = indexed( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*/\nfunction indexed( x, y, stride, offset ) {\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === true && !x[ i ] ) {\n\t\t\tflg = false;\n\t\t}\n\t\ty[ io ] = flg;\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Cumulatively tests whether every element in a provided accessor array is truthy.\n*\n* @private\n* @param {Object} x - input array object\n* @param {Object} y - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array-base-arraylike2object' );\n*\n* var x = toAccessorArray( [ true, true, true, false, true ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = accessors( arraylike2object( x ), arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns true\n*\n* v = y.get( 2 );\n* // returns true\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns false\n*\n* v = y.get( 8 );\n* // returns false\n*/\nfunction accessors( x, y, stride, offset ) {\n\tvar xdata;\n\tvar ydata;\n\tvar xget;\n\tvar yset;\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\txdata = x.data;\n\tydata = y.data;\n\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tif ( flg === true && !xget( xdata, i ) ) {\n\t\t\tflg = false;\n\t\t}\n\t\tyset( ydata, io, flg );\n\t\tio += stride;\n\t}\n\treturn ydata;\n}\n\n/**\n* Cumulatively tests whether every element in a provided complex number array is truthy.\n*\n* @private\n* @param {Collection} x - array containing interleaved real and imaginary components\n* @param {Object} y - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array-base-arraylike2object' );\n*\n* var x = new Float64Array( [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, true, null ] );\n*\n* var arr = complex( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns true\n*\n* v = y.get( 2 );\n* // returns true\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns false\n*\n* v = y.get( 8 );\n* // returns false\n*/\nfunction complex( x, y, stride, offset ) {\n\tvar ydata;\n\tvar yset;\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tyset = y.accessors[ 1 ];\n\tydata = y.data;\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i += 2 ) {\n\t\tif ( flg === true && !( x[ i ] || x[ i+1 ] ) ) {\n\t\t\tflg = false;\n\t\t}\n\t\tyset( ydata, io, flg );\n\t\tio += stride;\n\t}\n\treturn ydata;\n}\n\n/**\n* Cumulatively tests whether every element in a provided boolean array is truthy.\n*\n* @private\n* @param {Collection} x - input array\n* @param {Object} y - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var Uint8Array = require( '@stdlib/array-uint8' );\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array-base-arraylike2object' );\n*\n* var x = new Uint8Array( [ 1, 1, 1, 0, 1 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, true, null ] );\n*\n* var arr = boolean( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns true\n*\n* v = y.get( 2 );\n* // returns true\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns false\n*\n* v = y.get( 8 );\n* // returns false\n*/\nfunction boolean( x, y, stride, offset ) {\n\tvar ydata;\n\tvar yset;\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tyset = y.accessors[ 1 ];\n\tydata = y.data;\n\n\tflg = true;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === true && !x[ i ] ) {\n\t\t\tflg = false;\n\t\t}\n\t\tyset( ydata, io, flg );\n\t\tio += stride;\n\t}\n\treturn ydata;\n}\n\n\n// MAIN //\n\n/**\n* Cumulatively tests whether every element in an array is truthy and assigns results to provided output array.\n*\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {Collection} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = assign( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\nfunction assign( x, y, stride, offset ) {\n\tvar xo = arraylike2object( x );\n\tvar yo = arraylike2object( y );\n\tif (\n\t\txo.accessorProtocol ||\n\t\tyo.accessorProtocol\n\t) {\n\t\t// If provided a complex number array, reinterpret as a real typed array and test interleaved real and imaginary components, where we consider a complex number to be truthy if at least one component is non-zero...\n\t\tif ( isComplex128Array( x ) ) {\n\t\t\tcomplex( reinterpret128( x, 0 ), yo, stride, offset );\n\t\t} else if ( isComplex64Array( x ) ) {\n\t\t\tcomplex( reinterpret64( x, 0 ), yo, stride, offset );\n\t\t} else if ( isBooleanArray( x ) ) {\n\t\t\tboolean( reinterpretBoolean( x, 0 ), yo, stride, offset );\n\t\t} else {\n\t\t\taccessors( xo, yo, stride, offset );\n\t\t}\n\t\treturn y;\n\t}\n\tindexed( x, y, stride, offset );\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = assign;\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 filled = require( '@stdlib/array-base-filled' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Cumulatively tests whether at every element in a provided array is truthy.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var x = [ true, true, true, false, true ];\n*\n* var y = cuevery( x );\n* // returns [ true, true, true, false, false ];\n*/\nfunction cuevery( x ) {\n\tvar y = filled( true, x.length );\n\treturn assign( x, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cuevery;\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* Cumulatively test whether every element in a provided array is truthy.\n*\n* @module @stdlib/array-base-cuevery\n*\n* @example\n* var cuevery = require( '@stdlib/array-base-cuevery' );\n*\n* var x = [ true, true, true, false, true ]\n*\n* var y = cuevery( x );\n* // returns [ true, true, true, false, false ]\n*\n* @example\n* var cuevery = require( '@stdlib/array-base-cuevery' );\n*\n* var x = [ true, true, true, false, true ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var arr = cuevery.assign( x, y, 2, 0 );\n* // returns [ true, null, true, null, true, null, false, null, false, null ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAoB,QAAS,8CAA+C,EAC5EC,EAAmB,QAAS,6CAA8C,EAC1EC,EAAiB,QAAS,2CAA4C,EACtEC,EAAmB,QAAS,qCAAsC,EAClEC,EAAiB,QAAS,6CAA8C,EACxEC,EAAgB,QAAS,4CAA6C,EACtEC,EAAqB,QAAS,0CAA2C,EAsB7E,SAASC,EAASC,EAAGC,EAAGC,EAAQC,EAAS,CACxC,IAAIC,EACAC,EACA,EAIJ,IAFAD,EAAM,GACNC,EAAKF,EACC,EAAI,EAAG,EAAIH,EAAE,OAAQ,IACrBI,IAAQ,IAAQ,CAACJ,EAAG,CAAE,IAC1BI,EAAM,IAEPH,EAAGI,CAAG,EAAID,EACVC,GAAMH,EAEP,OAAOD,CACR,CAoCA,SAASK,EAAWN,EAAGC,EAAGC,EA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AmBQ,CAAE,EACzBY,EAAShB,EAAgBI,EAAG,CAAE,EAAGgB,EAAId,EAAQC,CAAO,EACzCV,EAAkBO,CAAE,EAC/BY,EAASf,EAAeG,EAAG,CAAE,EAAGgB,EAAId,EAAQC,CAAO,EACxCT,EAAgBM,CAAE,EAC7Ba,EAASf,EAAoBE,EAAG,CAAE,EAAGgB,EAAId,EAAQC,CAAO,EAExDG,EAAWS,EAAIC,EAAId,EAAQC,CAAO,EAE5BF,IAERF,EAASC,EAAGC,EAAGC,EAAQC,CAAO,EACvBF,EACR,CAKAV,EAAO,QAAUuB,IClSjB,IAAAG,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,2BAA4B,EAC9CC,EAAS,IAiBb,SAASC,EAASC,EAAI,CACrB,IAAIC,EAAIJ,EAAQ,GAAMG,EAAE,MAAO,EAC/B,OAAOF,EAAQE,EAAGC,EAAG,EAAG,CAAE,CAC3B,CAKAL,EAAO,QAAUG,ICHjB,IAAIG,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAS,IAKbF,EAAaC,EAAM,SAAUC,CAAO,EAKpC,OAAO,QAAUD",
6
+ "names": ["require_assign", "__commonJSMin", "exports", "module", "isComplex128Array", "isComplex64Array", "isBooleanArray", "arraylike2object", "reinterpret128", "reinterpret64", "reinterpretBoolean", "indexed", "x", "y", "stride", "offset", "flg", "io", "accessors", "xdata", "ydata", "xget", "yset", "i", "complex", "boolean", "assign", "xo", "yo", "require_main", "__commonJSMin", "exports", "module", "filled", "assign", "cuevery", "x", "y", "setReadOnly", "main", "assign"]
7
7
  }
package/lib/assign.js CHANGED
@@ -22,9 +22,11 @@
22
22
 
23
23
  var isComplex128Array = require( '@stdlib/array-base-assert-is-complex128array' );
24
24
  var isComplex64Array = require( '@stdlib/array-base-assert-is-complex64array' );
25
+ var isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );
25
26
  var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
26
27
  var reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );
27
28
  var reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );
29
+ var reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );
28
30
 
29
31
 
30
32
  // FUNCTIONS //
@@ -181,6 +183,63 @@ function complex( x, y, stride, offset ) {
181
183
  return ydata;
182
184
  }
183
185
 
186
+ /**
187
+ * Cumulatively tests whether every element in a provided boolean array is truthy.
188
+ *
189
+ * @private
190
+ * @param {Collection} x - input array
191
+ * @param {Object} y - output array object
192
+ * @param {integer} stride - output array stride
193
+ * @param {NonNegativeInteger} offset - output array offset
194
+ * @returns {Collection} output array
195
+ *
196
+ * @example
197
+ * var Uint8Array = require( '@stdlib/array-uint8' );
198
+ * var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );
199
+ * var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
200
+ *
201
+ * var x = new Uint8Array( [ 1, 1, 1, 0, 1 ] );
202
+ * var y = toAccessorArray( [ false, null, false, null, false, null, false, null, true, null ] );
203
+ *
204
+ * var arr = boolean( x, arraylike2object( y ), 2, 0 );
205
+ *
206
+ * var v = y.get( 0 );
207
+ * // returns true
208
+ *
209
+ * v = y.get( 2 );
210
+ * // returns true
211
+ *
212
+ * v = y.get( 4 );
213
+ * // returns true
214
+ *
215
+ * v = y.get( 6 );
216
+ * // returns false
217
+ *
218
+ * v = y.get( 8 );
219
+ * // returns false
220
+ */
221
+ function boolean( x, y, stride, offset ) {
222
+ var ydata;
223
+ var yset;
224
+ var flg;
225
+ var io;
226
+ var i;
227
+
228
+ yset = y.accessors[ 1 ];
229
+ ydata = y.data;
230
+
231
+ flg = true;
232
+ io = offset;
233
+ for ( i = 0; i < x.length; i++ ) {
234
+ if ( flg === true && !x[ i ] ) {
235
+ flg = false;
236
+ }
237
+ yset( ydata, io, flg );
238
+ io += stride;
239
+ }
240
+ return ydata;
241
+ }
242
+
184
243
 
185
244
  // MAIN //
186
245
 
@@ -215,6 +274,8 @@ function assign( x, y, stride, offset ) {
215
274
  complex( reinterpret128( x, 0 ), yo, stride, offset );
216
275
  } else if ( isComplex64Array( x ) ) {
217
276
  complex( reinterpret64( x, 0 ), yo, stride, offset );
277
+ } else if ( isBooleanArray( x ) ) {
278
+ boolean( reinterpretBoolean( x, 0 ), yo, stride, offset );
218
279
  } else {
219
280
  accessors( xo, yo, stride, offset );
220
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/array-base-cuevery",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Cumulatively test whether every element in a provided array is truthy.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -31,12 +31,14 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@stdlib/array-base-arraylike2object": "^0.2.1",
34
- "@stdlib/array-base-assert-is-complex128array": "^0.2.1",
35
- "@stdlib/array-base-assert-is-complex64array": "^0.2.1",
36
- "@stdlib/array-base-filled": "^0.2.1",
37
- "@stdlib/strided-base-reinterpret-complex128": "^0.2.1",
38
- "@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
39
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1"
34
+ "@stdlib/array-base-assert-is-booleanarray": "^0.0.2",
35
+ "@stdlib/array-base-assert-is-complex128array": "^0.2.2",
36
+ "@stdlib/array-base-assert-is-complex64array": "^0.2.2",
37
+ "@stdlib/array-base-filled": "^0.2.2",
38
+ "@stdlib/strided-base-reinterpret-boolean": "^0.0.2",
39
+ "@stdlib/strided-base-reinterpret-complex128": "^0.2.2",
40
+ "@stdlib/strided-base-reinterpret-complex64": "^0.2.1",
41
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
40
42
  },
41
43
  "devDependencies": {},
42
44
  "engines": {