pax_global_header00006660000000000000000000000064127475167340014532gustar00rootroot0000000000000052 comment=5dd2bcce28a0bb1e02d163003a775d6982675012 array-unique-0.3.2/000077500000000000000000000000001274751673400141565ustar00rootroot00000000000000array-unique-0.3.2/.editorconfig000066400000000000000000000004051274751673400166320ustar00rootroot00000000000000root = true [*] indent_style = space end_of_line = lf charset = utf-8 indent_size = 2 trim_trailing_whitespace = true insert_final_newline = true [{**/{actual,fixtures,expected,templates}/**,*.md}] trim_trailing_whitespace = false insert_final_newline = falsearray-unique-0.3.2/.eslintrc.json000066400000000000000000000071251274751673400167570ustar00rootroot00000000000000{ "ecmaFeatures": { "modules": true, "experimentalObjectRestSpread": true }, "env": { "browser": false, "es6": true, "node": true, "mocha": true }, "globals": { "document": false, "navigator": false, "window": false }, "rules": { "accessor-pairs": 2, "arrow-spacing": [2, { "before": true, "after": true }], "block-spacing": [2, "always"], "brace-style": [2, "1tbs", { "allowSingleLine": true }], "comma-dangle": [2, "never"], "comma-spacing": [2, { "before": false, "after": true }], "comma-style": [2, "last"], "constructor-super": 2, "curly": [2, "multi-line"], "dot-location": [2, "property"], "eol-last": 2, "eqeqeq": [2, "allow-null"], "generator-star-spacing": [2, { "before": true, "after": true }], "handle-callback-err": [2, "^(err|error)$" ], "indent": [2, 2, { "SwitchCase": 1 }], "key-spacing": [2, { "beforeColon": false, "afterColon": true }], "keyword-spacing": [2, { "before": true, "after": true }], "new-cap": [2, { "newIsCap": true, "capIsNew": false }], "new-parens": 2, "no-array-constructor": 2, "no-caller": 2, "no-class-assign": 2, "no-cond-assign": 2, "no-const-assign": 2, "no-control-regex": 2, "no-debugger": 2, "no-delete-var": 2, "no-dupe-args": 2, "no-dupe-class-members": 2, "no-dupe-keys": 2, "no-duplicate-case": 2, "no-empty-character-class": 2, "no-eval": 2, "no-ex-assign": 2, "no-extend-native": 2, "no-extra-bind": 2, "no-extra-boolean-cast": 2, "no-extra-parens": [2, "functions"], "no-fallthrough": 2, "no-floating-decimal": 2, "no-func-assign": 2, "no-implied-eval": 2, "no-inner-declarations": [2, "functions"], "no-invalid-regexp": 2, "no-irregular-whitespace": 2, "no-iterator": 2, "no-label-var": 2, "no-labels": 2, "no-lone-blocks": 2, "no-mixed-spaces-and-tabs": 2, "no-multi-spaces": 2, "no-multi-str": 2, "no-multiple-empty-lines": [2, { "max": 1 }], "no-native-reassign": 0, "no-negated-in-lhs": 2, "no-new": 2, "no-new-func": 2, "no-new-object": 2, "no-new-require": 2, "no-new-wrappers": 2, "no-obj-calls": 2, "no-octal": 2, "no-octal-escape": 2, "no-proto": 0, "no-redeclare": 2, "no-regex-spaces": 2, "no-return-assign": 2, "no-self-compare": 2, "no-sequences": 2, "no-shadow-restricted-names": 2, "no-spaced-func": 2, "no-sparse-arrays": 2, "no-this-before-super": 2, "no-throw-literal": 2, "no-trailing-spaces": 0, "no-undef": 2, "no-undef-init": 2, "no-unexpected-multiline": 2, "no-unneeded-ternary": [2, { "defaultAssignment": false }], "no-unreachable": 2, "no-unused-vars": [2, { "vars": "all", "args": "none" }], "no-useless-call": 0, "no-with": 2, "one-var": [0, { "initialized": "never" }], "operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }], "padded-blocks": [0, "never"], "quotes": [2, "single", "avoid-escape"], "radix": 2, "semi": [2, "always"], "semi-spacing": [2, { "before": false, "after": true }], "space-before-blocks": [2, "always"], "space-before-function-paren": [2, "never"], "space-in-parens": [2, "never"], "space-infix-ops": 2, "space-unary-ops": [2, { "words": true, "nonwords": false }], "spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }], "use-isnan": 2, "valid-typeof": 2, "wrap-iife": [2, "any"], "yoda": [2, "never"] } } array-unique-0.3.2/.gitattributes000066400000000000000000000001771274751673400170560ustar00rootroot00000000000000# Enforce Unix newlines * text eol=lf # binaries *.ai binary *.psd binary *.jpg binary *.gif binary *.png binary *.jpeg binaryarray-unique-0.3.2/.gitignore000066400000000000000000000001601274751673400161430ustar00rootroot00000000000000*.DS_Store *.sublime-* _gh_pages bower_components node_modules npm-debug.log temp test/actual tmp TODO.md vendorarray-unique-0.3.2/.travis.yml000066400000000000000000000001611274751673400162650ustar00rootroot00000000000000sudo: false language: node_js node_js: - '6' - '5' - '4' - '0.12' - '0.10' matrix: fast_finish: true array-unique-0.3.2/.verb.md000066400000000000000000000007011274751673400155120ustar00rootroot00000000000000## Usage ```js var unique = require('{%= name %}'); var arr = ['a', 'b', 'c', 'c']; console.log(unique(arr)) //=> ['a', 'b', 'c'] console.log(arr) //=> ['a', 'b', 'c'] /* The above modifies the input array. To prevent that at a slight performance cost: */ var unique = require("array-unique").immutable; var arr = ['a', 'b', 'c', 'c']; console.log(unique(arr)) //=> ['a', 'b', 'c'] console.log(arr) //=> ['a', 'b', 'c', 'c'] ``` array-unique-0.3.2/LICENSE000066400000000000000000000020771274751673400151710ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014-2016, Jon Schlinkert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. array-unique-0.3.2/README.md000066400000000000000000000076651274751673400154530ustar00rootroot00000000000000# array-unique [![NPM version](https://img.shields.io/npm/v/array-unique.svg?style=flat)](https://www.npmjs.com/package/array-unique) [![NPM downloads](https://img.shields.io/npm/dm/array-unique.svg?style=flat)](https://npmjs.org/package/array-unique) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-unique.svg?style=flat)](https://travis-ci.org/jonschlinkert/array-unique) Remove duplicate values from an array. Fastest ES5 implementation. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save array-unique ``` ## Usage ```js var unique = require('array-unique'); var arr = ['a', 'b', 'c', 'c']; console.log(unique(arr)) //=> ['a', 'b', 'c'] console.log(arr) //=> ['a', 'b', 'c'] /* The above modifies the input array. To prevent that at a slight performance cost: */ var unique = require("array-unique").immutable; var arr = ['a', 'b', 'c', 'c']; console.log(unique(arr)) //=> ['a', 'b', 'c'] console.log(arr) //=> ['a', 'b', 'c', 'c'] ``` ## About ### Related projects * [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.") * [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") * [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.") * [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.") * [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.") * [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Building docs _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ To generate the readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install -g verb verb-generate-readme && verb ``` ### Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ### Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ### License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._array-unique-0.3.2/benchmark/000077500000000000000000000000001274751673400161105ustar00rootroot00000000000000array-unique-0.3.2/benchmark/code/000077500000000000000000000000001274751673400170225ustar00rootroot00000000000000array-unique-0.3.2/benchmark/code/filter.js000066400000000000000000000003241274751673400206440ustar00rootroot00000000000000'use strict'; module.exports = function (arr) { var stack = []; return arr.filter(function (ele) { if (stack.indexOf(ele) > -1) { return false; } stack.push(ele); return true; }); }; array-unique-0.3.2/benchmark/code/for-in.js000066400000000000000000000003501274751673400205500ustar00rootroot00000000000000'use strict'; module.exports = function(arr) { var len = arr.length; var res = []; var o = {}; var i; for (i = 0; i < len; i += 1) { o[arr[i]] = arr[i]; } for (i in o) { res.push(o[i]); } return res; }; array-unique-0.3.2/benchmark/code/linear-search-01.js000066400000000000000000000004571274751673400223210ustar00rootroot00000000000000'use strict'; module.exports = function(arr) { var set = []; for (var i = 0, len = arr.length; i < len; i++) { var value = arr[i]; for (var j = len; --j > i;) { if (value === arr[j]) { break; } } if (j == i) { set.push(value); } } return set; }; array-unique-0.3.2/benchmark/code/set-immutable.js000066400000000000000000000001011274751673400221200ustar00rootroot00000000000000'use strict'; module.exports = require('array-uniq').immutable; array-unique-0.3.2/benchmark/code/set.js000066400000000000000000000000671274751673400201560ustar00rootroot00000000000000'use strict'; module.exports = require('array-uniq'); array-unique-0.3.2/benchmark/code/while-hash.js000066400000000000000000000003611274751673400214110ustar00rootroot00000000000000'use strict'; module.exports = function(arr) { var i = arr.length; var hash = Object.create(null); var res = []; while (i--) { if (!hash[arr[i]]) { hash[arr[i]] = true; res.push(arr[i]); } } return res; }; array-unique-0.3.2/benchmark/code/while.js000066400000000000000000000003311274751673400204650ustar00rootroot00000000000000'use strict'; module.exports = function(arr) { var len = arr.length; var res = []; while (len--) { var curr = arr[len]; if (res.indexOf(curr) === -1) { res.push(curr); } } return res; }; array-unique-0.3.2/benchmark/fixtures/000077500000000000000000000000001274751673400177615ustar00rootroot00000000000000array-unique-0.3.2/benchmark/fixtures/long.js000066400000000000000000000001141274751673400212520ustar00rootroot00000000000000var randomize = require('../randomize'); module.exports = randomize(10000); array-unique-0.3.2/benchmark/fixtures/med.js000066400000000000000000000001121274751673400210560ustar00rootroot00000000000000var randomize = require('../randomize'); module.exports = randomize(500); array-unique-0.3.2/benchmark/fixtures/short.js000066400000000000000000000001111274751673400214470ustar00rootroot00000000000000var randomize = require('../randomize'); module.exports = randomize(10); array-unique-0.3.2/benchmark/index.js000066400000000000000000000002301274751673400175500ustar00rootroot00000000000000'use'; var Suite = require('benchmarked'); var suite = new Suite({ add: 'code/*.js', fixtures: 'fixtures/*.js', cwd: __dirname }); suite.run(); array-unique-0.3.2/benchmark/randomize.js000066400000000000000000000010551274751673400204370ustar00rootroot00000000000000/** * Source: http://jsperf.com/array-unique2/15 */ module.exports = function randomize(n) { var values = []; var rand; while (n--) { rand = Math.random() * n * 2 | 0; if (rand < values.length) { values.push(values[rand]); } else { switch (Math.random() * 3 | 0) { case 0: values.push(Math.random() * 1e10 | 0); break; case 1: values.push((Math.random() * 1e32).toString(36)); break; case 2: values.push({}); break; } } } return values; }; array-unique-0.3.2/index.js000066400000000000000000000014751274751673400156320ustar00rootroot00000000000000/*! * array-unique * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; module.exports = function unique(arr) { if (!Array.isArray(arr)) { throw new TypeError('array-unique expects an array.'); } var len = arr.length; var i = -1; while (i++ < len) { var j = i + 1; for (; j < arr.length; ++j) { if (arr[i] === arr[j]) { arr.splice(j--, 1); } } } 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); }; array-unique-0.3.2/package.json000066400000000000000000000023101274751673400164400ustar00rootroot00000000000000{ "name": "array-unique", "description": "Remove duplicate values from an array. Fastest ES5 implementation.", "version": "0.3.2", "homepage": "https://github.com/jonschlinkert/array-unique", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", "repository": "jonschlinkert/array-unique", "bugs": { "url": "https://github.com/jonschlinkert/array-unique/issues" }, "license": "MIT", "files": [ "index.js", "LICENSE", "README.md" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "devDependencies": { "array-uniq": "^1.0.2", "benchmarked": "^0.1.3", "gulp-format-md": "^0.1.9", "mocha": "^2.5.3", "should": "^10.0.0" }, "keywords": [ "array", "unique" ], "verb": { "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "related": { "list": [ "arr-diff", "arr-union", "arr-flatten", "arr-reduce", "arr-map", "arr-pluck" ] }, "reflinks": [ "verb", "verb-generate-readme" ], "lint": { "reflinks": true } } } array-unique-0.3.2/test.js000066400000000000000000000216341274751673400155010ustar00rootroot00000000000000/*! * array-unique * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; require('mocha'); var assert = require('assert'); var should = require('should'); var unique = require('./'); describe('unique', function() { it('should throw an error if the value passed is not an array:', function() { (function() { unique('a', 'b', 'c'); }).should.throw('array-unique expects an array.'); }); it('should return an array with unique values:', function() { unique(['a', 'b', 'c', 'a', 'b', 'd']).should.eql(['a', 'b', 'c', 'd']); unique(['a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'b', 'f', 'a', 'b']).should.eql(['a', 'b', 'c', 'f']); unique(['a', 'b', 'c', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b']).should.eql(['a', 'b', 'c', 'f', 'x', 'y', 'z']); unique(['foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/z.js', 'foo/bar/baz/quux/fez/test/fixtures/c.js', 'foo/bar/baz/quux/fez/test/fixtures/d.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/h.js', 'foo/bar/baz/quux/fez/test/fixtures/i.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/k.js', 'foo/bar/baz/quux/fez/test/fixtures/l.js', 'foo/bar/baz/quux/fez/test/fixtures/m.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js']).should.eql([ 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/z.js', 'foo/bar/baz/quux/fez/test/fixtures/c.js', 'foo/bar/baz/quux/fez/test/fixtures/d.js', 'foo/bar/baz/quux/fez/test/fixtures/h.js', 'foo/bar/baz/quux/fez/test/fixtures/i.js', 'foo/bar/baz/quux/fez/test/fixtures/k.js', 'foo/bar/baz/quux/fez/test/fixtures/l.js', 'foo/bar/baz/quux/fez/test/fixtures/m.js' ]); }); }); describe('unique.immutable', function() { it('should throw an error if the value passed is not an array:', function() { (function() { unique.immutable('a', 'b', 'c'); }).should.throw('array-unique expects an array.'); }); it('should return an array with unique values without modifying the input:', function() { (function() { var original = ['a', 'b', 'c', 'a', 'b', 'd']; var before = ['a', 'b', 'c', 'a', 'b', 'd']; var expected = ['a', 'b', 'c', 'd']; unique.immutable(before).should.eql(expected); before.should.eql(original); })(); (function() { var original = ['a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'b', 'f', 'a', 'b']; var before = ['a', 'b', 'c', 'a', 'b', 'a', 'b', 'c', 'b', 'f', 'a', 'b']; var expected = ['a', 'b', 'c', 'f']; unique.immutable(before).should.eql(expected); before.should.eql(original); })(); (function() { var original = ['a', 'b', 'c', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b'] var before = ['a', 'b', 'c', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b', 'a', 'b', 'a', 'b', 'b', 'f', 'a', 'b', 'x', 'y', 'z', 'a', 'b'] var expected = ['a', 'b', 'c', 'f', 'x', 'y', 'z']; unique.immutable(before).should.eql(expected); before.should.eql(original); })(); (function() { var original = [ 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/z.js', 'foo/bar/baz/quux/fez/test/fixtures/c.js', 'foo/bar/baz/quux/fez/test/fixtures/d.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/h.js', 'foo/bar/baz/quux/fez/test/fixtures/i.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/k.js', 'foo/bar/baz/quux/fez/test/fixtures/l.js', 'foo/bar/baz/quux/fez/test/fixtures/m.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js' ]; var before = [ 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/z.js', 'foo/bar/baz/quux/fez/test/fixtures/c.js', 'foo/bar/baz/quux/fez/test/fixtures/d.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/h.js', 'foo/bar/baz/quux/fez/test/fixtures/i.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/k.js', 'foo/bar/baz/quux/fez/test/fixtures/l.js', 'foo/bar/baz/quux/fez/test/fixtures/m.js', 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js' ]; var expected = [ 'foo/bar/baz/quux/fez/test/fixtures', 'foo/bar/baz/quux/fez/test/fixtures/a.js', 'foo/bar/baz/quux/fez/test/fixtures/b.js', 'foo/bar/baz/quux/fez/test/fixtures/j.js', 'foo/bar/baz/quux/fez/test/fixtures/z.js', 'foo/bar/baz/quux/fez/test/fixtures/c.js', 'foo/bar/baz/quux/fez/test/fixtures/d.js', 'foo/bar/baz/quux/fez/test/fixtures/h.js', 'foo/bar/baz/quux/fez/test/fixtures/i.js', 'foo/bar/baz/quux/fez/test/fixtures/k.js', 'foo/bar/baz/quux/fez/test/fixtures/l.js', 'foo/bar/baz/quux/fez/test/fixtures/m.js' ]; unique.immutable(before).should.eql(expected); before.should.eql(original); })(); }); });