summaryrefslogtreecommitdiff
path: root/alarm/node_modules/@arr/every
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
committerMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
commit2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch)
tree17848d95522dab25d3cdeb9c4a6450e2a234861f /alarm/node_modules/@arr/every
parent108525534c28013cfe1897c30e4565f9893f3766 (diff)
downloadpluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip
Update
Diffstat (limited to 'alarm/node_modules/@arr/every')
-rw-r--r--alarm/node_modules/@arr/every/index.js11
-rw-r--r--alarm/node_modules/@arr/every/module.d.ts1
-rw-r--r--alarm/node_modules/@arr/every/module.js11
-rw-r--r--alarm/node_modules/@arr/every/package.json30
-rw-r--r--alarm/node_modules/@arr/every/readme.md45
5 files changed, 98 insertions, 0 deletions
diff --git a/alarm/node_modules/@arr/every/index.js b/alarm/node_modules/@arr/every/index.js
new file mode 100644
index 0000000..170cc49
--- /dev/null
+++ b/alarm/node_modules/@arr/every/index.js
@@ -0,0 +1,11 @@
+module.exports = function (arr, cb) {
+ var i=0, len=arr.length;
+
+ for (; i < len; i++) {
+ if (!cb(arr[i], i, arr)) {
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/alarm/node_modules/@arr/every/module.d.ts b/alarm/node_modules/@arr/every/module.d.ts
new file mode 100644
index 0000000..f2935dc
--- /dev/null
+++ b/alarm/node_modules/@arr/every/module.d.ts
@@ -0,0 +1 @@
+export default function<T>(arr: T[], callback: (val: T, idx: number, arr: T[]) => unknown): boolean;
diff --git a/alarm/node_modules/@arr/every/module.js b/alarm/node_modules/@arr/every/module.js
new file mode 100644
index 0000000..18a4208
--- /dev/null
+++ b/alarm/node_modules/@arr/every/module.js
@@ -0,0 +1,11 @@
+export default function (arr, cb) {
+ var i=0, len=arr.length;
+
+ for (; i < len; i++) {
+ if (!cb(arr[i], i, arr)) {
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/alarm/node_modules/@arr/every/package.json b/alarm/node_modules/@arr/every/package.json
new file mode 100644
index 0000000..b82e2cc
--- /dev/null
+++ b/alarm/node_modules/@arr/every/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "@arr/every",
+ "version": "1.0.1",
+ "repository": "lukeed/arr",
+ "description": "A tiny, faster alternative to native Array.prototype.every",
+ "types": "module.d.ts",
+ "module": "module.js",
+ "main": "index.js",
+ "license": "MIT",
+ "author": {
+ "name": "Luke Edwards",
+ "email": "luke.edwards05@gmail.com",
+ "url": "https://lukeed.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "keywords": [
+ "arr",
+ "array",
+ "Array.every",
+ "Array.prototype.every",
+ "performance",
+ "native",
+ "every"
+ ],
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/alarm/node_modules/@arr/every/readme.md b/alarm/node_modules/@arr/every/readme.md
new file mode 100644
index 0000000..31cad87
--- /dev/null
+++ b/alarm/node_modules/@arr/every/readme.md
@@ -0,0 +1,45 @@
+# @arr/every
+
+> A tiny, faster alternative to native `Array.prototype.every`
+
+:warning: Unlike native, `@arr/every` does _not_ support the optional `thisArg` parameter!
+
+## Install
+
+```
+$ npm install --save @arr/every
+```
+
+## Usage
+
+```js
+import every from '@arr/every';
+
+const isBigEnough = val => val >= 10;
+
+every([12, 5, 8, 130, 44], isBigEnough);
+//=> false
+every([12, 54, 18, 130, 44], isBigEnough);
+//=> true
+```
+
+## API
+
+### every(arr, callback)
+
+#### arr
+Type: `Array`<br>
+The array to iterate upon.
+
+#### callback(value[, index, array])
+Type: `Function`<br>
+Function to test for each element, taking three arguments:
+
+* **value** (required) -- The current element being processed in the array.
+* **index** (optional) -- The index of the current element being processed in the array.
+* **array** (optional) -- The array `every` was called upon.
+
+
+## License
+
+MIT © [Luke Edwards](http://lukeed.com)