diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/array-unique | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/array-unique')
-rwxr-xr-x | node_modules/array-unique/LICENSE | 2 | ||||
-rwxr-xr-x | node_modules/array-unique/README.md | 82 | ||||
-rw-r--r--[-rwxr-xr-x] | node_modules/array-unique/index.js | 15 | ||||
-rw-r--r--[-rwxr-xr-x] | node_modules/array-unique/package.json | 59 |
4 files changed, 112 insertions, 46 deletions
diff --git a/node_modules/array-unique/LICENSE b/node_modules/array-unique/LICENSE index fa30c4cb3..842218cf0 100755 --- a/node_modules/array-unique/LICENSE +++ b/node_modules/array-unique/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2015, Jon Schlinkert. +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 diff --git a/node_modules/array-unique/README.md b/node_modules/array-unique/README.md index 2e287743a..41c8c904e 100755 --- a/node_modules/array-unique/README.md +++ b/node_modules/array-unique/README.md @@ -1,11 +1,13 @@ -# array-unique [](http://badge.fury.io/js/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique) +# array-unique [](https://www.npmjs.com/package/array-unique) [](https://npmjs.org/package/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique) -> Return an array free of duplicate values. Fastest ES5 implementation. +Remove duplicate values from an array. Fastest ES5 implementation. -## Install with [npm](npmjs.org) +## Install -```bash -npm i array-unique --save +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save array-unique ``` ## Usage @@ -13,39 +15,63 @@ npm i array-unique --save ```js var unique = require('array-unique'); -unique(['a', 'b', 'c', 'c']); -//=> ['a', 'b', 'c'] +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'] ``` -## Related -* [arr-diff](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-union](https://github.com/jonschlinkert/arr-union): Returns an array of unique values using strict equality for comparisons. -* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. -* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements. -* [arr-map](https://github.com/jonschlinkert/arr-map): Faster, node.js focused alternative to JavaScript's native array map. -* [arr-pluck](https://github.com/jonschlinkert/arr-pluck): Retrieves the value of a specified property from all elements in the collection. +## 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). -## Run tests -Install dev dependencies. +### Building docs -```bash -npm i -d && npm test +_(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 ``` -## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues) +### Running tests -## Author +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 (c) 2015 Jon Schlinkert -Released under the MIT license +* [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-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._
\ No newline at end of file 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); +}; diff --git a/node_modules/array-unique/package.json b/node_modules/array-unique/package.json index a493f69bf..d87640abe 100755..100644 --- a/node_modules/array-unique/package.json +++ b/node_modules/array-unique/package.json @@ -1,25 +1,18 @@ { "name": "array-unique", - "description": "Return an array free of duplicate values. Fastest ES5 implementation.", - "version": "0.2.1", + "description": "Remove duplicate values from an array. Fastest ES5 implementation.", + "version": "0.3.2", "homepage": "https://github.com/jonschlinkert/array-unique", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/array-unique.git" - }, + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/array-unique", "bugs": { "url": "https://github.com/jonschlinkert/array-unique/issues" }, - "license": { - "type": "MIT", - "url": "https://github.com/jonschlinkert/array-unique/blob/master/LICENSE" - }, + "license": "MIT", "files": [ - "index.js" + "index.js", + "LICENSE", + "README.md" ], "main": "index.js", "engines": { @@ -31,7 +24,39 @@ "devDependencies": { "array-uniq": "^1.0.2", "benchmarked": "^0.1.3", - "mocha": "*", - "should": "*" + "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 + } } } |