@stdlib/array-base-cuevery 0.0.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/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
package/NOTICE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2016-2024 The Stdlib Authors.
package/README.md ADDED
@@ -0,0 +1,205 @@
1
+ <!--
2
+
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2024 The Stdlib Authors.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ -->
20
+
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
32
+ # cuevery
33
+
34
+ [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
35
+
36
+ > Cumulatively test whether every element in a provided array is truthy.
37
+
38
+ <section class="installation">
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ npm install @stdlib/array-base-cuevery
44
+ ```
45
+
46
+ </section>
47
+
48
+ <section class="usage">
49
+
50
+ ## Usage
51
+
52
+ ```javascript
53
+ var cuevery = require( '@stdlib/array-base-cuevery' );
54
+ ```
55
+
56
+ #### cuevery( x )
57
+
58
+ Cumulatively tests whether every element in a provided array is truthy.
59
+
60
+ ```javascript
61
+ var x = [ true, true, true, false, true ];
62
+
63
+ var y = cuevery( x );
64
+ // returns [ true, true, true, false, false ];
65
+ ```
66
+
67
+ #### cuevery.assign( x, out, stride, offset )
68
+
69
+ Cumulatively tests whether every element in a provided array is truthy and assigns results to a provided output array.
70
+
71
+ ```javascript
72
+ var x = [ true, true, true, false, true ];
73
+ var y = [ false, null, false, null, false, null, false, null, false, null ];
74
+
75
+ var out = cuevery.assign( x, y, 2, 0 );
76
+ // returns [ true, null, true, null, true, null, false, null, false, null ]
77
+
78
+ var bool = ( out === y );
79
+ // returns true
80
+ ```
81
+
82
+ The function supports the following parameters:
83
+
84
+ - **x**: input array.
85
+ - **out**: output array.
86
+ - **stride**: output array stride.
87
+ - **offset**: output array offset.
88
+
89
+ </section>
90
+
91
+ <!-- /.usage -->
92
+
93
+ <section class="notes">
94
+
95
+ </section>
96
+
97
+ <!-- /.notes -->
98
+
99
+ <section class="examples">
100
+
101
+ ## Examples
102
+
103
+ <!-- eslint no-undef: "error" -->
104
+
105
+ ```javascript
106
+ var bernoulli = require( '@stdlib/random-array-bernoulli' );
107
+ var cuevery = require( '@stdlib/array-base-cuevery' );
108
+
109
+ // Create an array of random values:
110
+ var x = bernoulli( 10, 0.9 );
111
+ console.log( x );
112
+
113
+ // Cumulatively determine whether values are truthy:
114
+ var out = cuevery( x );
115
+ console.log( out );
116
+ ```
117
+
118
+ </section>
119
+
120
+ <!-- /.examples -->
121
+
122
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
123
+
124
+ <section class="related">
125
+
126
+ </section>
127
+
128
+ <!-- /.related -->
129
+
130
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
131
+
132
+
133
+ <section class="main-repo" >
134
+
135
+ * * *
136
+
137
+ ## Notice
138
+
139
+ This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
140
+
141
+ For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
142
+
143
+ #### Community
144
+
145
+ [![Chat][chat-image]][chat-url]
146
+
147
+ ---
148
+
149
+ ## License
150
+
151
+ See [LICENSE][stdlib-license].
152
+
153
+
154
+ ## Copyright
155
+
156
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
157
+
158
+ </section>
159
+
160
+ <!-- /.stdlib -->
161
+
162
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
163
+
164
+ <section class="links">
165
+
166
+ [npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-cuevery.svg
167
+ [npm-url]: https://npmjs.org/package/@stdlib/array-base-cuevery
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
171
+
172
+ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-cuevery/main.svg
173
+ [coverage-url]: https://codecov.io/github/stdlib-js/array-base-cuevery?branch=main
174
+
175
+ <!--
176
+
177
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/array-base-cuevery.svg
178
+ [dependencies-url]: https://david-dm.org/stdlib-js/array-base-cuevery/main
179
+
180
+ -->
181
+
182
+ [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
183
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
184
+
185
+ [stdlib]: https://github.com/stdlib-js/stdlib
186
+
187
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
188
+
189
+ [umd]: https://github.com/umdjs/umd
190
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
191
+
192
+ [deno-url]: https://github.com/stdlib-js/array-base-cuevery/tree/deno
193
+ [deno-readme]: https://github.com/stdlib-js/array-base-cuevery/blob/deno/README.md
194
+ [umd-url]: https://github.com/stdlib-js/array-base-cuevery/tree/umd
195
+ [umd-readme]: https://github.com/stdlib-js/array-base-cuevery/blob/umd/README.md
196
+ [esm-url]: https://github.com/stdlib-js/array-base-cuevery/tree/esm
197
+ [esm-readme]: https://github.com/stdlib-js/array-base-cuevery/blob/esm/README.md
198
+ [branches-url]: https://github.com/stdlib-js/array-base-cuevery/blob/main/branches.md
199
+
200
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-base-cuevery/main/LICENSE
201
+
202
+
203
+ </section>
204
+
205
+ <!-- /.links -->
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import cuevery from '../docs/types/index';
3
+ export = cuevery;
package/dist/index.js ADDED
@@ -0,0 +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;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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,IAAQ,IAAQ,CAACJ,EAAG,CAAE,IAC1BI,EAAM,IAEPH,EAAGI,CAAG,EAAID,EACVC,GAAMH,EAEP,OAAOD,CACR,CAoCA,SAASK,EAAWN,EAAGC,EAAGC,EAAQC,EAAS,CAC1C,IAAII,EACAC,EACAC,EACAC,EACAN,EACAC,EACAM,EAUJ,IARAJ,EAAQP,EAAE,KACVQ,EAAQP,EAAE,KAEVQ,EAAOT,EAAE,UAAW,CAAE,EACtBU,EAAOT,EAAE,UAAW,CAAE,EAEtBG,EAAM,GACNC,EAAKF,EACCQ,EAAI,EAAGA,EAAIJ,EAAM,OAAQI,IACzBP,IAAQ,IAAQ,CAACK,EAAMF,EAAOI,CAAE,IACpCP,EAAM,IAEPM,EAAMF,EAAOH,EAAID,CAAI,EACrBC,GAAMH,EAEP,OAAOM,CACR,CAqCA,SAASI,EAASZ,EAAGC,EAAGC,EAAQC,EAAS,CACxC,IAAIK,EACAE,EACAN,EACAC,EACAM,EAOJ,IALAD,EAAOT,EAAE,UAAW,CAAE,EACtBO,EAAQP,EAAE,KAEVG,EAAM,GACNC,EAAKF,EACCQ,EAAI,EAAGA,EAAIX,EAAE,OAAQW,GAAK,EAC1BP,IAAQ,IAAQ,EAAGJ,EAAGW,CAAE,GAAKX,EAAGW,EAAE,CAAE,KACxCP,EAAM,IAEPM,EAAMF,EAAOH,EAAID,CAAI,EACrBC,GAAMH,EAEP,OAAOM,CACR,CAwBA,SAASK,EAAQb,EAAGC,EAAGC,EAAQC,EAAS,CACvC,IAAIW,EAAKlB,EAAkBI,CAAE,EACzBe,EAAKnB,EAAkBK,CAAE,EAC7B,OACCa,EAAG,kBACHC,EAAG,kBAGErB,EAAmBM,CAAE,EACzBY,EAASf,EAAgBG,EAAG,CAAE,EAAGe,EAAIb,EAAQC,CAAO,EACzCR,EAAkBK,CAAE,EAC/BY,EAASd,EAAeE,EAAG,CAAE,EAAGe,EAAIb,EAAQC,CAAO,EAEnDG,EAAWQ,EAAIC,EAAIb,EAAQC,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"]
7
+ }
@@ -0,0 +1,86 @@
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
+ // TypeScript Version: 4.1
20
+
21
+ /// <reference types="@stdlib/types"/>
22
+
23
+ import { Collection, AccessorArrayLike } from '@stdlib/types/array';
24
+
25
+ /**
26
+ * Interface describing `cuevery`.
27
+ */
28
+ interface CuEvery {
29
+ /**
30
+ * Cumulatively tests whether every element in a provided array is truthy.
31
+ *
32
+ * @param x - input array
33
+ * @returns output array
34
+ *
35
+ * @example
36
+ * var x = [ true, true, true, false, true ];
37
+ *
38
+ * var y = cuevery( x );
39
+ * // returns [ true, true, true, false, false ];
40
+ */
41
+ ( x: Collection | AccessorArrayLike<any> ): Array<boolean>;
42
+
43
+ /**
44
+ * Cumulatively tests whether every element in an array is truthy and assigns the results to a provided output array.
45
+ *
46
+ * @param x - input array
47
+ * @param y - output array
48
+ * @param stride - output array stride
49
+ * @param offset - output array offset
50
+ * @returns output array
51
+ *
52
+ * @example
53
+ * var x = [ true, true, true, false, false ];
54
+ * var y = [ false, null, false, null, false, null, false, null, false, null ];
55
+ *
56
+ * var arr = cuevery.assign( x, y, 2, 0 );,
57
+ * // returns [ true, null, true, null, true, null, false, null, false, null ];
58
+ */
59
+ assign<T, U extends Collection<T> | AccessorArrayLike<T>>( x: Collection | AccessorArrayLike<any>, y: U, stride: number, offset: number ): U;
60
+ }
61
+
62
+ /**
63
+ * Cumulatively tests whether every element in a provided array is truthy.
64
+ *
65
+ * @param x - input array
66
+ * @returns output array
67
+ *
68
+ * @example
69
+ * var x = [ true, true, true, false, true ];
70
+ *
71
+ * var result = cuevery( x );
72
+ * // returns [ true, true, true, false, false ];
73
+ *
74
+ * @example
75
+ * var x = [ true, true, true, false, true ];
76
+ * var y = [ false, null, false, null, false, null, false, null, false, null ];
77
+ *
78
+ * var arr = cuevery.assign( x, y, 2, 0 );
79
+ * // returns [ true, null, true, null, true, null, false, null, false, null ];
80
+ */
81
+ declare var cuevery: CuEvery;
82
+
83
+
84
+ // EXPORTS //
85
+
86
+ export = cuevery;
package/lib/assign.js ADDED
@@ -0,0 +1,230 @@
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 isComplex128Array = require( '@stdlib/array-base-assert-is-complex128array' );
24
+ var isComplex64Array = require( '@stdlib/array-base-assert-is-complex64array' );
25
+ var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
26
+ var reinterpret128 = require( '@stdlib/strided-base-reinterpret-complex128' );
27
+ var reinterpret64 = require( '@stdlib/strided-base-reinterpret-complex64' );
28
+
29
+
30
+ // FUNCTIONS //
31
+
32
+ /**
33
+ * Cumulatively tests whether every element in an indexed array is truthy.
34
+ *
35
+ * @private
36
+ * @param {Collection} x - input array
37
+ * @param {Collection} y - output array
38
+ * @param {integer} stride - output array stride
39
+ * @param {NonNegativeInteger} offset - output array offset
40
+ * @returns {Collection} output array
41
+ *
42
+ * @example
43
+ * var x = [ true, true, true, false, true ];
44
+ * var y = [ false, null, false, null, false, null, false, null, false, null ];
45
+ *
46
+ * var out = indexed( x, y, 2, 0 );
47
+ * // returns [ true, null, true, null, true, null, false, null, false, null ]
48
+ */
49
+ function indexed( x, y, stride, offset ) {
50
+ var flg;
51
+ var io;
52
+ var i;
53
+
54
+ flg = true;
55
+ io = offset;
56
+ for ( i = 0; i < x.length; i++ ) {
57
+ if ( flg === true && !x[ i ] ) {
58
+ flg = false;
59
+ }
60
+ y[ io ] = flg;
61
+ io += stride;
62
+ }
63
+ return y;
64
+ }
65
+
66
+ /**
67
+ * Cumulatively tests whether every element in a provided accessor array is truthy.
68
+ *
69
+ * @private
70
+ * @param {Object} x - input array object
71
+ * @param {Object} y - output array object
72
+ * @param {integer} stride - output array stride
73
+ * @param {NonNegativeInteger} offset - output array offset
74
+ * @returns {Collection} output array
75
+ *
76
+ * @example
77
+ * var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );
78
+ * var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
79
+ *
80
+ * var x = toAccessorArray( [ true, true, true, false, true ] );
81
+ * var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );
82
+ *
83
+ * var arr = accessors( arraylike2object( x ), arraylike2object( y ), 2, 0 );
84
+ *
85
+ * var v = y.get( 0 );
86
+ * // returns true
87
+ *
88
+ * v = y.get( 2 );
89
+ * // returns true
90
+ *
91
+ * v = y.get( 4 );
92
+ * // returns true
93
+ *
94
+ * v = y.get( 6 );
95
+ * // returns false
96
+ *
97
+ * v = y.get( 8 );
98
+ * // returns false
99
+ */
100
+ function accessors( x, y, stride, offset ) {
101
+ var xdata;
102
+ var ydata;
103
+ var xget;
104
+ var yset;
105
+ var flg;
106
+ var io;
107
+ var i;
108
+
109
+ xdata = x.data;
110
+ ydata = y.data;
111
+
112
+ xget = x.accessors[ 0 ];
113
+ yset = y.accessors[ 1 ];
114
+
115
+ flg = true;
116
+ io = offset;
117
+ for ( i = 0; i < xdata.length; i++ ) {
118
+ if ( flg === true && !xget( xdata, i ) ) {
119
+ flg = false;
120
+ }
121
+ yset( ydata, io, flg );
122
+ io += stride;
123
+ }
124
+ return ydata;
125
+ }
126
+
127
+ /**
128
+ * Cumulatively tests whether every element in a provided complex number array is truthy.
129
+ *
130
+ * @private
131
+ * @param {Collection} x - array containing interleaved real and imaginary components
132
+ * @param {Object} y - output array object
133
+ * @param {integer} stride - output array stride
134
+ * @param {NonNegativeInteger} offset - output array offset
135
+ * @returns {Collection} output array
136
+ *
137
+ * @example
138
+ * var Float64Array = require( '@stdlib/array-float64' );
139
+ * var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );
140
+ * var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
141
+ *
142
+ * var x = new Float64Array( [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0 ] );
143
+ * var y = toAccessorArray( [ false, null, false, null, false, null, false, null, true, null ] );
144
+ *
145
+ * var arr = complex( x, arraylike2object( y ), 2, 0 );
146
+ *
147
+ * var v = y.get( 0 );
148
+ * // returns true
149
+ *
150
+ * v = y.get( 2 );
151
+ * // returns true
152
+ *
153
+ * v = y.get( 4 );
154
+ * // returns true
155
+ *
156
+ * v = y.get( 6 );
157
+ * // returns false
158
+ *
159
+ * v = y.get( 8 );
160
+ * // returns false
161
+ */
162
+ function complex( x, y, stride, offset ) {
163
+ var ydata;
164
+ var yset;
165
+ var flg;
166
+ var io;
167
+ var i;
168
+
169
+ yset = y.accessors[ 1 ];
170
+ ydata = y.data;
171
+
172
+ flg = true;
173
+ io = offset;
174
+ for ( i = 0; i < x.length; i += 2 ) {
175
+ if ( flg === true && !( x[ i ] || x[ i+1 ] ) ) {
176
+ flg = false;
177
+ }
178
+ yset( ydata, io, flg );
179
+ io += stride;
180
+ }
181
+ return ydata;
182
+ }
183
+
184
+
185
+ // MAIN //
186
+
187
+ /**
188
+ * Cumulatively tests whether every element in an array is truthy and assigns results to provided output array.
189
+ *
190
+ * @param {Collection} x - input array
191
+ * @param {Collection} y - output array
192
+ * @param {integer} stride - output array stride
193
+ * @param {NonNegativeInteger} offset - output array offset
194
+ * @returns {Collection} output array
195
+ *
196
+ * @example
197
+ * var x = [ true, true, true, false, true ];
198
+ * var y = [ false, null, false, null, false, null, false, null, false, null ];
199
+ *
200
+ * var out = assign( x, y, 2, 0 );
201
+ * // returns [ true, null, true, null, true, null, false, null, false, null ]
202
+ *
203
+ * var bool = ( y === out );
204
+ * // returns true
205
+ */
206
+ function assign( x, y, stride, offset ) {
207
+ var xo = arraylike2object( x );
208
+ var yo = arraylike2object( y );
209
+ if (
210
+ xo.accessorProtocol ||
211
+ yo.accessorProtocol
212
+ ) {
213
+ // 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...
214
+ if ( isComplex128Array( x ) ) {
215
+ complex( reinterpret128( x, 0 ), yo, stride, offset );
216
+ } else if ( isComplex64Array( x ) ) {
217
+ complex( reinterpret64( x, 0 ), yo, stride, offset );
218
+ } else {
219
+ accessors( xo, yo, stride, offset );
220
+ }
221
+ return y;
222
+ }
223
+ indexed( x, y, stride, offset );
224
+ return y;
225
+ }
226
+
227
+
228
+ // EXPORTS //
229
+
230
+ module.exports = assign;
package/lib/index.js ADDED
@@ -0,0 +1,58 @@
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
+ /**
22
+ * Cumulatively test whether every element in a provided array is truthy.
23
+ *
24
+ * @module @stdlib/array-base-cuevery
25
+ *
26
+ * @example
27
+ * var cuevery = require( '@stdlib/array-base-cuevery' );
28
+ *
29
+ * var x = [ true, true, true, false, true ]
30
+ *
31
+ * var y = cuevery( x );
32
+ * // returns [ true, true, true, false, false ]
33
+ *
34
+ * @example
35
+ * var cuevery = require( '@stdlib/array-base-cuevery' );
36
+ *
37
+ * var x = [ true, true, true, false, true ];
38
+ * var y = [ false, null, false, null, false, null, false, null, false, null ];
39
+ *
40
+ * var arr = cuevery.assign( x, y, 2, 0 );
41
+ * // returns [ true, null, true, null, true, null, false, null, false, null ]
42
+ */
43
+
44
+ // MODULES //
45
+
46
+ var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
47
+ var main = require( './main.js' );
48
+ var assign = require( './assign.js' );
49
+
50
+
51
+ // MAIN //
52
+
53
+ setReadOnly( main, 'assign', assign );
54
+
55
+
56
+ // EXPORTS //
57
+
58
+ module.exports = main;
package/lib/main.js ADDED
@@ -0,0 +1,49 @@
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 filled = require( '@stdlib/array-base-filled' );
24
+ var assign = require( './assign.js' );
25
+
26
+
27
+ // MAIN //
28
+
29
+ /**
30
+ * Cumulatively tests whether at every element in a provided array is truthy.
31
+ *
32
+ * @param {Collection} x - input array
33
+ * @returns {Array} output array
34
+ *
35
+ * @example
36
+ * var x = [ true, true, true, false, true ];
37
+ *
38
+ * var y = cuevery( x );
39
+ * // returns [ true, true, true, false, false ];
40
+ */
41
+ function cuevery( x ) {
42
+ var y = filled( true, x.length );
43
+ return assign( x, y, 1, 0 );
44
+ }
45
+
46
+
47
+ // EXPORTS //
48
+
49
+ module.exports = cuevery;
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@stdlib/array-base-cuevery",
3
+ "version": "0.0.1",
4
+ "description": "Cumulatively test whether every element in a provided array is truthy.",
5
+ "license": "Apache-2.0",
6
+ "author": {
7
+ "name": "The Stdlib Authors",
8
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
9
+ },
10
+ "contributors": [
11
+ {
12
+ "name": "The Stdlib Authors",
13
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14
+ }
15
+ ],
16
+ "main": "./lib",
17
+ "directories": {
18
+ "doc": "./docs",
19
+ "lib": "./lib",
20
+ "dist": "./dist"
21
+ },
22
+ "types": "./docs/types",
23
+ "scripts": {},
24
+ "homepage": "https://stdlib.io",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git://github.com/stdlib-js/array-base-cuevery.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/stdlib-js/stdlib/issues"
31
+ },
32
+ "dependencies": {
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"
40
+ },
41
+ "devDependencies": {},
42
+ "engines": {
43
+ "node": ">=0.10.0",
44
+ "npm": ">2.7.0"
45
+ },
46
+ "os": [
47
+ "aix",
48
+ "darwin",
49
+ "freebsd",
50
+ "linux",
51
+ "macos",
52
+ "openbsd",
53
+ "sunos",
54
+ "win32",
55
+ "windows"
56
+ ],
57
+ "keywords": [
58
+ "stdlib",
59
+ "stdtypes",
60
+ "types",
61
+ "data",
62
+ "structure",
63
+ "utils",
64
+ "generic",
65
+ "array",
66
+ "cuevery",
67
+ "cumulative",
68
+ "test",
69
+ "every",
70
+ "array.every",
71
+ "validate"
72
+ ],
73
+ "funding": {
74
+ "type": "opencollective",
75
+ "url": "https://opencollective.com/stdlib"
76
+ }
77
+ }