From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/array-unique/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100755 => 100644 node_modules/array-unique/index.js (limited to 'node_modules/array-unique/index.js') diff --git a/node_modules/array-unique/index.js b/node_modules/array-unique/index.js old mode 100755 new mode 100644 index 7fa75af90..7e481e072 --- a/node_modules/array-unique/index.js +++ b/node_modules/array-unique/index.js @@ -26,3 +26,18 @@ module.exports = function unique(arr) { } return arr; }; + +module.exports.immutable = function uniqueImmutable(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var arrLen = arr.length; + var newArr = new Array(arrLen); + + for (var i = 0; i < arrLen; i++) { + newArr[i] = arr[i]; + } + + return module.exports(newArr); +}; -- cgit v1.2.3