From e2b71beec499891b4e24b92de47c1f8ae7634d24 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sun, 14 Jan 2024 10:41:38 +0000 Subject: [PATCH] Update artifacts --- array/base/coverage.ndjson | 1 + array/base/every/coverage.ndjson | 1 + array/base/every/index.html | 131 +++++++ array/base/every/index.js.html | 211 +++++++++++ array/base/every/main.js.html | 613 +++++++++++++++++++++++++++++++ array/base/index.html | 10 +- array/base/index.js.html | 35 +- 7 files changed, 993 insertions(+), 9 deletions(-) create mode 100644 array/base/every/coverage.ndjson create mode 100644 array/base/every/index.html create mode 100644 array/base/every/index.js.html create mode 100644 array/base/every/main.js.html diff --git a/array/base/coverage.ndjson b/array/base/coverage.ndjson index f68983a1e..723b3b7b4 100644 --- a/array/base/coverage.ndjson +++ b/array/base/coverage.ndjson @@ -96,3 +96,4 @@ [1248,1248,100,1,1,100,0,0,100,1248,1248,100,"96489fa603a2920bef92fb38b49ca9468851714d","2024-01-07 18:27:29 -0500"] [1248,1248,100,1,1,100,0,0,100,1248,1248,100,"68413e05376206b18c4ff8662a8568a189dad77e","2024-01-09 18:51:05 -0800"] [1257,1257,100,1,1,100,0,0,100,1257,1257,100,"66882f7276ba21a26239f5d519c73bf8fd911e90","2024-01-13 15:20:10 -0800"] +[1266,1266,100,1,1,100,0,0,100,1266,1266,100,"8a5d3a67e679d2f91fda5280c62efaf576ee8e78","2024-01-14 02:39:11 -0800"] diff --git a/array/base/every/coverage.ndjson b/array/base/every/coverage.ndjson new file mode 100644 index 000000000..404b8b9cd --- /dev/null +++ b/array/base/every/coverage.ndjson @@ -0,0 +1 @@ +[218,218,100,22,22,100,4,4,100,218,218,100,"8a5d3a67e679d2f91fda5280c62efaf576ee8e78","2024-01-14 02:39:11 -0800"] diff --git a/array/base/every/index.html b/array/base/every/index.html new file mode 100644 index 000000000..fc0e71a7b --- /dev/null +++ b/array/base/every/index.html @@ -0,0 +1,131 @@ + + + + +
++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ ++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Test whether all elements in a collection are truthy. +* +* @module @stdlib/array/base/every +* +* @example +* var every = require( '@stdlib/array/base/every' ); +* +* var x = [ 1, 2, 3, 4 ]; +* +* var out = every( x ); +* // returns true +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +9x +9x +9x +17x +4x +4x +17x +5x +9x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +6x +6x +6x +7x +2x +2x +7x +4x +6x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +4x +4x +4x +4x +4x +4x +4x +4x +4x +7x +2x +2x +7x +2x +4x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +19x +19x +19x +10x +10x +3x +3x +10x +3x +3x +4x +4x +9x +19x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' ); +var isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' ); +var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' ); +var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' ); + + +// FUNCTIONS // + +/** +* Tests whether all elements in an array are truthy. +* +* @private +* @param {Collection} x - input array +* @returns {boolean} boolean indicating whether all elements are truthy +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var out = internal( x ); +* // returns true +* +* @example +* var x = [ 1, 2, 0, 4 ]; +* +* var out = internal( x ); +* // returns false +*/ +function internal( x ) { + var i; + for ( i = 0; i < x.length; i++ ) { + if ( !x[ i ] ) { + return false; + } + } + return true; +} + +/** +* Tests whether all elements in a complex number array. +* +* @private +* @param {Collection} x - underlying data buffer +* @returns {boolean} boolean indicating whether all elements are truthy +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var out = internalComplex( x ); +* // returns true +* +* @example +* var x = [ 1, 2, 0, 4 ]; +* +* var out = internalComplex( x ); +* // returns true +* +* @example +* var x = [ 1, 2, 0, 0 ]; +* +* var out = internalComplex( x ); +* // returns false +*/ +function internalComplex( x ) { + var i; + for ( i = 0; i < x.length; i += 2 ) { + if ( !( x[ i ] || x[ i+1 ] ) ) { + return false; + } + } + return true; +} + +/** +* Tests whether all elements in an array are truthy. +* +* @private +* @param {Object} x - input array object +* @returns {boolean} boolean indicating whether all elements are truthy +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var x = arraylike2object( toAccessorArray( [ 1, 2, 3, 4 ] ) ); +* +* var out = accessors( x ); +* // returns true +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var x = arraylike2object( toAccessorArray( [ 1, 2, 0, 4 ] ) ); +* +* var out = accessors( x ); +* // returns false +*/ +function accessors( x ) { + var data; + var get; + var i; + + data = x.data; + get = x.accessors[ 0 ]; + + for ( i = 0; i < data.length; i++ ) { + if ( !get( data, i ) ) { + return false; + } + } + return true; +} + + +// MAIN // + +/** +* Tests whether all elements in an array are truthy. +* +* @param {Collection} x - input array +* @returns {boolean} boolean indicating whether all elements are truthy +* +* @example +* var x = [ 1, 2, 3, 4 ]; +* +* var out = every( x ); +* // returns true +* +* @example +* var x = [ 1, 2, 0, 4 ]; +* +* var out = every( x ); +* // returns false +*/ +function every( x ) { + var obj = arraylike2object( x ); + if ( obj.accessorProtocol ) { + // 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... + if ( isComplex128Array( x ) ) { + return internalComplex( reinterpret128( x, 0 ) ); + } + if ( isComplex64Array( x ) ) { + return internalComplex( reinterpret64( x, 0 ) ); + } + return accessors( obj ); + } + return internal( x ); +} + + +// EXPORTS // + +module.exports = every; + |