.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / array-unique / index.js
1 /*!
2  * array-unique <https://github.com/jonschlinkert/array-unique>
3  *
4  * Copyright (c) 2014-2015, Jon Schlinkert.
5  * Licensed under the MIT License.
6  */
7
8 'use strict';
9
10 module.exports = function unique(arr) {
11   if (!Array.isArray(arr)) {
12     throw new TypeError('array-unique expects an array.');
13   }
14
15   var len = arr.length;
16   var i = -1;
17
18   while (i++ < len) {
19     var j = i + 1;
20
21     for (; j < arr.length; ++j) {
22       if (arr[i] === arr[j]) {
23         arr.splice(j--, 1);
24       }
25     }
26   }
27   return arr;
28 };