@ohos-ports/stdlib-process-read-stdin 0.2.3-beta.0 → 0.2.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@stdlib/assert-has-node-buffer-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/README.md +187 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js +7 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/buffer.js +28 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/lib/main.js +68 -0
- package/node_modules/@stdlib/assert-has-node-buffer-support/package.json +76 -0
- package/node_modules/@stdlib/assert-has-own-property/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-own-property/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-own-property/README.md +263 -0
- package/node_modules/@stdlib/assert-has-own-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-own-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-own-property/docs/types/index.d.ts +49 -0
- package/node_modules/@stdlib/assert-has-own-property/lib/index.js +47 -0
- package/node_modules/@stdlib/assert-has-own-property/lib/main.js +64 -0
- package/node_modules/@stdlib/assert-has-own-property/package.json +74 -0
- package/node_modules/@stdlib/assert-has-symbol-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-symbol-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-symbol-support/README.md +193 -0
- package/node_modules/@stdlib/assert-has-symbol-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-symbol-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-symbol-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-symbol-support/lib/main.js +42 -0
- package/node_modules/@stdlib/assert-has-symbol-support/package.json +73 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/LICENSE +177 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/NOTICE +1 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/README.md +187 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/docs/types/index.d.ts +35 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/lib/index.js +40 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js +49 -0
- package/node_modules/@stdlib/assert-has-tostringtag-support/package.json +79 -0
- package/node_modules/@stdlib/assert-is-array/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-array/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-array/README.md +183 -0
- package/node_modules/@stdlib/assert-is-array/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-array/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-array/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/assert-is-array/lib/index.js +43 -0
- package/node_modules/@stdlib/assert-is-array/lib/main.js +63 -0
- package/node_modules/@stdlib/assert-is-array/package.json +72 -0
- package/node_modules/@stdlib/assert-is-boolean/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-boolean/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-boolean/README.md +228 -0
- package/node_modules/@stdlib/assert-is-boolean/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.js +13 -0
- package/node_modules/@stdlib/assert-is-boolean/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-boolean/docs/types/index.d.ts +125 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/index.js +73 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/main.js +62 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/object.js +68 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/primitive.js +48 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/tostring.js +27 -0
- package/node_modules/@stdlib/assert-is-boolean/lib/try2serialize.js +47 -0
- package/node_modules/@stdlib/assert-is-boolean/package.json +80 -0
- package/node_modules/@stdlib/assert-is-buffer/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-buffer/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-buffer/README.md +223 -0
- package/node_modules/@stdlib/assert-is-buffer/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-buffer/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-buffer/docs/types/index.d.ts +50 -0
- package/node_modules/@stdlib/assert-is-buffer/lib/index.js +43 -0
- package/node_modules/@stdlib/assert-is-buffer/lib/main.js +70 -0
- package/node_modules/@stdlib/assert-is-buffer/package.json +73 -0
- package/node_modules/@stdlib/assert-is-function/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-function/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-function/README.md +192 -0
- package/node_modules/@stdlib/assert-is-function/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-function/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-function/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/assert-is-function/lib/index.js +44 -0
- package/node_modules/@stdlib/assert-is-function/lib/main.js +50 -0
- package/node_modules/@stdlib/assert-is-function/package.json +74 -0
- package/node_modules/@stdlib/assert-is-object-like/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-object-like/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-object-like/README.md +264 -0
- package/node_modules/@stdlib/assert-is-object-like/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-is-object-like/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-object-like/docs/types/index.d.ts +48 -0
- package/node_modules/@stdlib/assert-is-object-like/lib/index.js +67 -0
- package/node_modules/@stdlib/assert-is-object-like/lib/main.js +49 -0
- package/node_modules/@stdlib/assert-is-object-like/package.json +79 -0
- package/node_modules/@stdlib/assert-is-string/LICENSE +177 -0
- package/node_modules/@stdlib/assert-is-string/NOTICE +1 -0
- package/node_modules/@stdlib/assert-is-string/README.md +224 -0
- package/node_modules/@stdlib/assert-is-string/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.js +13 -0
- package/node_modules/@stdlib/assert-is-string/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-is-string/docs/types/index.d.ts +101 -0
- package/node_modules/@stdlib/assert-is-string/lib/index.js +73 -0
- package/node_modules/@stdlib/assert-is-string/lib/main.js +50 -0
- package/node_modules/@stdlib/assert-is-string/lib/object.js +65 -0
- package/node_modules/@stdlib/assert-is-string/lib/primitive.js +42 -0
- package/node_modules/@stdlib/assert-is-string/lib/try2valueof.js +47 -0
- package/node_modules/@stdlib/assert-is-string/lib/valueof.js +27 -0
- package/node_modules/@stdlib/assert-is-string/package.json +80 -0
- package/node_modules/@stdlib/assert-tools-array-function/LICENSE +177 -0
- package/node_modules/@stdlib/assert-tools-array-function/NOTICE +1 -0
- package/node_modules/@stdlib/assert-tools-array-function/README.md +216 -0
- package/node_modules/@stdlib/assert-tools-array-function/SECURITY.md +5 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.js +5 -0
- package/node_modules/@stdlib/assert-tools-array-function/dist/index.js.map +7 -0
- package/node_modules/@stdlib/assert-tools-array-function/docs/types/index.d.ts +61 -0
- package/node_modules/@stdlib/assert-tools-array-function/lib/index.js +49 -0
- package/node_modules/@stdlib/assert-tools-array-function/lib/main.js +85 -0
- package/node_modules/@stdlib/assert-tools-array-function/package.json +73 -0
- package/node_modules/@stdlib/boolean-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/boolean-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/boolean-ctor/README.md +264 -0
- package/node_modules/@stdlib/boolean-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.js +5 -0
- package/node_modules/@stdlib/boolean-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/boolean-ctor/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/boolean-ctor/lib/index.js +52 -0
- package/node_modules/@stdlib/boolean-ctor/lib/main.js +51 -0
- package/node_modules/@stdlib/boolean-ctor/package.json +61 -0
- package/node_modules/@stdlib/buffer-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/buffer-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/buffer-ctor/README.md +273 -0
- package/node_modules/@stdlib/buffer-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.js +19 -0
- package/node_modules/@stdlib/buffer-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/buffer-ctor/docs/types/index.d.ts +37 -0
- package/node_modules/@stdlib/buffer-ctor/lib/index.js +52 -0
- package/node_modules/@stdlib/buffer-ctor/lib/main.js +28 -0
- package/node_modules/@stdlib/buffer-ctor/lib/polyfill.js +37 -0
- package/node_modules/@stdlib/buffer-ctor/package.json +66 -0
- package/node_modules/@stdlib/buffer-from-string/LICENSE +177 -0
- package/node_modules/@stdlib/buffer-from-string/NOTICE +1 -0
- package/node_modules/@stdlib/buffer-from-string/README.md +249 -0
- package/node_modules/@stdlib/buffer-from-string/SECURITY.md +5 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.js +19 -0
- package/node_modules/@stdlib/buffer-from-string/dist/index.js.map +7 -0
- package/node_modules/@stdlib/buffer-from-string/docs/types/index.d.ts +42 -0
- package/node_modules/@stdlib/buffer-from-string/lib/has_from.js +34 -0
- package/node_modules/@stdlib/buffer-from-string/lib/index.js +52 -0
- package/node_modules/@stdlib/buffer-from-string/lib/main.js +60 -0
- package/node_modules/@stdlib/buffer-from-string/lib/polyfill.js +60 -0
- package/node_modules/@stdlib/buffer-from-string/package.json +74 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/LICENSE +177 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/NOTICE +1 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/README.md +182 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/SECURITY.md +5 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js +5 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js.map +7 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/docs/types/index.d.ts +39 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/index.js +40 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js +48 -0
- package/node_modules/@stdlib/error-tools-fmtprodmsg/package.json +71 -0
- package/node_modules/@stdlib/regexp-function-name/LICENSE +177 -0
- package/node_modules/@stdlib/regexp-function-name/NOTICE +1 -0
- package/node_modules/@stdlib/regexp-function-name/README.md +215 -0
- package/node_modules/@stdlib/regexp-function-name/SECURITY.md +5 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.js +8 -0
- package/node_modules/@stdlib/regexp-function-name/dist/index.js.map +7 -0
- package/node_modules/@stdlib/regexp-function-name/docs/types/index.d.ts +74 -0
- package/node_modules/@stdlib/regexp-function-name/lib/index.js +61 -0
- package/node_modules/@stdlib/regexp-function-name/lib/main.js +54 -0
- package/node_modules/@stdlib/regexp-function-name/lib/regexp.js +60 -0
- package/node_modules/@stdlib/regexp-function-name/package.json +68 -0
- package/node_modules/@stdlib/streams-node-stdin/LICENSE +177 -0
- package/node_modules/@stdlib/streams-node-stdin/NOTICE +1 -0
- package/node_modules/@stdlib/streams-node-stdin/README.md +227 -0
- package/node_modules/@stdlib/streams-node-stdin/SECURITY.md +5 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.js +5 -0
- package/node_modules/@stdlib/streams-node-stdin/dist/index.js.map +7 -0
- package/node_modules/@stdlib/streams-node-stdin/docs/types/index.d.ts +31 -0
- package/node_modules/@stdlib/streams-node-stdin/lib/index.js +41 -0
- package/node_modules/@stdlib/streams-node-stdin/lib/main.js +28 -0
- package/node_modules/@stdlib/streams-node-stdin/package.json +65 -0
- package/node_modules/@stdlib/string-base-format-interpolate/LICENSE +177 -0
- package/node_modules/@stdlib/string-base-format-interpolate/NOTICE +1 -0
- package/node_modules/@stdlib/string-base-format-interpolate/README.md +219 -0
- package/node_modules/@stdlib/string-base-format-interpolate/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js +17 -0
- package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-base-format-interpolate/docs/types/index.d.ts +71 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js +103 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js +115 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/index.js +41 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js +46 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js +42 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/main.js +243 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js +65 -0
- package/node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js +84 -0
- package/node_modules/@stdlib/string-base-format-interpolate/package.json +72 -0
- package/node_modules/@stdlib/string-base-format-tokenize/LICENSE +177 -0
- package/node_modules/@stdlib/string-base-format-tokenize/NOTICE +1 -0
- package/node_modules/@stdlib/string-base-format-tokenize/README.md +203 -0
- package/node_modules/@stdlib/string-base-format-tokenize/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js +5 -0
- package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-base-format-tokenize/docs/types/index.d.ts +68 -0
- package/node_modules/@stdlib/string-base-format-tokenize/lib/index.js +41 -0
- package/node_modules/@stdlib/string-base-format-tokenize/lib/main.js +95 -0
- package/node_modules/@stdlib/string-base-format-tokenize/package.json +70 -0
- package/node_modules/@stdlib/string-format/LICENSE +177 -0
- package/node_modules/@stdlib/string-format/NOTICE +1 -0
- package/node_modules/@stdlib/string-format/README.md +341 -0
- package/node_modules/@stdlib/string-format/SECURITY.md +5 -0
- package/node_modules/@stdlib/string-format/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/string-format/dist/index.js +7 -0
- package/node_modules/@stdlib/string-format/dist/index.js.map +7 -0
- package/node_modules/@stdlib/string-format/docs/types/index.d.ts +42 -0
- package/node_modules/@stdlib/string-format/lib/index.js +43 -0
- package/node_modules/@stdlib/string-format/lib/is_string.js +42 -0
- package/node_modules/@stdlib/string-format/lib/main.js +64 -0
- package/node_modules/@stdlib/string-format/package.json +73 -0
- package/node_modules/@stdlib/symbol-ctor/LICENSE +177 -0
- package/node_modules/@stdlib/symbol-ctor/NOTICE +1 -0
- package/node_modules/@stdlib/symbol-ctor/README.md +234 -0
- package/node_modules/@stdlib/symbol-ctor/SECURITY.md +5 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.js +5 -0
- package/node_modules/@stdlib/symbol-ctor/dist/index.js.map +7 -0
- package/node_modules/@stdlib/symbol-ctor/docs/types/index.d.ts +34 -0
- package/node_modules/@stdlib/symbol-ctor/lib/index.js +40 -0
- package/node_modules/@stdlib/symbol-ctor/lib/main.js +28 -0
- package/node_modules/@stdlib/symbol-ctor/package.json +63 -0
- package/node_modules/@stdlib/types/LICENSE +177 -0
- package/node_modules/@stdlib/types/NOTICE +1 -0
- package/node_modules/@stdlib/types/README.md +212 -0
- package/node_modules/@stdlib/types/SECURITY.md +5 -0
- package/node_modules/@stdlib/types/index.d.ts +3923 -0
- package/node_modules/@stdlib/types/lib/browser.js +28 -0
- package/node_modules/@stdlib/types/lib/index.js +39 -0
- package/node_modules/@stdlib/types/lib/main.js +40 -0
- package/node_modules/@stdlib/types/package.json +68 -0
- package/node_modules/@stdlib/types/test.ts +734 -0
- package/node_modules/@stdlib/utils-constructor-name/LICENSE +177 -0
- package/node_modules/@stdlib/utils-constructor-name/NOTICE +1 -0
- package/node_modules/@stdlib/utils-constructor-name/README.md +400 -0
- package/node_modules/@stdlib/utils-constructor-name/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.js +5 -0
- package/node_modules/@stdlib/utils-constructor-name/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-constructor-name/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-constructor-name/lib/index.js +46 -0
- package/node_modules/@stdlib/utils-constructor-name/lib/main.js +80 -0
- package/node_modules/@stdlib/utils-constructor-name/package.json +77 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/LICENSE +177 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/NOTICE +1 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/README.md +216 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js +31 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/main.js +58 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/index.js +47 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js +58 -0
- package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/package.json +93 -0
- package/node_modules/@stdlib/utils-define-property/LICENSE +177 -0
- package/node_modules/@stdlib/utils-define-property/NOTICE +1 -0
- package/node_modules/@stdlib/utils-define-property/README.md +228 -0
- package/node_modules/@stdlib/utils-define-property/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.js +36 -0
- package/node_modules/@stdlib/utils-define-property/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-define-property/docs/types/index.d.ts +52 -0
- package/node_modules/@stdlib/utils-define-property/lib/builtin.js +61 -0
- package/node_modules/@stdlib/utils-define-property/lib/define_property.js +28 -0
- package/node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js +51 -0
- package/node_modules/@stdlib/utils-define-property/lib/index.js +58 -0
- package/node_modules/@stdlib/utils-define-property/lib/polyfill.js +122 -0
- package/node_modules/@stdlib/utils-define-property/package.json +75 -0
- package/node_modules/@stdlib/utils-global/LICENSE +177 -0
- package/node_modules/@stdlib/utils-global/NOTICE +1 -0
- package/node_modules/@stdlib/utils-global/README.md +208 -0
- package/node_modules/@stdlib/utils-global/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-global/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-global/dist/index.js +36 -0
- package/node_modules/@stdlib/utils-global/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-global/docs/types/index.d.ts +40 -0
- package/node_modules/@stdlib/utils-global/lib/browser.js +79 -0
- package/node_modules/@stdlib/utils-global/lib/codegen.js +36 -0
- package/node_modules/@stdlib/utils-global/lib/global.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/global_this.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/index.js +40 -0
- package/node_modules/@stdlib/utils-global/lib/main.js +83 -0
- package/node_modules/@stdlib/utils-global/lib/self.js +28 -0
- package/node_modules/@stdlib/utils-global/lib/window.js +28 -0
- package/node_modules/@stdlib/utils-global/package.json +74 -0
- package/node_modules/@stdlib/utils-native-class/LICENSE +177 -0
- package/node_modules/@stdlib/utils-native-class/NOTICE +1 -0
- package/node_modules/@stdlib/utils-native-class/README.md +349 -0
- package/node_modules/@stdlib/utils-native-class/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.js +11 -0
- package/node_modules/@stdlib/utils-native-class/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-native-class/docs/types/index.d.ts +51 -0
- package/node_modules/@stdlib/utils-native-class/lib/index.js +61 -0
- package/node_modules/@stdlib/utils-native-class/lib/main.js +56 -0
- package/node_modules/@stdlib/utils-native-class/lib/polyfill.js +81 -0
- package/node_modules/@stdlib/utils-native-class/lib/tostring.js +28 -0
- package/node_modules/@stdlib/utils-native-class/lib/tostringtag.js +33 -0
- package/node_modules/@stdlib/utils-native-class/package.json +84 -0
- package/node_modules/@stdlib/utils-next-tick/LICENSE +177 -0
- package/node_modules/@stdlib/utils-next-tick/NOTICE +1 -0
- package/node_modules/@stdlib/utils-next-tick/README.md +183 -0
- package/node_modules/@stdlib/utils-next-tick/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.js +5 -0
- package/node_modules/@stdlib/utils-next-tick/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-next-tick/docs/types/index.d.ts +43 -0
- package/node_modules/@stdlib/utils-next-tick/lib/index.js +43 -0
- package/node_modules/@stdlib/utils-next-tick/lib/main.js +72 -0
- package/node_modules/@stdlib/utils-next-tick/package.json +77 -0
- package/node_modules/@stdlib/utils-type-of/LICENSE +177 -0
- package/node_modules/@stdlib/utils-type-of/NOTICE +1 -0
- package/node_modules/@stdlib/utils-type-of/README.md +366 -0
- package/node_modules/@stdlib/utils-type-of/SECURITY.md +5 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.d.ts +3 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.js +15 -0
- package/node_modules/@stdlib/utils-type-of/dist/index.js.map +7 -0
- package/node_modules/@stdlib/utils-type-of/docs/types/index.d.ts +50 -0
- package/node_modules/@stdlib/utils-type-of/lib/check.js +55 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/nodelist.js +34 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/re.js +26 -0
- package/node_modules/@stdlib/utils-type-of/lib/fixtures/typedarray.js +26 -0
- package/node_modules/@stdlib/utils-type-of/lib/index.js +50 -0
- package/node_modules/@stdlib/utils-type-of/lib/main.js +76 -0
- package/node_modules/@stdlib/utils-type-of/lib/polyfill.js +41 -0
- package/node_modules/@stdlib/utils-type-of/package.json +72 -0
- package/package.json +36 -5
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
@license Apache-2.0
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2018 The Stdlib Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
|
|
27
|
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
|
|
28
|
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
|
|
29
|
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
# Array Function
|
|
33
|
+
|
|
34
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
35
|
+
|
|
36
|
+
> Return a function which tests if every element in an array passes a test condition.
|
|
37
|
+
|
|
38
|
+
<section class="installation">
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @stdlib/assert-tools-array-function
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<section class="usage">
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
var arrayfcn = require( '@stdlib/assert-tools-array-function' );
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
<a name="arrayfcn"></a>
|
|
57
|
+
|
|
58
|
+
#### arrayfcn( predicate )
|
|
59
|
+
|
|
60
|
+
Returns a function which tests if every element in an [`array`][mdn-array] passes a test condition. Given an input [`array`][mdn-array], the function returns `true` if all elements pass the test and `false` otherwise.
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
var isOdd = require( '@stdlib/assert-is-odd' );
|
|
64
|
+
|
|
65
|
+
var arr1 = [ 1, 3, 5, 7 ];
|
|
66
|
+
var arr2 = [ 3, 5, 8 ];
|
|
67
|
+
|
|
68
|
+
var f = arrayfcn( isOdd );
|
|
69
|
+
|
|
70
|
+
var bool = f( arr1 );
|
|
71
|
+
// returns true
|
|
72
|
+
|
|
73
|
+
bool = f( arr2 );
|
|
74
|
+
// returns false
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
</section>
|
|
78
|
+
|
|
79
|
+
<!-- /.usage -->
|
|
80
|
+
|
|
81
|
+
<section class="notes">
|
|
82
|
+
|
|
83
|
+
## Notes
|
|
84
|
+
|
|
85
|
+
- The returned function will return `false` if **not** provided an [`array`][mdn-array].
|
|
86
|
+
- The returned function will return `false` if provided an empty [`array`][mdn-array].
|
|
87
|
+
- A `predicate` function should accept a single argument: an [`array`][mdn-array] element. If the [`array`][mdn-array] element satisfies a test condition, the `predicate` function should return `true`; otherwise, the `predicate` function should return `false`.
|
|
88
|
+
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
<!-- /.notes -->
|
|
92
|
+
|
|
93
|
+
<section class="examples">
|
|
94
|
+
|
|
95
|
+
## Examples
|
|
96
|
+
|
|
97
|
+
<!-- eslint no-undef: "error" -->
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
var isEven = require( '@stdlib/assert-is-even' );
|
|
101
|
+
var arrayfcn = require( '@stdlib/assert-tools-array-function' );
|
|
102
|
+
|
|
103
|
+
var arr1;
|
|
104
|
+
var arr2;
|
|
105
|
+
var bool;
|
|
106
|
+
var f;
|
|
107
|
+
var i;
|
|
108
|
+
|
|
109
|
+
arr1 = new Array( 25 );
|
|
110
|
+
for ( i = 0; i < arr1.length; i++ ) {
|
|
111
|
+
arr1[ i ] = i;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
arr2 = new Array( 25 );
|
|
115
|
+
for ( i = 0; i < arr2.length; i++ ) {
|
|
116
|
+
arr2[ i ] = 2 * i;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
f = arrayfcn( isEven );
|
|
120
|
+
|
|
121
|
+
bool = f( arr1 );
|
|
122
|
+
// returns false
|
|
123
|
+
|
|
124
|
+
bool = f( arr2 );
|
|
125
|
+
// returns true
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
</section>
|
|
129
|
+
|
|
130
|
+
<!-- /.examples -->
|
|
131
|
+
|
|
132
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
133
|
+
|
|
134
|
+
<section class="related">
|
|
135
|
+
|
|
136
|
+
</section>
|
|
137
|
+
|
|
138
|
+
<!-- /.related -->
|
|
139
|
+
|
|
140
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<section class="main-repo" >
|
|
144
|
+
|
|
145
|
+
* * *
|
|
146
|
+
|
|
147
|
+
## Notice
|
|
148
|
+
|
|
149
|
+
This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
|
|
150
|
+
|
|
151
|
+
For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
|
|
152
|
+
|
|
153
|
+
#### Community
|
|
154
|
+
|
|
155
|
+
[![Chat][chat-image]][chat-url]
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
See [LICENSE][stdlib-license].
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
## Copyright
|
|
165
|
+
|
|
166
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
167
|
+
|
|
168
|
+
</section>
|
|
169
|
+
|
|
170
|
+
<!-- /.stdlib -->
|
|
171
|
+
|
|
172
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
173
|
+
|
|
174
|
+
<section class="links">
|
|
175
|
+
|
|
176
|
+
[npm-image]: http://img.shields.io/npm/v/@stdlib/assert-tools-array-function.svg
|
|
177
|
+
[npm-url]: https://npmjs.org/package/@stdlib/assert-tools-array-function
|
|
178
|
+
|
|
179
|
+
[test-image]: https://github.com/stdlib-js/assert-tools-array-function/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
180
|
+
[test-url]: https://github.com/stdlib-js/assert-tools-array-function/actions/workflows/test.yml?query=branch:v0.2.3
|
|
181
|
+
|
|
182
|
+
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/assert-tools-array-function/main.svg
|
|
183
|
+
[coverage-url]: https://codecov.io/github/stdlib-js/assert-tools-array-function?branch=main
|
|
184
|
+
|
|
185
|
+
<!--
|
|
186
|
+
|
|
187
|
+
[dependencies-image]: https://img.shields.io/david/stdlib-js/assert-tools-array-function.svg
|
|
188
|
+
[dependencies-url]: https://david-dm.org/stdlib-js/assert-tools-array-function/main
|
|
189
|
+
|
|
190
|
+
-->
|
|
191
|
+
|
|
192
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
193
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
194
|
+
|
|
195
|
+
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
196
|
+
|
|
197
|
+
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
198
|
+
|
|
199
|
+
[umd]: https://github.com/umdjs/umd
|
|
200
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
201
|
+
|
|
202
|
+
[deno-url]: https://github.com/stdlib-js/assert-tools-array-function/tree/deno
|
|
203
|
+
[deno-readme]: https://github.com/stdlib-js/assert-tools-array-function/blob/deno/README.md
|
|
204
|
+
[umd-url]: https://github.com/stdlib-js/assert-tools-array-function/tree/umd
|
|
205
|
+
[umd-readme]: https://github.com/stdlib-js/assert-tools-array-function/blob/umd/README.md
|
|
206
|
+
[esm-url]: https://github.com/stdlib-js/assert-tools-array-function/tree/esm
|
|
207
|
+
[esm-readme]: https://github.com/stdlib-js/assert-tools-array-function/blob/esm/README.md
|
|
208
|
+
[branches-url]: https://github.com/stdlib-js/assert-tools-array-function/blob/main/branches.md
|
|
209
|
+
|
|
210
|
+
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/assert-tools-array-function/main/LICENSE
|
|
211
|
+
|
|
212
|
+
[mdn-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
213
|
+
|
|
214
|
+
</section>
|
|
215
|
+
|
|
216
|
+
<!-- /.links -->
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var a=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var u=a(function(y,f){
|
|
2
|
+
var s=require('@stdlib/assert-is-array/dist'),o=require('@stdlib/error-tools-fmtprodmsg/dist');function l(e){if(typeof e!="function")throw new TypeError(o('0BB3J',e));return r;function r(t){var i,n;if(!s(t)||(i=t.length,i===0))return!1;for(n=0;n<i;n++)if(e(t[n])===!1)return!1;return!0}}f.exports=l
|
|
3
|
+
});var v=u();module.exports=v;
|
|
4
|
+
/** @license Apache-2.0 */
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 isArray = require( '@stdlib/assert-is-array' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* var isOdd = require( '@stdlib/assert-is-odd' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = arrayfcn;\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* Return a function which tests if every element in an array passes a test condition.\n*\n* @module @stdlib/assert-tools-array-function\n*\n* @example\n* var isOdd = require( '@stdlib/assert-is-odd' );\n* var arrayfcn = require( '@stdlib/assert-tools-array-function' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,yBAA0B,EAC7CC,EAAS,QAAS,uBAAwB,EA0B9C,SAASC,EAAUC,EAAY,CAC9B,GAAK,OAAOA,GAAc,WACzB,MAAM,IAAI,UAAWF,EAAQ,0DAA2DE,CAAU,CAAE,EAErG,OAAOC,EASP,SAASA,EAAOC,EAAQ,CACvB,IAAIC,EACAC,EAKJ,GAJK,CAACP,EAASK,CAAM,IAGrBC,EAAMD,EAAM,OACPC,IAAQ,GACZ,MAAO,GAER,IAAMC,EAAI,EAAGA,EAAID,EAAKC,IACrB,GAAKJ,EAAWE,EAAOE,CAAE,CAAE,IAAM,GAChC,MAAO,GAGT,MAAO,EACR,CACD,CAKAR,EAAO,QAAUG,ICzCjB,IAAIM,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_main", "__commonJSMin", "exports", "module", "isArray", "format", "arrayfcn", "predicate", "every", "value", "len", "i", "main"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2019 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// TypeScript Version: 4.1
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Predicate function.
|
|
23
|
+
*
|
|
24
|
+
* @param elem - array element
|
|
25
|
+
* @returns test result
|
|
26
|
+
*/
|
|
27
|
+
type PredicateFunction = ( elem: any ) => boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns a function which tests if every element in an array passes a test condition.
|
|
31
|
+
*
|
|
32
|
+
* ## Notes
|
|
33
|
+
*
|
|
34
|
+
* - The predicate function should accept a single argument: an array element. If the array element satisfies a test condition, the function should return `true`; otherwise, the function should return `false`.
|
|
35
|
+
* - Given an input array, the returned function returns `true` if all elements pass the test and `false` otherwise.
|
|
36
|
+
* - The returned function returns `false` if provided an empty array.
|
|
37
|
+
* - The returned function returns `false` if not provided an array.
|
|
38
|
+
*
|
|
39
|
+
* @param predicate - function to apply
|
|
40
|
+
* @returns an array function
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* var isOdd = require( '@stdlib/assert-is-odd' );
|
|
44
|
+
*
|
|
45
|
+
* var arr1 = [ 1, 3, 5, 7 ];
|
|
46
|
+
* var arr2 = [ 3, 5, 8 ];
|
|
47
|
+
*
|
|
48
|
+
* var validate = arrayfcn( isOdd );
|
|
49
|
+
*
|
|
50
|
+
* var bool = validate( arr1 );
|
|
51
|
+
* // returns true
|
|
52
|
+
*
|
|
53
|
+
* bool = validate( arr2 );
|
|
54
|
+
* // returns false
|
|
55
|
+
*/
|
|
56
|
+
declare function arrayfcn( predicate: PredicateFunction ): Function;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// EXPORTS //
|
|
60
|
+
|
|
61
|
+
export = arrayfcn;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Return a function which tests if every element in an array passes a test condition.
|
|
23
|
+
*
|
|
24
|
+
* @module @stdlib/assert-tools-array-function
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* var isOdd = require( '@stdlib/assert-is-odd' );
|
|
28
|
+
* var arrayfcn = require( '@stdlib/assert-tools-array-function' );
|
|
29
|
+
*
|
|
30
|
+
* var arr1 = [ 1, 3, 5, 7 ];
|
|
31
|
+
* var arr2 = [ 3, 5, 8 ];
|
|
32
|
+
*
|
|
33
|
+
* var validate = arrayfcn( isOdd );
|
|
34
|
+
*
|
|
35
|
+
* var bool = validate( arr1 );
|
|
36
|
+
* // returns true
|
|
37
|
+
*
|
|
38
|
+
* bool = validate( arr2 );
|
|
39
|
+
* // returns false
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
// MODULES //
|
|
43
|
+
|
|
44
|
+
var main = require( './main.js' );
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// EXPORTS //
|
|
48
|
+
|
|
49
|
+
module.exports = main;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
// MODULES //
|
|
22
|
+
|
|
23
|
+
var isArray = require( '@stdlib/assert-is-array' );
|
|
24
|
+
var format = require( '@stdlib/string-format' );
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// MAIN //
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns a function which tests if every element in an array passes a test condition.
|
|
31
|
+
*
|
|
32
|
+
* @param {Function} predicate - function to apply
|
|
33
|
+
* @throws {TypeError} must provide a function
|
|
34
|
+
* @returns {Function} an array function
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* var isOdd = require( '@stdlib/assert-is-odd' );
|
|
38
|
+
*
|
|
39
|
+
* var arr1 = [ 1, 3, 5, 7 ];
|
|
40
|
+
* var arr2 = [ 3, 5, 8 ];
|
|
41
|
+
*
|
|
42
|
+
* var validate = arrayfcn( isOdd );
|
|
43
|
+
*
|
|
44
|
+
* var bool = validate( arr1 );
|
|
45
|
+
* // returns true
|
|
46
|
+
*
|
|
47
|
+
* bool = validate( arr2 );
|
|
48
|
+
* // returns false
|
|
49
|
+
*/
|
|
50
|
+
function arrayfcn( predicate ) {
|
|
51
|
+
if ( typeof predicate !== 'function' ) {
|
|
52
|
+
throw new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );
|
|
53
|
+
}
|
|
54
|
+
return every;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tests if every element in an array passes a test condition.
|
|
58
|
+
*
|
|
59
|
+
* @private
|
|
60
|
+
* @param {*} value - value to test
|
|
61
|
+
* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition
|
|
62
|
+
*/
|
|
63
|
+
function every( value ) {
|
|
64
|
+
var len;
|
|
65
|
+
var i;
|
|
66
|
+
if ( !isArray( value ) ) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
len = value.length;
|
|
70
|
+
if ( len === 0 ) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
for ( i = 0; i < len; i++ ) {
|
|
74
|
+
if ( predicate( value[ i ] ) === false ) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// EXPORTS //
|
|
84
|
+
|
|
85
|
+
module.exports = arrayfcn;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stdlib/assert-tools-array-function",
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Return a function which tests if every element in an array passes a test condition.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "The Stdlib Authors",
|
|
8
|
+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
|
|
9
|
+
},
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "The Stdlib Authors",
|
|
13
|
+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"main": "./lib",
|
|
17
|
+
"directories": {
|
|
18
|
+
"doc": "./docs",
|
|
19
|
+
"lib": "./lib",
|
|
20
|
+
"dist": "./dist"
|
|
21
|
+
},
|
|
22
|
+
"types": "./docs/types",
|
|
23
|
+
"scripts": {},
|
|
24
|
+
"homepage": "https://stdlib.io",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git://github.com/stdlib-js/assert-tools-array-function.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@stdlib/assert-is-array": "^0.2.2",
|
|
34
|
+
"@stdlib/string-format": "^0.2.3",
|
|
35
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=0.10.0",
|
|
40
|
+
"npm": ">2.7.0"
|
|
41
|
+
},
|
|
42
|
+
"os": [
|
|
43
|
+
"aix",
|
|
44
|
+
"darwin",
|
|
45
|
+
"freebsd",
|
|
46
|
+
"linux",
|
|
47
|
+
"macos",
|
|
48
|
+
"openbsd",
|
|
49
|
+
"openharmony",
|
|
50
|
+
"sunos",
|
|
51
|
+
"win32",
|
|
52
|
+
"windows"
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"stdlib",
|
|
56
|
+
"stdassert",
|
|
57
|
+
"tools",
|
|
58
|
+
"tool",
|
|
59
|
+
"valid",
|
|
60
|
+
"validate",
|
|
61
|
+
"assert",
|
|
62
|
+
"is",
|
|
63
|
+
"apply",
|
|
64
|
+
"array",
|
|
65
|
+
"test",
|
|
66
|
+
"check",
|
|
67
|
+
"function"
|
|
68
|
+
],
|
|
69
|
+
"funding": {
|
|
70
|
+
"type": "opencollective",
|
|
71
|
+
"url": "https://opencollective.com/stdlib"
|
|
72
|
+
}
|
|
73
|
+
}
|