@stdlib/array-base-cuany 0.1.0 → 0.1.1
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 +1 -1
- package/README.md +5 -6
- package/dist/index.js.map +1 -1
- package/docs/types/index.d.ts +2 -2
- package/lib/assign.js +1 -1
- package/package.json +10 -10
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ See [LICENSE][stdlib-license].
|
|
|
153
153
|
|
|
154
154
|
## Copyright
|
|
155
155
|
|
|
156
|
-
Copyright © 2016-
|
|
156
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
157
157
|
|
|
158
158
|
</section>
|
|
159
159
|
|
|
@@ -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-cuany.svg
|
|
167
167
|
[npm-url]: https://npmjs.org/package/@stdlib/array-base-cuany
|
|
168
168
|
|
|
169
|
-
[test-image]: https://github.com/stdlib-js/array-base-cuany/actions/workflows/test.yml/badge.svg?branch=v0.1.
|
|
170
|
-
[test-url]: https://github.com/stdlib-js/array-base-cuany/actions/workflows/test.yml?query=branch:v0.1.
|
|
169
|
+
[test-image]: https://github.com/stdlib-js/array-base-cuany/actions/workflows/test.yml/badge.svg?branch=v0.1.1
|
|
170
|
+
[test-url]: https://github.com/stdlib-js/array-base-cuany/actions/workflows/test.yml?query=branch:v0.1.1
|
|
171
171
|
|
|
172
172
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-cuany/main.svg
|
|
173
173
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-base-cuany?branch=main
|
|
@@ -179,8 +179,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
179
179
|
|
|
180
180
|
-->
|
|
181
181
|
|
|
182
|
-
[chat-image]: https://img.shields.io/
|
|
183
|
-
[chat-url]: https://
|
|
182
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
183
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
184
184
|
|
|
185
185
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
186
186
|
|
|
@@ -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-cuany/main/LICENSE
|
|
201
201
|
|
|
202
|
-
|
|
203
202
|
</section>
|
|
204
203
|
|
|
205
204
|
<!-- /.links -->
|
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 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 at least one 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 = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = indexed( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, null ]\n*/\nfunction indexed( x, y, stride, offset ) {\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tflg = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === false && x[ i ] ) {\n\t\t\tflg = true;\n\t\t}\n\t\ty[ io ] = flg;\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Cumulatively tests whether at least one 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( [ false, false, true, false, false ] );\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 false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tif ( flg === false && xget( xdata, i ) ) {\n\t\t\tflg = true;\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 at least one 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, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = complex( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i += 2 ) {\n\t\tif ( flg === false && ( x[ i ] || x[ i+1 ] ) ) {\n\t\t\tflg = true;\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 at least one 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( [ 0, 0, 1, 1, 0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = boolean( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === false && x[ i ] ) {\n\t\t\tflg = true;\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 at least one 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 = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = assign( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, 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 least one 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 = [ false, false, true, false, false ];\n*\n* var y = cuany( x );\n* // returns [ false, false, true, true, true ]\n*/\nfunction cuany( x ) {\n\tvar y = filled( false, x.length );\n\treturn assign( x, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cuany;\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 at least one element in a provided array is truthy.\n*\n* @module @stdlib/array-base-cuany\n*\n* @example\n* var cuany = require( '@stdlib/array-base-cuany' );\n*\n* var x = [ false, false, true, false, false ];\n*\n* var y = cuany( x );\n* // returns [ false, false, true, true, true ]\n*\n* @example\n* var cuany = require( '@stdlib/array-base-cuany' );\n*\n* var x = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var arr = cuany.assign( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, 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"],
|
|
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 at least one 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 = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = indexed( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, null ]\n*/\nfunction indexed( x, y, stride, offset ) {\n\tvar flg;\n\tvar io;\n\tvar i;\n\n\tflg = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === false && x[ i ] ) {\n\t\t\tflg = true;\n\t\t}\n\t\ty[ io ] = flg;\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Cumulatively tests whether at least one 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( [ false, false, true, false, false ] );\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 false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tif ( flg === false && xget( xdata, i ) ) {\n\t\t\tflg = true;\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 at least one 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, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = complex( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i += 2 ) {\n\t\tif ( flg === false && ( x[ i ] || x[ i+1 ] ) ) {\n\t\t\tflg = true;\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 at least one 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( [ 0, 0, 1, 1, 0 ] );\n* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );\n*\n* var arr = boolean( x, arraylike2object( y ), 2, 0 );\n*\n* var v = y.get( 0 );\n* // returns false\n*\n* v = y.get( 2 );\n* // returns false\n*\n* v = y.get( 4 );\n* // returns true\n*\n* v = y.get( 6 );\n* // returns true\n*\n* v = y.get( 8 );\n* // returns true\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 = false;\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( flg === false && x[ i ] ) {\n\t\t\tflg = true;\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 at least one element in an array is truthy and assigns results to a 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 = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var out = assign( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, 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 least one 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 = [ false, false, true, false, false ];\n*\n* var y = cuany( x );\n* // returns [ false, false, true, true, true ]\n*/\nfunction cuany( x ) {\n\tvar y = filled( false, x.length );\n\treturn assign( x, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cuany;\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 at least one element in a provided array is truthy.\n*\n* @module @stdlib/array-base-cuany\n*\n* @example\n* var cuany = require( '@stdlib/array-base-cuany' );\n*\n* var x = [ false, false, true, false, false ];\n*\n* var y = cuany( x );\n* // returns [ false, false, true, true, true ]\n*\n* @example\n* var cuany = require( '@stdlib/array-base-cuany' );\n*\n* var x = [ false, false, true, false, false ];\n* var y = [ false, null, false, null, false, null, false, null, false, null ];\n*\n* var arr = cuany.assign( x, y, 2, 0 );\n* // returns [ false, null, false, null, true, null, true, null, true, 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
5
|
"mappings": "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",
|
|
6
6
|
"names": ["require_assign", "__commonJSMin", "exports", "module", "isComplex128Array", "isComplex64Array", "isBooleanArray", "arraylike2object", "reinterpret128", "reinterpret64", "reinterpretBoolean", "indexed", "x", "y", "stride", "offset", "flg", "io", "i", "accessors", "xdata", "ydata", "xget", "yset", "complex", "boolean", "assign", "xo", "yo", "require_main", "__commonJSMin", "exports", "module", "filled", "assign", "cuany", "x", "y", "setReadOnly", "main", "assign"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ interface CuAny {
|
|
|
36
36
|
* var x = [ false, false , true, false , false ];
|
|
37
37
|
*
|
|
38
38
|
* var y = cuany( x );
|
|
39
|
-
*
|
|
39
|
+
* // returns [ false, false, true, true, true ];
|
|
40
40
|
*/
|
|
41
41
|
( x: Collection | AccessorArrayLike<any> ): Array<boolean>;
|
|
42
42
|
|
|
@@ -53,7 +53,7 @@ interface CuAny {
|
|
|
53
53
|
* var x = [ false, false, true, false, false ];
|
|
54
54
|
* var y = [ false, null, false, null, false, null, false, null, false, null ];
|
|
55
55
|
*
|
|
56
|
-
* var arr = cuany.assign( x, y, 2, 0 )
|
|
56
|
+
* var arr = cuany.assign( x, y, 2, 0 );
|
|
57
57
|
* // returns [ false, null, false, null, true, null, true, null, true, null ];
|
|
58
58
|
*/
|
|
59
59
|
assign<T, U extends Collection<T> | AccessorArrayLike<T>>( x: Collection | AccessorArrayLike<any>, y: U, stride: number, offset: number ): U;
|
package/lib/assign.js
CHANGED
|
@@ -244,7 +244,7 @@ function boolean( x, y, stride, offset ) {
|
|
|
244
244
|
// MAIN //
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
|
-
* Cumulatively tests whether at least one element in an array is truthy and assigns results to provided output array.
|
|
247
|
+
* Cumulatively tests whether at least one element in an array is truthy and assigns results to a provided output array.
|
|
248
248
|
*
|
|
249
249
|
* @param {Collection} x - input array
|
|
250
250
|
* @param {Collection} y - output array
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/array-base-cuany",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Cumulatively test whether at least one element in a provided array is truthy.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/array-base-arraylike2object": "^0.2.
|
|
34
|
-
"@stdlib/array-base-assert-is-booleanarray": "^0.0.
|
|
35
|
-
"@stdlib/array-base-assert-is-complex128array": "^0.2.
|
|
36
|
-
"@stdlib/array-base-assert-is-complex64array": "^0.2.
|
|
37
|
-
"@stdlib/array-base-filled": "^0.2.
|
|
38
|
-
"@stdlib/strided-base-reinterpret-boolean": "^0.0.
|
|
39
|
-
"@stdlib/strided-base-reinterpret-complex128": "^0.2.
|
|
40
|
-
"@stdlib/strided-base-reinterpret-complex64": "^0.2.
|
|
41
|
-
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.
|
|
33
|
+
"@stdlib/array-base-arraylike2object": "^0.2.2",
|
|
34
|
+
"@stdlib/array-base-assert-is-booleanarray": "^0.0.3",
|
|
35
|
+
"@stdlib/array-base-assert-is-complex128array": "^0.2.3",
|
|
36
|
+
"@stdlib/array-base-assert-is-complex64array": "^0.2.3",
|
|
37
|
+
"@stdlib/array-base-filled": "^0.2.3",
|
|
38
|
+
"@stdlib/strided-base-reinterpret-boolean": "^0.0.3",
|
|
39
|
+
"@stdlib/strided-base-reinterpret-complex128": "^0.2.3",
|
|
40
|
+
"@stdlib/strided-base-reinterpret-complex64": "^0.2.2",
|
|
41
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {},
|
|
44
44
|
"engines": {
|