diff options
| author | Kumar Priyansh <[email protected]> | 2020-01-03 18:34:23 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2020-01-03 18:34:23 +0530 |
| commit | c3373becc9a1393b2e03c8cd6c154601481a60dd (patch) | |
| tree | a8a31f613aef864d8d481ed57dc2c97490dfd328 /cordova/node_modules/pegjs/lib/utils/arrays.js | |
| parent | 2917c8eda330a126b530dd83573670cbc98a4206 (diff) | |
| download | WeatherApp-c3373becc9a1393b2e03c8cd6c154601481a60dd.tar.xz WeatherApp-c3373becc9a1393b2e03c8cd6c154601481a60dd.zip | |
Rewriting the app from scratch with Swift 5
Diffstat (limited to 'cordova/node_modules/pegjs/lib/utils/arrays.js')
| -rw-r--r-- | cordova/node_modules/pegjs/lib/utils/arrays.js | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/cordova/node_modules/pegjs/lib/utils/arrays.js b/cordova/node_modules/pegjs/lib/utils/arrays.js deleted file mode 100644 index 93a833c..0000000 --- a/cordova/node_modules/pegjs/lib/utils/arrays.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; - -/* Array utilities. */ -var arrays = { - range: function(start, stop) { - var length = stop - start, - result = new Array(length), - i, j; - - for (i = 0, j = start; i < length; i++, j++) { - result[i] = j; - } - - return result; - }, - - find: function(array, valueOrPredicate) { - var length = array.length, i; - - if (typeof valueOrPredicate === "function") { - for (i = 0; i < length; i++) { - if (valueOrPredicate(array[i])) { - return array[i]; - } - } - } else { - for (i = 0; i < length; i++) { - if (array[i] === valueOrPredicate) { - return array[i]; - } - } - } - }, - - indexOf: function(array, valueOrPredicate) { - var length = array.length, i; - - if (typeof valueOrPredicate === "function") { - for (i = 0; i < length; i++) { - if (valueOrPredicate(array[i])) { - return i; - } - } - } else { - for (i = 0; i < length; i++) { - if (array[i] === valueOrPredicate) { - return i; - } - } - } - - return -1; - }, - - contains: function(array, valueOrPredicate) { - return arrays.indexOf(array, valueOrPredicate) !== -1; - }, - - each: function(array, iterator) { - var length = array.length, i; - - for (i = 0; i < length; i++) { - iterator(array[i], i); - } - }, - - map: function(array, iterator) { - var length = array.length, - result = new Array(length), - i; - - for (i = 0; i < length; i++) { - result[i] = iterator(array[i], i); - } - - return result; - }, - - pluck: function(array, key) { - return arrays.map(array, function (e) { return e[key]; }); - }, - - every: function(array, predicate) { - var length = array.length, i; - - for (i = 0; i < length; i++) { - if (!predicate(array[i])) { - return false; - } - } - - return true; - }, - - some: function(array, predicate) { - var length = array.length, i; - - for (i = 0; i < length; i++) { - if (predicate(array[i])) { - return true; - } - } - - return false; - } -}; - -module.exports = arrays; |
