aboutsummaryrefslogtreecommitdiff
path: root/node_modules/array-unique/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/array-unique/index.js')
-rw-r--r--[-rwxr-xr-x]node_modules/array-unique/index.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/array-unique/index.js b/node_modules/array-unique/index.js
index 7fa75af90..7e481e072 100755..100644
--- 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);
+};