From dd7ef77fb6e5184455fc472c6aade18d347e89f9 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Tue, 18 Jun 2024 21:12:12 +0530 Subject: [PATCH 1/9] feat: add assert/is-same-booleanarray --- .../assert/is-same-booleanarray/README.md | 122 ++++++++++++++++++ .../benchmark/benchmark.length.js | 110 ++++++++++++++++ .../assert/is-same-booleanarray/docs/repl.txt | 35 +++++ .../docs/types/index.d.ts | 55 ++++++++ .../is-same-booleanarray/docs/types/test.ts | 36 ++++++ .../is-same-booleanarray/examples/index.js | 34 +++++ .../assert/is-same-booleanarray/lib/index.js | 54 ++++++++ .../assert/is-same-booleanarray/lib/main.js | 64 +++++++++ .../assert/is-same-booleanarray/package.json | 77 +++++++++++ .../assert/is-same-booleanarray/test/test.js | 102 +++++++++++++++ 10 files changed, 689 insertions(+) create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/main.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/package.json create mode 100644 lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md new file mode 100644 index 000000000000..e0de5582f11d --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md @@ -0,0 +1,122 @@ + + +# isSameBooleanArray + +> Test if two arguments are both [BooleanArrays][@stdlib/array/bool] and have the [same values][@stdlib/assert/is-same-value]. + +
+ +## Usage + +```javascript +var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); +``` + +#### isSameBooleanArray( v1, v2 ) + +Tests if two arguments are both [BooleanArrays][@stdlib/array/bool] and have the [same values][@stdlib/assert/is-same-value]. + +```javascript +var BooleanArray = require( '@stdlib/array/bool' ); + +var x = new BooleanArray( [ true, false ] ); +var y = new BooleanArray( [ true, false ] ); +var bool = isSameBooleanArray( x, y ); +// returns true + +bool = isSameBooleanArray( x, [ true, false ] ); +// returns false +``` + +
+ + + +
+ +## Notes + +- In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the [same value][@stdlib/assert/is-same-value]. + +
+ + + +
+ +## Examples + + + +```javascript +var BooleanArray = require( '@stdlib/array/bool' ); +var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); + +var x = new BooleanArray( [ true, false, false, true ] ); +var y = new BooleanArray( [ true, false, false, true ] ); +var out = isSameBooleanArray( x, y ); +// returns true + +x = new BooleanArray( [ true, false, false, true ] ); +y = new BooleanArray( [ true, true, false, false ] ); +out = isSameBooleanArray( x, y ); +// returns false +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js new file mode 100644 index 000000000000..6801f6ebd0d5 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js @@ -0,0 +1,110 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var pow = require( '@stdlib/math/base/special/pow' ); +var Boolean = require( '@stdlib/boolean/ctor' ); +var BooleanArray = require( '@stdlib/array/bool' ); +var pkg = require( './../package.json' ).name; +var isSameBooleanArray = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x; + var y; + var v; + var i; + + x = []; + y = []; + for ( i = 0; i < len; i++ ) { + v = Boolean( i%2 ); + x.push( v ); + y.push( v ); + } + x = new BooleanArray( x ); + y = new BooleanArray( y ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var bool; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + bool = isSameBooleanArray( x, y ); + if ( typeof bool !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( bool ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt new file mode 100644 index 000000000000..71d817d0158a --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt @@ -0,0 +1,35 @@ + +{{alias}}( v1, v2 ) + Tests if two arguments are both BooleanArrays and have the same values. + + The function differs from the `===` operator in that the function treats + `-0` and `+0` as distinct and `NaNs` as the same. + + Parameters + ---------- + v1: any + First input value. + + v2: any + Second input value. + + Returns + ------- + bool: boolean + Boolean indicating whether two arguments are the same. + + Examples + -------- + > var x = new {{alias:@stdlib/array/bool}}( [ true, false, false, true ] ); + > var y = new {{alias:@stdlib/array/bool}}( [ true, false, false, true ] ); + > var bool = {{alias}}( x, y ) + true + + > x = new {{alias:@stdlib/array/bool}}( [ true, false, false, true ] ); + > y = new {{alias:@stdlib/array/bool}}( [ true, true, false, false ] ); + > bool = {{alias}}( x, y ) + false + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts new file mode 100644 index 000000000000..d19dd974f6ce --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts @@ -0,0 +1,55 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Tests if two arguments are both BooleanArrays and have the same values. +* +* ## Notes +* +* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. +* +* @param v1 - first input value +* @param v2 - second input value +* @returns boolean indicating whether two arguments are the same +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, false, false, true ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns true +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, true, false, false ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns false +*/ +declare function isSameBooleanArray( v1: any, v2: any ): boolean; + + +// EXPORTS // + +export = isSameBooleanArray; diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/test.ts b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/test.ts new file mode 100644 index 000000000000..27aec976ac81 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/test.ts @@ -0,0 +1,36 @@ +/* +* @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. +*/ + +import isSameBooleanArray = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + isSameBooleanArray( true, true ); // $ExpectType boolean + isSameBooleanArray( null, null ); // $ExpectType boolean + isSameBooleanArray( 'beep', 'boop' ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + isSameBooleanArray(); // $ExpectError + isSameBooleanArray( 3.14 ); // $ExpectError + isSameBooleanArray( 'beep', 'beep', 3.14 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js new file mode 100644 index 000000000000..8aa160cdfd6f --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js @@ -0,0 +1,34 @@ +/** +* @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'; + +var BooleanArray = require( '@stdlib/array/bool' ); +var isSameBooleanArray = require( './../lib' ); + +var x = new BooleanArray( [ true, false, false, true ] ); +var y = new BooleanArray( [ true, false, false, true ] ); +var out = isSameBooleanArray( x, y ); +console.log( out ); +// => true + +x = new BooleanArray( [ true, false, false, true ] ); +y = new BooleanArray( [ true, true, false, false ] ); +out = isSameBooleanArray( x, y ); +console.log( out ); +// => false \ No newline at end of file diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js new file mode 100644 index 000000000000..25b759ea4196 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js @@ -0,0 +1,54 @@ +/** +* @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'; + +/** +* Tests if two arguments are both BooleanArrays and have the same values. +* +* @param {*} v1 - first value +* @param {*} v2 - second value +* @returns {boolean} boolean result +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, false, false, true ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns true +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, true, false, false ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/main.js new file mode 100644 index 000000000000..ca2162e2a5aa --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/main.js @@ -0,0 +1,64 @@ +/** +* @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 isBooleanArray = require( '@stdlib/assert/is-booleanarray' ); +var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); + + +// MAIN // + +/** +* Tests if two arguments are both BooleanArrays and have the same values. +* +* @param {*} v1 - first value +* @param {*} v2 - second value +* @returns {boolean} boolean result +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, false, false, true ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns true +* +* @example +* var BooleanArray = require( '@stdlib/array/bool' ); +* +* var x = new BooleanArray( [ true, false, false, true ] ); +* var y = new BooleanArray( [ true, true, false, false ] ); +* +* var out = isSameBooleanArray( x, y ); +* // returns false +*/ +function isSameBooleanArray( v1, v2 ) { + if ( isBooleanArray( v1 ) && isBooleanArray( v2 ) ) { + return hasSameValues( v1, v2 ); + } + return false; +} + + +// EXPORTS // + +module.exports = isSameBooleanArray; diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/package.json b/lib/node_modules/@stdlib/assert/is-same-booleanarray/package.json new file mode 100644 index 000000000000..ff14fd60947c --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/package.json @@ -0,0 +1,77 @@ +{ + "name": "@stdlib/assert/is-same-booleanarray", + "version": "0.0.0", + "description": "Test if two arguments are both BooleanArrays and have the same values.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdassert", + "assertion", + "assert", + "utilities", + "utility", + "utils", + "util", + "equal", + "same", + "strict", + "is", + "issame", + "issamevalue", + "isequal", + "isstrictequal", + "type", + "check", + "valid", + "validate", + "test", + "typed", + "array", + "bool" + ] +} diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js new file mode 100644 index 000000000000..1b946fd3021e --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js @@ -0,0 +1,102 @@ +/** +* @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 tape = require( 'tape' ); +var typedarray = require( '@stdlib/array/typed' ); +var BooleanArray = require( '@stdlib/array/bool' ); +var isSameBooleanArray = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof isSameBooleanArray, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `true` if provided two BooleanArrays having the same values', function test( t ) { + var x; + var y; + + x = typedarray( [ 1, 0, 0, 1 ], 'bool' ); + t.strictEqual( isSameBooleanArray( x, x ), true, 'returns expected value' ); + + x = typedarray( [ 1, 0, 0, 1 ], 'bool' ); + y = typedarray( [ 1, 0, 0, 1 ], 'bool' ); + t.strictEqual( isSameBooleanArray( x, y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` if not provided two BooleanArrays having the same values', function test( t ) { + var x; + var y; + var i; + + x = [ + '', + 'beep', + 5, + 3.14, + -3.14, + 0.0, + -0.0, + true, + false, + null, + void 0, + [], + {}, + function noop() {}, + typedarray( 10, 'float32' ), + typedarray( 10, 'int32' ), + typedarray( 10, 'bool' ), + typedarray( [ 1.0, 2.0, 3.0, 4.0 ], 'complex64' ), + typedarray( [ 0, 0, 0, 0 ], 'bool' ) + ]; + y = [ + 'abc', + 'boop', + -5, + -3.14, + 3.14, + -0.0, + 0.0, + false, + true, + void 0, + null, + [], + {}, + function noop() {}, + typedarray( 10, 'float32' ), + typedarray( 10, 'int32' ), + typedarray( 10, 'float32' ), + typedarray( [ 2.0, 4.0, 6.0, 8.0 ], 'complex64' ), + typedarray( [ 0, 0, 0, 0 ], 'uint8' ) + ]; + for ( i = 0; i < x.length; i++ ) { + t.strictEqual( isSameBooleanArray( x[ i ], y[ i ] ), false, 'returns expected value when provided '+x[ i ]+' and '+y[ i ] ); + } + t.end(); +}); From c2398e75967963fe4bb52782a7698c07d12aa631 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Tue, 18 Jun 2024 21:23:43 +0530 Subject: [PATCH 2/9] feat: fix the export in index.js --- .../@stdlib/assert/is-same-booleanarray/lib/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js index 25b759ea4196..0620d6d52255 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/lib/index.js @@ -19,14 +19,13 @@ 'use strict'; /** -* Tests if two arguments are both BooleanArrays and have the same values. +* Test if two arguments are both BooleanArrays and have the same values. * -* @param {*} v1 - first value -* @param {*} v2 - second value -* @returns {boolean} boolean result +* @module @stdlib/assert/is-same-booleanarray * * @example * var BooleanArray = require( '@stdlib/array/bool' ); +* var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); * * var x = new BooleanArray( [ true, false, false, true ] ); * var y = new BooleanArray( [ true, false, false, true ] ); @@ -36,6 +35,7 @@ * * @example * var BooleanArray = require( '@stdlib/array/bool' ); +* var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' ); * * var x = new BooleanArray( [ true, false, false, true ] ); * var y = new BooleanArray( [ true, true, false, false ] ); From 1e0f2fdc99c0b8eee2aa3c82fba8d1d00e5b9716 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Fri, 21 Jun 2024 14:20:00 +0530 Subject: [PATCH 3/9] fix: add new line at the end of file --- .../@stdlib/assert/is-same-booleanarray/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js index 8aa160cdfd6f..e0899ff43005 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/examples/index.js @@ -31,4 +31,4 @@ x = new BooleanArray( [ true, false, false, true ] ); y = new BooleanArray( [ true, true, false, false ] ); out = isSameBooleanArray( x, y ); console.log( out ); -// => false \ No newline at end of file +// => false From de63ea8d5855b412893b2594e11db3c431b6c672 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Fri, 21 Jun 2024 14:27:57 +0530 Subject: [PATCH 4/9] fix: remove unnecessary import --- .../@stdlib/assert/is-same-booleanarray/test/test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js index 1b946fd3021e..97ee97164a2c 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js @@ -22,7 +22,6 @@ var tape = require( 'tape' ); var typedarray = require( '@stdlib/array/typed' ); -var BooleanArray = require( '@stdlib/array/bool' ); var isSameBooleanArray = require( './../lib' ); From 745d7c8d628660dad746c7f51ba38d51b280d164 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 21 Jun 2024 13:33:38 -0700 Subject: [PATCH 5/9] Apply suggestions from code review Signed-off-by: Athan --- .../assert/is-same-booleanarray/README.md | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md index e0de5582f11d..b069aecf20d7 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/README.md @@ -52,10 +52,6 @@ bool = isSameBooleanArray( x, [ true, false ] );
-## Notes - -- In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the [same value][@stdlib/assert/is-same-value]. -
@@ -89,14 +85,6 @@ out = isSameBooleanArray( x, y ); @@ -109,14 +97,6 @@ out = isSameBooleanArray( x, y ); [@stdlib/assert/is-same-value]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-value - - -[@stdlib/assert/is-booleanarray]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-booleanarray - -[@stdlib/assert/is-same-uint8array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-uint8array - - - From 1a70cf2d26bbe0f91de684fc5af517e86ca67c51 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 21 Jun 2024 13:35:22 -0700 Subject: [PATCH 6/9] Apply suggestions from code review Signed-off-by: Athan --- .../is-same-booleanarray/benchmark/benchmark.length.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js index 6801f6ebd0d5..82a55c1b563d 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/benchmark/benchmark.length.js @@ -41,18 +41,14 @@ var isSameBooleanArray = require( './../lib' ); function createBenchmark( len ) { var x; var y; - var v; var i; x = []; - y = []; for ( i = 0; i < len; i++ ) { - v = Boolean( i%2 ); - x.push( v ); - y.push( v ); + x.push( Boolean( i%2 ) ); } x = new BooleanArray( x ); - y = new BooleanArray( y ); + y = new BooleanArray( x ); return benchmark; From 7ed314e70112fa6d249f15f224edbb6888686adb Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 21 Jun 2024 13:36:00 -0700 Subject: [PATCH 7/9] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/assert/is-same-booleanarray/docs/repl.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt index 71d817d0158a..9ed0fbe15ef8 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/repl.txt @@ -2,9 +2,6 @@ {{alias}}( v1, v2 ) Tests if two arguments are both BooleanArrays and have the same values. - The function differs from the `===` operator in that the function treats - `-0` and `+0` as distinct and `NaNs` as the same. - Parameters ---------- v1: any From af251dc8461891945a476b22480b692294c1f27e Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 21 Jun 2024 13:36:33 -0700 Subject: [PATCH 8/9] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts index d19dd974f6ce..cc768f78a9ef 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/docs/types/index.d.ts @@ -21,10 +21,6 @@ /** * Tests if two arguments are both BooleanArrays and have the same values. * -* ## Notes -* -* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. -* * @param v1 - first input value * @param v2 - second input value * @returns boolean indicating whether two arguments are the same From 582a24c4d4faf215038c8b90d6c1d9264ba7122f Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 21 Jun 2024 13:39:01 -0700 Subject: [PATCH 9/9] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/assert/is-same-booleanarray/test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js index 97ee97164a2c..4624cf3d3f86 100644 --- a/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-booleanarray/test/test.js @@ -92,7 +92,7 @@ tape( 'the function returns `false` if not provided two BooleanArrays having the typedarray( 10, 'int32' ), typedarray( 10, 'float32' ), typedarray( [ 2.0, 4.0, 6.0, 8.0 ], 'complex64' ), - typedarray( [ 0, 0, 0, 0 ], 'uint8' ) + typedarray( [ 0, 0, 0, 1 ], 'bool' ) ]; for ( i = 0; i < x.length; i++ ) { t.strictEqual( isSameBooleanArray( x[ i ], y[ i ] ), false, 'returns expected value when provided '+x[ i ]+' and '+y[ i ] );