[Pkg-javascript-commits] [node-array-unique] 01/02: Imported Upstream version 0.2.1

Thorsten Alteholz alteholz at moszumanska.debian.org
Sat Feb 27 13:58:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository node-array-unique.

commit 9572b71d157917b4bd105dafc8907fe4b6dda72c
Author: Thorsten Alteholz <debian at alteholz.de>
Date:   Sat Feb 27 14:58:31 2016 +0100

    Imported Upstream version 0.2.1
---
 LICENSE      | 21 +++++++++++++++++++++
 README.md    | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 index.js     | 28 ++++++++++++++++++++++++++++
 package.json | 37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 137 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100755
index 0000000..fa30c4c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, 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.
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..2e28774
--- /dev/null
+++ b/README.md
@@ -0,0 +1,51 @@
+# array-unique [![NPM version](https://badge.fury.io/js/array-unique.svg)](http://badge.fury.io/js/array-unique)  [![Build Status](https://travis-ci.org/jonschlinkert/array-unique.svg)](https://travis-ci.org/jonschlinkert/array-unique) 
+
+> Return an array free of duplicate values. Fastest ES5 implementation.
+
+## Install with [npm](npmjs.org)
+
+```bash
+npm i array-unique --save
+```
+
+## Usage
+
+```js
+var unique = require('array-unique');
+
+unique(['a', 'b', 'c', 'c']);
+//=> ['a', 'b', '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.
+
+## Run tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Contributing
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues)
+
+## 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
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100755
index 0000000..7fa75af
--- /dev/null
+++ b/index.js
@@ -0,0 +1,28 @@
+/*!
+ * array-unique <https://github.com/jonschlinkert/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;
+};
diff --git a/package.json b/package.json
new file mode 100755
index 0000000..a493f69
--- /dev/null
+++ b/package.json
@@ -0,0 +1,37 @@
+{
+  "name": "array-unique",
+  "description": "Return an array free of duplicate values. Fastest ES5 implementation.",
+  "version": "0.2.1",
+  "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"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/array-unique/issues"
+  },
+  "license": {
+    "type": "MIT",
+    "url": "https://github.com/jonschlinkert/array-unique/blob/master/LICENSE"
+  },
+  "files": [
+    "index.js"
+  ],
+  "main": "index.js",
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "devDependencies": {
+    "array-uniq": "^1.0.2",
+    "benchmarked": "^0.1.3",
+    "mocha": "*",
+    "should": "*"
+  }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-array-unique.git



More information about the Pkg-javascript-commits mailing list