From 6351cf0c1044e65ececee44ce3c758029a1f2803 Mon Sep 17 00:00:00 2001 From: Neerajpathak07 Date: Thu, 24 Apr 2025 11:07:49 +0530 Subject: [PATCH 1/3] feat: add `object/none-own-by` Ref: https://github.com/stdlib-js/stdlib/issues/6804 --- .../@stdlib/object/none-own-by/README.md | 180 ++++++++++++++++++ .../object/none-own-by/benchmark/index.js | 60 ++++++ .../@stdlib/object/none-own-by/docs/repl.txt | 42 ++++ .../object/none-own-by/docs/types/index.d.ts | 102 ++++++++++ .../object/none-own-by/docs/types/test.ts | 61 ++++++ .../object/none-own-by/examples/index.js | 35 ++++ .../@stdlib/object/none-own-by/lib/index.js | 50 +++++ .../@stdlib/object/none-own-by/lib/main.js | 75 ++++++++ .../@stdlib/object/none-own-by/package.json | 68 +++++++ .../@stdlib/object/none-own-by/test/test.js | 122 ++++++++++++ 10 files changed, 795 insertions(+) create mode 100644 lib/node_modules/@stdlib/object/none-own-by/README.md create mode 100644 lib/node_modules/@stdlib/object/none-own-by/benchmark/index.js create mode 100644 lib/node_modules/@stdlib/object/none-own-by/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/object/none-own-by/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/object/none-own-by/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/object/none-own-by/examples/index.js create mode 100644 lib/node_modules/@stdlib/object/none-own-by/lib/index.js create mode 100644 lib/node_modules/@stdlib/object/none-own-by/lib/main.js create mode 100644 lib/node_modules/@stdlib/object/none-own-by/package.json create mode 100644 lib/node_modules/@stdlib/object/none-own-by/test/test.js diff --git a/lib/node_modules/@stdlib/object/none-own-by/README.md b/lib/node_modules/@stdlib/object/none-own-by/README.md new file mode 100644 index 000000000000..b9eb90f56c7c --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/README.md @@ -0,0 +1,180 @@ + + +# noneOwnBy + +> Tests whether every own property of an object fails a test implemented by a predicate function. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var noneOwnBy = require( '@stdlib/object/none-own-by' ); +``` + +#### noneOwnBy( object, predicate\[, thisArg ] ) + +Tests whether every `own` property of an object fails a test implemented by a `predicate` function. + +```javascript +function isUnderage( age ) { + return ( age < 18 ); +} + +var obj = { + 'a': 28, + 'b': 22, + 'c': 25 +}; + +var bool = noneOwnBy( obj, isUnderage ); +// returns true +``` + +If a `predicate` function returns a truthy value, the function **immediately** returns `false`. + +```javascript +function isUnderage( age ) { + return ( age < 18 ); +} + +var obj = { + 'a': 12, + 'b': 22, + 'c': 25 +}; + +var bool = noneOwnBy( obj, isUnderage ); +// returns false +``` + +
+ + + + + +
+ +## Notes + +- If the 1st argument is not an object or the second argument is not a fuction , the function throws a Type Error. + +- If provided an empty object, the function returns `true`. + + ```javascript + function truthy() { + return true; + } + var bool = noneOwnBy( {}, truthy ); + // returns true + ``` + +
+ + + + + +
+ +## Examples + + + +```javascript +var noneOwnBy = require( '@stdlib/object/none-own-by' ); + +function isUnderage( age ) { + return age < 18; +} + +var obj = { + 'a': 26, + 'b': 20, + 'c': 25 +}; + +var bool = noneOwnBy( obj, isUnderage ); +// returns true +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/object/none-own-by/benchmark/index.js b/lib/node_modules/@stdlib/object/none-own-by/benchmark/index.js new file mode 100644 index 000000000000..a48d76deecdf --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/benchmark/index.js @@ -0,0 +1,60 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pkg = require( './../package.json' ).name; +var noneOwnBy = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var bool; + var obj; + var i; + + function predicate( v ) { + return isnan( v ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + obj = { + 'a': i, + 'b': i+1, + 'c': i+2, + 'd': i+3 + }; + bool = noneOwnBy( obj, predicate ); + 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(); +}); diff --git a/lib/node_modules/@stdlib/object/none-own-by/docs/repl.txt b/lib/node_modules/@stdlib/object/none-own-by/docs/repl.txt new file mode 100644 index 000000000000..f2a33df8cc79 --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/docs/repl.txt @@ -0,0 +1,42 @@ + +{{alias}}( object, predicate[, thisArg ] ) + Tests whether every own property of an object fails a test implemented + by a predicate function. + + The predicate function is provided three arguments: + + - value: property value. + - index: property key. + - object: the input object. + + The function immediately returns upon encountering a truthy return value. + + If provided an empty object, the function returns `true`. + + Parameters + ---------- + object: Object + Input object. + + predicate: Function + Test function. + + thisArg: any (optional) + Execution context. + + Returns + ------- + bool: boolean + The function returns `true` if the predicate function returns a falsy + value for all own properties; otherwise, the function returns `false`. + + Examples + -------- + > function isUnderage( v ) { return ( v < 18 ); }; + > var obj = { 'a': 11, 'b': 12, 'c': 22 }; + > var bool = {{alias}}( obj, isUnderage ) + false + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/object/none-own-by/docs/types/index.d.ts b/lib/node_modules/@stdlib/object/none-own-by/docs/types/index.d.ts new file mode 100644 index 000000000000..7ba3dda5632e --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/docs/types/index.d.ts @@ -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. +*/ + +// TypeScript Version: 4.1 + +/// + + +/** +* Checks whether an own property of the object passes the test. +* +* @returns boolean indicating whether an own property of the object passes the test +*/ +type Nullary = ( this: U ) => boolean; + +/** +* Checks whether an own property of the object passes the test. +* +* @param value - property value +* @returns boolean indicating whether an own property of the object passes the test +*/ +type Unary = ( this: U, value: T ) => boolean; + +/** +* Checks whether an own property of the object passes the test. +* +* @param value - property value +* @param key - property key +* @returns boolean indicating whether an own property of the object passes the test +*/ +type Binary = ( this: U, value: T, key: number ) => boolean; + +/** +* Checks whether an own property of the object passes the test. +* +* @param value - property value +* @param key - property key +* @param object - input object +* @returns boolean indicating whether an own property of the object passes the test +*/ +type Ternary = ( this: U, value: T, key: number, object: Object ) => boolean; + +/** +* Checks whether an own property of the object passes the test. +* +* @param value - object value +* @param key - object key +* @param object - input object +* @returns boolean indicating whether an own property of the object passes the test +*/ +type Predicate = Nullary | Unary | Binary | Ternary; + +/** +* Tests whether every property of an object fails a test implemented by a predicate function. +* +* ## Notes +* +* - The predicate function is provided three arguments: +* +* - `value`: property value +* - `key`: property key +* - `object`: the input object +* +* - The function immediately returns upon encountering a truthy return value. +* - If provided an empty object, the function returns `true`. +* +* @param object - input object +* @param predicate - test function +* @param thisArg - execution context +* @returns boolean indicating whether every property fails a test +* +* @example +* function isUnderage( v ) { +* return ( v < 18 ); +* } +* +* var obj = { 'a': 20, 'b': 22, 'c': 25 }; +* +* var bool = noneOwnBy( obj, isUnderage ); +* // returns true +*/ +declare function noneOwnBy( object: Record, predicate: Predicate, thisArg?: ThisParameterType> ): boolean; + + +// EXPORTS // + +export = noneOwnBy; diff --git a/lib/node_modules/@stdlib/object/none-own-by/docs/types/test.ts b/lib/node_modules/@stdlib/object/none-own-by/docs/types/test.ts new file mode 100644 index 000000000000..c095398c5c5d --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/docs/types/test.ts @@ -0,0 +1,61 @@ +/* +* @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 noneOwnBy = require( './index' ); + +const isUnderAge = ( v: number ): boolean => { + return ( v < 18 ); +}; + +// TESTS // + +const obj = { + 'a': 10, + 'b': 12, + 'c': 22 +}; + +// The function returns a boolean... +{ + noneOwnBy( obj, isUnderAge ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided a first argument which is not an object... +{ + noneOwnBy( 2, isUnderAge ); // $ExpectError + noneOwnBy( false, isUnderAge ); // $ExpectError + noneOwnBy( true, isUnderAge ); // $ExpectError + noneOwnBy( [ 1, 2 ], isUnderAge ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a function... +{ + noneOwnBy( obj , 2 ); // $ExpectError + noneOwnBy( obj , false ); // $ExpectError + noneOwnBy( obj , true ); // $ExpectError + noneOwnBy( obj , 'abc' ); // $ExpectError + noneOwnBy( obj , {} ); // $ExpectError + noneOwnBy( obj , [] ); // $ExpectError +} + +// The compiler throws an error if the function is provided an invalid number of arguments... +{ + noneOwnBy(); // $ExpectError + noneOwnBy( [ 1, 2, 3 ] ); // $ExpectError + noneOwnBy( [ 1, 2, 3 ], isUnderAge, {}, 3 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/object/none-own-by/examples/index.js b/lib/node_modules/@stdlib/object/none-own-by/examples/index.js new file mode 100644 index 000000000000..bf73e63c6a7b --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/examples/index.js @@ -0,0 +1,35 @@ +/** +* @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 noneOwnBy = require( './../lib' ); + +function isUnderage( age ) { + return age < 18; +} + +var obj = { + 'a': 26, + 'b': 20, + 'c': 25 +}; + +var bool = noneOwnBy( obj, isUnderage ); +console.log( bool ); +// => true diff --git a/lib/node_modules/@stdlib/object/none-own-by/lib/index.js b/lib/node_modules/@stdlib/object/none-own-by/lib/index.js new file mode 100644 index 000000000000..ebf23ada8565 --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/lib/index.js @@ -0,0 +1,50 @@ +/** +* @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 every "own" property of a provided object fails a test implemented by a predicate function. +* +* @module @stdlib/object/none-own-by +* +* @example +* var noneOwnBy = require( '@stdlib/object/none-own-by' ); +* +* function isUnderage( age ) { +* return age < 18; +* } +* +* var obj = { +* a : 10, +* b : 12, +* c : 15 +* }; +* +* var bool = noneOwnBy( obj, isUnderage ); +* // returns true +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/object/none-own-by/lib/main.js b/lib/node_modules/@stdlib/object/none-own-by/lib/main.js new file mode 100644 index 000000000000..e2130d1ab35e --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/lib/main.js @@ -0,0 +1,75 @@ +/** +* @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 hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var isFunction = require( '@stdlib/assert/is-function' ); +var isObject = require( '@stdlib/assert/is-object' ); +var format = require( '@stdlib/string/format' ); + + +// MAIN // + +/** +* Tests whether every own property of an object fails a test implemented by a predicate function. +* +* @param {Object} obj - input object +* @param {Function} predicate - test function +* @param {*} [thisArg] - execution context +* @throws {TypeError} first argument must be an object +* @throws {TypeError} second argument must be a function +* @returns {boolean} boolean indicating whether all elements fail a test +* +* @example +* function isUnderage( age ) { +* return ( age < 18 ); +* }; +* +* var obj = { +* 'a': 10, +* 'b': 12, +* 'c': 15 +* }; +* +* var bool = noneOwnBy( obj, isUnderage ); +* // returns false +*/ +function noneOwnBy( obj, predicate, thisArg ) { + var key; + + if ( !isObject( obj ) ) { + throw new TypeError( format(' invalid argument. First argument must be an object. Value: `%s`.', obj ) ); + } + if ( !isFunction( predicate ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) ); + } + for ( key in obj ) { + if ( hasOwnProp( obj, key ) && predicate.call( thisArg, obj[key], key, obj ) ) { + return false; + } + } + return true; +} + + +// EXPORTS // + +module.exports = noneOwnBy; diff --git a/lib/node_modules/@stdlib/object/none-own-by/package.json b/lib/node_modules/@stdlib/object/none-own-by/package.json new file mode 100644 index 000000000000..525bb25cf34a --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/object/none-own-by", + "version": "0.0.0", + "description": "Tests whether every own property of an object fails a test implemented by a predicate function.", + "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", + "stdutils", + "stdutil", + "utilities", + "utility", + "utils", + "util", + "test", + "predicate", + "none", + "all", + "every", + "object", + "iterate", + "validate" + ] +} diff --git a/lib/node_modules/@stdlib/object/none-own-by/test/test.js b/lib/node_modules/@stdlib/object/none-own-by/test/test.js new file mode 100644 index 000000000000..eac557e482e6 --- /dev/null +++ b/lib/node_modules/@stdlib/object/none-own-by/test/test.js @@ -0,0 +1,122 @@ +/** +* @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 noop = require( '@stdlib/utils/noop' ); +var noneOwnBy = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof noneOwnBy, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if not provided an object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + function noop() {}, + /.*/, + new Date() + ]; + for ( i =0; i < values.length; i++ ) { + t.throws( badValue( values ), TypeError, 'throws a type error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + noneOwnBy( value, noop ); + }; + } +}); + +tape( 'the function throws an error if not provided a predicate function', function test( t ) { + var values; + + values = { + 'a': 10, + 'b': 12, + 'c': 15 + }; + + t.throws( badValue( values ), TypeError, 'throws a type error when provided '+values ); + t.end(); + + function badValue( value ) { + return function badValue() { + noneOwnBy( value, value ); + }; + } +}); + +tape( 'the function returns `true` if all own properties fail a test ', function test( t ) { + var bool; + var obj; + + obj = { + 'a': 20, + 'b': 22, + 'c': 25 + }; + + function underAge( value ) { + return ( value < 18 ); + } + + bool = noneOwnBy( obj, underAge ); + + t.strictEqual( bool, true, 'returns true' ); + t.end(); +}); + +tape( 'the function returns `false` if one or more own properties pass a test', function test( t ) { + var bool; + var obj; + + obj = { + 'a': 10, + 'b': 12, + 'c': 15 + }; + + function underAge( value ) { + return ( value < 18 ); + } + + bool = noneOwnBy( obj, underAge ); + + t.strictEqual( bool, false, 'returns false' ); + t.end(); +}); From c21e9037085a3a74d104aea80d0784514f07c950 Mon Sep 17 00:00:00 2001 From: Neerajpathak07 Date: Thu, 24 Apr 2025 11:14:36 +0530 Subject: [PATCH 2/3] refactor: update paths Ref: https://github.com/stdlib-js/stdlib/issues/6804 --- lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv | 2 +- .../@stdlib/namespace/alias2standalone/data/data.csv | 2 +- lib/node_modules/@stdlib/namespace/lib/namespace/e.js | 2 +- lib/node_modules/@stdlib/namespace/lib/namespace/n.js | 4 ++-- lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv | 2 +- lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv | 4 ++-- .../@stdlib/namespace/pkg2standalone/data/data.csv | 2 +- .../@stdlib/namespace/standalone2pkg/data/data.csv | 2 +- lib/node_modules/@stdlib/utils/every-own-by/README.md | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv b/lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv index ba91e8f82c6d..bdcf895daf5b 100644 --- a/lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/alias2pkg/data/data.csv @@ -2642,7 +2642,7 @@ nonEnumerablePropertyNames,"@stdlib/utils/nonenumerable-property-names" nonEnumerablePropertyNamesIn,"@stdlib/utils/nonenumerable-property-names-in" nonEnumerablePropertySymbols,"@stdlib/utils/nonenumerable-property-symbols" nonEnumerablePropertySymbolsIn,"@stdlib/utils/nonenumerable-property-symbols-in" -noneOwnBy,"@stdlib/utils/none-own-by" +noneOwnBy,"@stdlib/obejct/none-own-by" nonIndexKeys,"@stdlib/utils/nonindex-keys" noop,"@stdlib/utils/noop" now,"@stdlib/time/now" diff --git a/lib/node_modules/@stdlib/namespace/alias2standalone/data/data.csv b/lib/node_modules/@stdlib/namespace/alias2standalone/data/data.csv index 1823ae842e33..caf99642fa22 100644 --- a/lib/node_modules/@stdlib/namespace/alias2standalone/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/alias2standalone/data/data.csv @@ -2642,7 +2642,7 @@ nonEnumerablePropertyNames,"@stdlib/utils-nonenumerable-property-names" nonEnumerablePropertyNamesIn,"@stdlib/utils-nonenumerable-property-names-in" nonEnumerablePropertySymbols,"@stdlib/utils-nonenumerable-property-symbols" nonEnumerablePropertySymbolsIn,"@stdlib/utils-nonenumerable-property-symbols-in" -noneOwnBy,"@stdlib/utils-none-own-by" +noneOwnBy,"@stdlib/object-none-own-by" nonIndexKeys,"@stdlib/utils-nonindex-keys" noop,"@stdlib/utils-noop" now,"@stdlib/time-now" diff --git a/lib/node_modules/@stdlib/namespace/lib/namespace/e.js b/lib/node_modules/@stdlib/namespace/lib/namespace/e.js index 0770f5245b28..1ff9bcb8a37b 100644 --- a/lib/node_modules/@stdlib/namespace/lib/namespace/e.js +++ b/lib/node_modules/@stdlib/namespace/lib/namespace/e.js @@ -278,7 +278,7 @@ ns.push({ 'related': [ '@stdlib/utils/any-own-by', '@stdlib/object/every-in-by', - '@stdlib/utils/none-own-by', + '@stdlib/obejct/none-own-by', '@stdlib/utils/some-own-by', '@stdlib/utils/every-by' ] diff --git a/lib/node_modules/@stdlib/namespace/lib/namespace/n.js b/lib/node_modules/@stdlib/namespace/lib/namespace/n.js index 0a6ab4647b39..c217338ba306 100644 --- a/lib/node_modules/@stdlib/namespace/lib/namespace/n.js +++ b/lib/node_modules/@stdlib/namespace/lib/namespace/n.js @@ -1057,8 +1057,8 @@ ns.push({ ns.push({ 'alias': 'noneOwnBy', - 'path': '@stdlib/utils/none-own-by', - 'value': require( '@stdlib/utils/none-own-by' ), + 'path': '@stdlib/object/none-own-by', + 'value': require( '@stdlib/object/none-own-by' ), 'type': 'Function', 'related': [ '@stdlib/utils/any-own-by', diff --git a/lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv b/lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv index efd3cd8b0a4b..f1cfcb236fa6 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/pkg2alias/data/data.csv @@ -2642,7 +2642,7 @@ "@stdlib/utils/nonenumerable-property-names-in",nonEnumerablePropertyNamesIn "@stdlib/utils/nonenumerable-property-symbols",nonEnumerablePropertySymbols "@stdlib/utils/nonenumerable-property-symbols-in",nonEnumerablePropertySymbolsIn -"@stdlib/utils/none-own-by",noneOwnBy +"@stdlib/object/none-own-by",noneOwnBy "@stdlib/utils/nonindex-keys",nonIndexKeys "@stdlib/utils/noop",noop "@stdlib/time/now",now diff --git a/lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv b/lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv index a81675e56ed2..7989a93913e4 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/pkg2related/data/data.csv @@ -1617,7 +1617,7 @@ "@stdlib/utils/every-by-right","@stdlib/utils/any-by,@stdlib/utils/every,@stdlib/utils/every-by,@stdlib/utils/for-each-right,@stdlib/utils/none-by-right,@stdlib/utils/some-by-right" "@stdlib/utils/async/every-by-right","@stdlib/utils/async/any-by-right,@stdlib/utils/async/every-by,@stdlib/utils/every-by-right,@stdlib/utils/async/for-each-right,@stdlib/utils/async/none-by-right,@stdlib/utils/async/some-by-right" "@stdlib/object/every-in-by","@stdlib/utils/any-in-by,@stdlib/utils/none-in-by,@stdlib/utils/some-in-by,@stdlib/utils/every-by,@stdlib/utils/every-own-by" -"@stdlib/utils/every-own-by","@stdlib/utils/any-own-by,@stdlib/object/every-in-by,@stdlib/utils/none-own-by,@stdlib/utils/some-own-by,@stdlib/utils/every-by" +"@stdlib/utils/every-own-by","@stdlib/utils/any-own-by,@stdlib/object/every-in-by,@stdlib/object/none-own-by,@stdlib/utils/some-own-by,@stdlib/utils/every-by" "@stdlib/utils/eval","" "@stdlib/process/exec-path","" "@stdlib/fs/exists","@stdlib/fs/read-file,@stdlib/fs/read-dir" @@ -2642,7 +2642,7 @@ "@stdlib/utils/nonenumerable-property-names-in","@stdlib/utils/keys-in,@stdlib/utils/inherited-nonenumerable-property-names,@stdlib/utils/nonenumerable-property-names,@stdlib/utils/property-names-in" "@stdlib/utils/nonenumerable-property-symbols","@stdlib/utils/enumerable-property-symbols,@stdlib/utils/inherited-nonenumerable-property-symbols,@stdlib/utils/nonenumerable-property-names,@stdlib/utils/nonenumerable-property-symbols-in,@stdlib/utils/property-symbols" "@stdlib/utils/nonenumerable-property-symbols-in","@stdlib/utils/enumerable-property-symbols-in,@stdlib/utils/inherited-nonenumerable-property-symbols,@stdlib/utils/nonenumerable-property-names-in,@stdlib/utils/nonenumerable-property-symbols,@stdlib/utils/property-symbols-in" -"@stdlib/utils/none-own-by","@stdlib/utils/any-own-by,@stdlib/utils/every-own-by,@stdlib/utils/for-own,@stdlib/utils/none-by,@stdlib/utils/some-own-by" +"@stdlib/object/none-own-by","@stdlib/utils/any-own-by,@stdlib/utils/every-own-by,@stdlib/utils/for-own,@stdlib/utils/none-by,@stdlib/utils/some-own-by" "@stdlib/utils/nonindex-keys","@stdlib/utils/entries,@stdlib/utils/keys,@stdlib/utils/values" "@stdlib/utils/noop","" "@stdlib/time/now","" diff --git a/lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.csv b/lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.csv index a006ae007f15..7d70b3e1f0b2 100644 --- a/lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/pkg2standalone/data/data.csv @@ -2642,7 +2642,7 @@ "@stdlib/utils/nonenumerable-property-names-in","@stdlib/utils-nonenumerable-property-names-in" "@stdlib/utils/nonenumerable-property-symbols","@stdlib/utils-nonenumerable-property-symbols" "@stdlib/utils/nonenumerable-property-symbols-in","@stdlib/utils-nonenumerable-property-symbols-in" -"@stdlib/utils/none-own-by","@stdlib/utils-none-own-by" +"@stdlib/object/none-own-by","@stdlib/object-none-own-by" "@stdlib/utils/nonindex-keys","@stdlib/utils-nonindex-keys" "@stdlib/utils/noop","@stdlib/utils-noop" "@stdlib/time/now","@stdlib/time-now" diff --git a/lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.csv b/lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.csv index 271a3a296207..51db848819b8 100644 --- a/lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.csv +++ b/lib/node_modules/@stdlib/namespace/standalone2pkg/data/data.csv @@ -2642,7 +2642,7 @@ "@stdlib/utils-nonenumerable-property-names-in","@stdlib/utils/nonenumerable-property-names-in" "@stdlib/utils-nonenumerable-property-symbols","@stdlib/utils/nonenumerable-property-symbols" "@stdlib/utils-nonenumerable-property-symbols-in","@stdlib/utils/nonenumerable-property-symbols-in" -"@stdlib/utils-none-own-by","@stdlib/utils/none-own-by" +"@stdlib/object-none-own-by","@stdlib/object/none-own-by" "@stdlib/utils-nonindex-keys","@stdlib/utils/nonindex-keys" "@stdlib/utils-noop","@stdlib/utils/noop" "@stdlib/time-now","@stdlib/time/now" diff --git a/lib/node_modules/@stdlib/utils/every-own-by/README.md b/lib/node_modules/@stdlib/utils/every-own-by/README.md index c9bf66eff053..570d68283cb5 100644 --- a/lib/node_modules/@stdlib/utils/every-own-by/README.md +++ b/lib/node_modules/@stdlib/utils/every-own-by/README.md @@ -191,7 +191,7 @@ var bool = everyOwnBy( obj, isPositive ); - [`@stdlib/utils/any-own-by`][@stdlib/utils/any-own-by]: test whether whether any 'own' property of a provided object satisfies a predicate function. - [`@stdlib/object/every-in-by`][@stdlib/object/every-in-by]: test whether all properties (own and inherited) of an object pass a test implemented by a predicate function. -- [`@stdlib/utils/none-own-by`][@stdlib/utils/none-own-by]: tests whether every own property of an object fails a test implemented by a predicate function. +- [`@stdlib/object/none-own-by`][@stdlib/object/none-own-by]: tests whether every own property of an object fails a test implemented by a predicate function. - [`@stdlib/utils/some-own-by`][@stdlib/utils/some-own-by]: test whether some `own` properties of a provided object satisfy a predicate function for at least `n` properties. - [`@stdlib/utils/every-by`][@stdlib/utils/every-by]: test whether all elements in a collection pass a test implemented by a predicate function. @@ -211,7 +211,7 @@ var bool = everyOwnBy( obj, isPositive ); [@stdlib/object/every-in-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/object/every-in-by -[@stdlib/utils/none-own-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/none-own-by +[@stdlib/object/none-own-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/object/none-own-by [@stdlib/utils/some-own-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/some-own-by From 3d09fb453880498836948b2ca54443931f2b5719 Mon Sep 17 00:00:00 2001 From: Neerajpathak07 Date: Thu, 24 Apr 2025 11:16:12 +0530 Subject: [PATCH 3/3] remove: remove `utils/none-own-by` This commit removes `@stdlib/utils/none-own-by` in favor of `@stdlib/object/none-own-by`. BREAKING CHANGE: remove `utils/none-own-by` To migrate, users should update their require/import paths to use `@stdlib/object/none-own-by` which provides the same API and implementation. Ref: https://github.com/stdlib-js/stdlib/issues/6804 --- .../@stdlib/utils/none-own-by/README.md | 180 ------------------ .../utils/none-own-by/benchmark/index.js | 60 ------ .../@stdlib/utils/none-own-by/docs/repl.txt | 42 ---- .../utils/none-own-by/docs/types/index.d.ts | 102 ---------- .../utils/none-own-by/docs/types/test.ts | 61 ------ .../utils/none-own-by/examples/index.js | 35 ---- .../@stdlib/utils/none-own-by/lib/index.js | 50 ----- .../@stdlib/utils/none-own-by/lib/main.js | 75 -------- .../@stdlib/utils/none-own-by/package.json | 68 ------- .../@stdlib/utils/none-own-by/test/test.js | 122 ------------ 10 files changed, 795 deletions(-) delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/README.md delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/benchmark/index.js delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/docs/repl.txt delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/docs/types/index.d.ts delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/docs/types/test.ts delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/examples/index.js delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/lib/index.js delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/lib/main.js delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/package.json delete mode 100644 lib/node_modules/@stdlib/utils/none-own-by/test/test.js diff --git a/lib/node_modules/@stdlib/utils/none-own-by/README.md b/lib/node_modules/@stdlib/utils/none-own-by/README.md deleted file mode 100644 index bec03b9b204d..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/README.md +++ /dev/null @@ -1,180 +0,0 @@ - - -# noneOwnBy - -> Tests whether every own property of an object fails a test implemented by a predicate function. - - - -
- -
- - - - - -
- -## Usage - -```javascript -var noneOwnBy = require( '@stdlib/utils/none-own-by' ); -``` - -#### noneOwnBy( object, predicate\[, thisArg ] ) - -Tests whether every `own` property of an object fails a test implemented by a `predicate` function. - -```javascript -function isUnderage( age ) { - return ( age < 18 ); -} - -var obj = { - 'a': 28, - 'b': 22, - 'c': 25 -}; - -var bool = noneOwnBy( obj, isUnderage ); -// returns true -``` - -If a `predicate` function returns a truthy value, the function **immediately** returns `false`. - -```javascript -function isUnderage( age ) { - return ( age < 18 ); -} - -var obj = { - 'a': 12, - 'b': 22, - 'c': 25 -}; - -var bool = noneOwnBy( obj, isUnderage ); -// returns false -``` - -
- - - - - -
- -## Notes - -- If the 1st argument is not an object or the second argument is not a fuction , the function throws a Type Error. - -- If provided an empty object, the function returns `true`. - - ```javascript - function truthy() { - return true; - } - var bool = noneOwnBy( {}, truthy ); - // returns true - ``` - -
- - - - - -
- -## Examples - - - -```javascript -var noneOwnBy = require( '@stdlib/utils/none-own-by' ); - -function isUnderage( age ) { - return age < 18; -} - -var obj = { - 'a': 26, - 'b': 20, - 'c': 25 -}; - -var bool = noneOwnBy( obj, isUnderage ); -// returns true -``` - -
- - - - - -
- -
- - - - - - - - - - - - - - diff --git a/lib/node_modules/@stdlib/utils/none-own-by/benchmark/index.js b/lib/node_modules/@stdlib/utils/none-own-by/benchmark/index.js deleted file mode 100644 index a48d76deecdf..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/benchmark/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); -var pkg = require( './../package.json' ).name; -var noneOwnBy = require( './../lib' ); - - -// MAIN // - -bench( pkg, function benchmark( b ) { - var bool; - var obj; - var i; - - function predicate( v ) { - return isnan( v ); - } - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - obj = { - 'a': i, - 'b': i+1, - 'c': i+2, - 'd': i+3 - }; - bool = noneOwnBy( obj, predicate ); - 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(); -}); diff --git a/lib/node_modules/@stdlib/utils/none-own-by/docs/repl.txt b/lib/node_modules/@stdlib/utils/none-own-by/docs/repl.txt deleted file mode 100644 index f2a33df8cc79..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/docs/repl.txt +++ /dev/null @@ -1,42 +0,0 @@ - -{{alias}}( object, predicate[, thisArg ] ) - Tests whether every own property of an object fails a test implemented - by a predicate function. - - The predicate function is provided three arguments: - - - value: property value. - - index: property key. - - object: the input object. - - The function immediately returns upon encountering a truthy return value. - - If provided an empty object, the function returns `true`. - - Parameters - ---------- - object: Object - Input object. - - predicate: Function - Test function. - - thisArg: any (optional) - Execution context. - - Returns - ------- - bool: boolean - The function returns `true` if the predicate function returns a falsy - value for all own properties; otherwise, the function returns `false`. - - Examples - -------- - > function isUnderage( v ) { return ( v < 18 ); }; - > var obj = { 'a': 11, 'b': 12, 'c': 22 }; - > var bool = {{alias}}( obj, isUnderage ) - false - - See Also - -------- - diff --git a/lib/node_modules/@stdlib/utils/none-own-by/docs/types/index.d.ts b/lib/node_modules/@stdlib/utils/none-own-by/docs/types/index.d.ts deleted file mode 100644 index 7ba3dda5632e..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/docs/types/index.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* -* @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 - -/// - - -/** -* Checks whether an own property of the object passes the test. -* -* @returns boolean indicating whether an own property of the object passes the test -*/ -type Nullary = ( this: U ) => boolean; - -/** -* Checks whether an own property of the object passes the test. -* -* @param value - property value -* @returns boolean indicating whether an own property of the object passes the test -*/ -type Unary = ( this: U, value: T ) => boolean; - -/** -* Checks whether an own property of the object passes the test. -* -* @param value - property value -* @param key - property key -* @returns boolean indicating whether an own property of the object passes the test -*/ -type Binary = ( this: U, value: T, key: number ) => boolean; - -/** -* Checks whether an own property of the object passes the test. -* -* @param value - property value -* @param key - property key -* @param object - input object -* @returns boolean indicating whether an own property of the object passes the test -*/ -type Ternary = ( this: U, value: T, key: number, object: Object ) => boolean; - -/** -* Checks whether an own property of the object passes the test. -* -* @param value - object value -* @param key - object key -* @param object - input object -* @returns boolean indicating whether an own property of the object passes the test -*/ -type Predicate = Nullary | Unary | Binary | Ternary; - -/** -* Tests whether every property of an object fails a test implemented by a predicate function. -* -* ## Notes -* -* - The predicate function is provided three arguments: -* -* - `value`: property value -* - `key`: property key -* - `object`: the input object -* -* - The function immediately returns upon encountering a truthy return value. -* - If provided an empty object, the function returns `true`. -* -* @param object - input object -* @param predicate - test function -* @param thisArg - execution context -* @returns boolean indicating whether every property fails a test -* -* @example -* function isUnderage( v ) { -* return ( v < 18 ); -* } -* -* var obj = { 'a': 20, 'b': 22, 'c': 25 }; -* -* var bool = noneOwnBy( obj, isUnderage ); -* // returns true -*/ -declare function noneOwnBy( object: Record, predicate: Predicate, thisArg?: ThisParameterType> ): boolean; - - -// EXPORTS // - -export = noneOwnBy; diff --git a/lib/node_modules/@stdlib/utils/none-own-by/docs/types/test.ts b/lib/node_modules/@stdlib/utils/none-own-by/docs/types/test.ts deleted file mode 100644 index c095398c5c5d..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/docs/types/test.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* -* @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 noneOwnBy = require( './index' ); - -const isUnderAge = ( v: number ): boolean => { - return ( v < 18 ); -}; - -// TESTS // - -const obj = { - 'a': 10, - 'b': 12, - 'c': 22 -}; - -// The function returns a boolean... -{ - noneOwnBy( obj, isUnderAge ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument which is not an object... -{ - noneOwnBy( 2, isUnderAge ); // $ExpectError - noneOwnBy( false, isUnderAge ); // $ExpectError - noneOwnBy( true, isUnderAge ); // $ExpectError - noneOwnBy( [ 1, 2 ], isUnderAge ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a function... -{ - noneOwnBy( obj , 2 ); // $ExpectError - noneOwnBy( obj , false ); // $ExpectError - noneOwnBy( obj , true ); // $ExpectError - noneOwnBy( obj , 'abc' ); // $ExpectError - noneOwnBy( obj , {} ); // $ExpectError - noneOwnBy( obj , [] ); // $ExpectError -} - -// The compiler throws an error if the function is provided an invalid number of arguments... -{ - noneOwnBy(); // $ExpectError - noneOwnBy( [ 1, 2, 3 ] ); // $ExpectError - noneOwnBy( [ 1, 2, 3 ], isUnderAge, {}, 3 ); // $ExpectError -} diff --git a/lib/node_modules/@stdlib/utils/none-own-by/examples/index.js b/lib/node_modules/@stdlib/utils/none-own-by/examples/index.js deleted file mode 100644 index bf73e63c6a7b..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/examples/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @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 noneOwnBy = require( './../lib' ); - -function isUnderage( age ) { - return age < 18; -} - -var obj = { - 'a': 26, - 'b': 20, - 'c': 25 -}; - -var bool = noneOwnBy( obj, isUnderage ); -console.log( bool ); -// => true diff --git a/lib/node_modules/@stdlib/utils/none-own-by/lib/index.js b/lib/node_modules/@stdlib/utils/none-own-by/lib/index.js deleted file mode 100644 index 903688c29517..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/lib/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @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 every "own" property of a provided object fails a test implemented by a predicate function. -* -* @module @stdlib/utils/none-own-by -* -* @example -* var noneOwnBy = require( '@stdlib/utils/none-own-by' ); -* -* function isUnderage( age ) { -* return age < 18; -* } -* -* var obj = { -* a : 10, -* b : 12, -* c : 15 -* }; -* -* var bool = noneOwnBy( obj, isUnderage ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/node_modules/@stdlib/utils/none-own-by/lib/main.js b/lib/node_modules/@stdlib/utils/none-own-by/lib/main.js deleted file mode 100644 index e2130d1ab35e..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/lib/main.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* @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 hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var isObject = require( '@stdlib/assert/is-object' ); -var format = require( '@stdlib/string/format' ); - - -// MAIN // - -/** -* Tests whether every own property of an object fails a test implemented by a predicate function. -* -* @param {Object} obj - input object -* @param {Function} predicate - test function -* @param {*} [thisArg] - execution context -* @throws {TypeError} first argument must be an object -* @throws {TypeError} second argument must be a function -* @returns {boolean} boolean indicating whether all elements fail a test -* -* @example -* function isUnderage( age ) { -* return ( age < 18 ); -* }; -* -* var obj = { -* 'a': 10, -* 'b': 12, -* 'c': 15 -* }; -* -* var bool = noneOwnBy( obj, isUnderage ); -* // returns false -*/ -function noneOwnBy( obj, predicate, thisArg ) { - var key; - - if ( !isObject( obj ) ) { - throw new TypeError( format(' invalid argument. First argument must be an object. Value: `%s`.', obj ) ); - } - if ( !isFunction( predicate ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) ); - } - for ( key in obj ) { - if ( hasOwnProp( obj, key ) && predicate.call( thisArg, obj[key], key, obj ) ) { - return false; - } - } - return true; -} - - -// EXPORTS // - -module.exports = noneOwnBy; diff --git a/lib/node_modules/@stdlib/utils/none-own-by/package.json b/lib/node_modules/@stdlib/utils/none-own-by/package.json deleted file mode 100644 index 59692f6d870c..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@stdlib/utils/none-own-by", - "version": "0.0.0", - "description": "Tests whether every own property of an object fails a test implemented by a predicate function.", - "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", - "stdutils", - "stdutil", - "utilities", - "utility", - "utils", - "util", - "test", - "predicate", - "none", - "all", - "every", - "object", - "iterate", - "validate" - ] -} diff --git a/lib/node_modules/@stdlib/utils/none-own-by/test/test.js b/lib/node_modules/@stdlib/utils/none-own-by/test/test.js deleted file mode 100644 index eac557e482e6..000000000000 --- a/lib/node_modules/@stdlib/utils/none-own-by/test/test.js +++ /dev/null @@ -1,122 +0,0 @@ -/** -* @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 noop = require( '@stdlib/utils/noop' ); -var noneOwnBy = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof noneOwnBy, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if not provided an object', function test( t ) { - var values; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - null, - void 0, - [], - function noop() {}, - /.*/, - new Date() - ]; - for ( i =0; i < values.length; i++ ) { - t.throws( badValue( values ), TypeError, 'throws a type error when provided '+values[i] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - noneOwnBy( value, noop ); - }; - } -}); - -tape( 'the function throws an error if not provided a predicate function', function test( t ) { - var values; - - values = { - 'a': 10, - 'b': 12, - 'c': 15 - }; - - t.throws( badValue( values ), TypeError, 'throws a type error when provided '+values ); - t.end(); - - function badValue( value ) { - return function badValue() { - noneOwnBy( value, value ); - }; - } -}); - -tape( 'the function returns `true` if all own properties fail a test ', function test( t ) { - var bool; - var obj; - - obj = { - 'a': 20, - 'b': 22, - 'c': 25 - }; - - function underAge( value ) { - return ( value < 18 ); - } - - bool = noneOwnBy( obj, underAge ); - - t.strictEqual( bool, true, 'returns true' ); - t.end(); -}); - -tape( 'the function returns `false` if one or more own properties pass a test', function test( t ) { - var bool; - var obj; - - obj = { - 'a': 10, - 'b': 12, - 'c': 15 - }; - - function underAge( value ) { - return ( value < 18 ); - } - - bool = noneOwnBy( obj, underAge ); - - t.strictEqual( bool, false, 'returns false' ); - t.end(); -});