From c344460855ffcaef5dda22025e45d7559de4a41a Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 14 Sep 2016 10:06:36 +0200 Subject: [PATCH] Remove now unused lib/utils/arrays.js See #442. --- lib/utils/arrays.js | 59 --------------------------------------------- package.json | 1 - 2 files changed, 60 deletions(-) delete mode 100644 lib/utils/arrays.js diff --git a/lib/utils/arrays.js b/lib/utils/arrays.js deleted file mode 100644 index 4059492..0000000 --- a/lib/utils/arrays.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -/* Array utilities. */ -let arrays = { - range: function(start, stop) { - let length = stop - start, - result = new Array(length); - - for (let i = 0, j = start; i < length; i++, j++) { - result[i] = j; - } - - return result; - }, - - find: function(array, valueOrPredicate) { - let length = array.length; - - if (typeof valueOrPredicate === "function") { - for (let i = 0; i < length; i++) { - if (valueOrPredicate(array[i])) { - return array[i]; - } - } - } else { - for (let i = 0; i < length; i++) { - if (array[i] === valueOrPredicate) { - return array[i]; - } - } - } - }, - - indexOf: function(array, valueOrPredicate) { - let length = array.length; - - if (typeof valueOrPredicate === "function") { - for (let i = 0; i < length; i++) { - if (valueOrPredicate(array[i])) { - return i; - } - } - } else { - for (let i = 0; i < length; i++) { - if (array[i] === valueOrPredicate) { - return i; - } - } - } - - return -1; - }, - - contains: function(array, valueOrPredicate) { - return arrays.indexOf(array, valueOrPredicate) !== -1; - } -}; - -module.exports = arrays; diff --git a/package.json b/package.json index 8372e69..484cd61 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "lib/grammar-error.js", "lib/parser.js", "lib/peg.js", - "lib/utils/arrays.js", "lib/utils/objects.js", "package.json" ],