@stdlib/utils-none-by 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +8 -8
- package/dist/index.js.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +4 -4
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -93,9 +93,9 @@ var bool = noneBy( arr, isPositive );
|
|
|
93
93
|
|
|
94
94
|
The invoked `function` is provided three arguments:
|
|
95
95
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
96
|
+
- **value**: collection element.
|
|
97
|
+
- **index**: collection index.
|
|
98
|
+
- **collection**: input collection.
|
|
99
99
|
|
|
100
100
|
To set the function execution context, provide a `thisArg`.
|
|
101
101
|
|
|
@@ -258,7 +258,7 @@ See [LICENSE][stdlib-license].
|
|
|
258
258
|
|
|
259
259
|
## Copyright
|
|
260
260
|
|
|
261
|
-
Copyright © 2016-
|
|
261
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
262
262
|
|
|
263
263
|
</section>
|
|
264
264
|
|
|
@@ -271,8 +271,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
271
271
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/utils-none-by.svg
|
|
272
272
|
[npm-url]: https://npmjs.org/package/@stdlib/utils-none-by
|
|
273
273
|
|
|
274
|
-
[test-image]: https://github.com/stdlib-js/utils-none-by/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
275
|
-
[test-url]: https://github.com/stdlib-js/utils-none-by/actions/workflows/test.yml?query=branch:v0.2.
|
|
274
|
+
[test-image]: https://github.com/stdlib-js/utils-none-by/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
275
|
+
[test-url]: https://github.com/stdlib-js/utils-none-by/actions/workflows/test.yml?query=branch:v0.2.3
|
|
276
276
|
|
|
277
277
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-none-by/main.svg
|
|
278
278
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-none-by?branch=main
|
|
@@ -284,8 +284,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
284
284
|
|
|
285
285
|
-->
|
|
286
286
|
|
|
287
|
-
[chat-image]: https://img.shields.io/
|
|
288
|
-
[chat-url]: https://
|
|
287
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
288
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
289
289
|
|
|
290
290
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
291
291
|
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isCollection = require( '@stdlib/assert-is-collection' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\nfunction noneBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils-none-by\n*\n* @example\n* var
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isCollection = require( '@stdlib/assert-is-collection' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Tests whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @param {Collection} collection - input collection\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} second argument must be a function\n* @returns {boolean} boolean indicating whether all elements fail a test\n*\n* @example\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\nfunction noneBy( collection, predicate, thisArg ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\tif ( !isCollection( collection ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tlen = collection.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout = predicate.call( thisArg, collection[ i ], i, collection );\n\t\tif ( out ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Account for dynamically resizing a collection:\n\t\tlen = collection.length;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = noneBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Test whether all elements in a collection fail a test implemented by a predicate function.\n*\n* @module @stdlib/utils-none-by\n*\n* @example\n* var noneBy = require( '@stdlib/utils-none-by' );\n*\n* function isPositive( v ) {\n* return ( v > 0 );\n* }\n*\n* var arr = [ -1, -2, -3, -4 ];\n*\n* var bool = noneBy( arr, isPositive );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
5
|
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAe,QAAS,8BAA+B,EACvDC,EAAa,QAAS,4BAA6B,EACnDC,EAAS,QAAS,uBAAwB,EAyB9C,SAASC,EAAQC,EAAYC,EAAWC,EAAU,CACjD,IAAIC,EACAC,EACAC,EACJ,GAAK,CAACT,EAAcI,CAAW,EAC9B,MAAM,IAAI,UAAWF,EAAQ,sEAAuEE,CAAW,CAAE,EAElH,GAAK,CAACH,EAAYI,CAAU,EAC3B,MAAM,IAAI,UAAWH,EAAQ,qEAAsEG,CAAU,CAAE,EAGhH,IADAG,EAAMJ,EAAW,OACXK,EAAI,EAAGA,EAAID,EAAKC,IAAM,CAE3B,GADAF,EAAMF,EAAU,KAAMC,EAASF,EAAYK,CAAE,EAAGA,EAAGL,CAAW,EACzDG,EACJ,MAAO,GAGRC,EAAMJ,EAAW,MAClB,CACA,MAAO,EACR,CAKAL,EAAO,QAAUI,IClCjB,IAAIO,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "isCollection", "isFunction", "format", "noneBy", "collection", "predicate", "thisArg", "out", "len", "i", "main"]
|
|
7
7
|
}
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/utils-none-by",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Test whether all elements in a collection fail a test implemented by a predicate function.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/assert-is-collection": "^0.2.
|
|
33
|
+
"@stdlib/assert-is-collection": "^0.2.3",
|
|
34
34
|
"@stdlib/assert-is-function": "^0.2.2",
|
|
35
|
-
"@stdlib/string-format": "^0.2.
|
|
36
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.2.
|
|
35
|
+
"@stdlib/string-format": "^0.2.3",
|
|
36
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {},
|
|
39
39
|
"engines": {
|