pax_global_header00006660000000000000000000000064134572713560014527gustar00rootroot0000000000000052 comment=b53b00cb2db48fa614511178a3c0d388d7bc47bb array-union-2.1.0/000077500000000000000000000000001345727135600137735ustar00rootroot00000000000000array-union-2.1.0/.editorconfig000066400000000000000000000002571345727135600164540ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 array-union-2.1.0/.gitattributes000066400000000000000000000000231345727135600166610ustar00rootroot00000000000000* text=auto eol=lf array-union-2.1.0/.gitignore000066400000000000000000000000271345727135600157620ustar00rootroot00000000000000node_modules yarn.lock array-union-2.1.0/.npmrc000066400000000000000000000000231345727135600151060ustar00rootroot00000000000000package-lock=false array-union-2.1.0/.travis.yml000066400000000000000000000000541345727135600161030ustar00rootroot00000000000000language: node_js node_js: - '10' - '8' array-union-2.1.0/index.d.ts000066400000000000000000000011411345727135600156710ustar00rootroot00000000000000/** Create an array of unique values, in order, from the input arrays. @example ``` import arrayUnion = require('array-union'); arrayUnion([1, 1, 2, 3], [2, 3]); //=> [1, 2, 3] arrayUnion(['foo', 'foo', 'bar']); //=> ['foo', 'bar'] arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); //=> ['🐱', '🦄', '🐻', '🌈'] arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); //=> ['🐱', '🦄', '🐻', '🐶', '🌈'] ``` */ declare function arrayUnion( ...arguments: readonly ArgumentsType[] ): ArgumentsType; export = arrayUnion; array-union-2.1.0/index.js000066400000000000000000000001501345727135600154340ustar00rootroot00000000000000'use strict'; module.exports = (...arguments_) => { return [...new Set([].concat(...arguments_))]; }; array-union-2.1.0/index.test-d.ts000066400000000000000000000010201345727135600166420ustar00rootroot00000000000000import {expectType} from 'tsd'; import arrayUnion = require('.'); expectType(arrayUnion([1, 1, 2, 3] as ReadonlyArray, [2, 3] as ReadonlyArray)); expectType(arrayUnion([1, 1, 2, 3], [2, 3])); expectType(arrayUnion([1, 1, 2, 3], [2, 3])); expectType(arrayUnion(['foo', 'foo', 'bar'])); expectType(arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈'])); expectType( arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']) ); array-union-2.1.0/license000066400000000000000000000021251345727135600153400ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) 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-union-2.1.0/package.json000066400000000000000000000011721345727135600162620ustar00rootroot00000000000000{ "name": "array-union", "version": "2.1.0", "description": "Create an array of unique values, in order, from the input arrays", "license": "MIT", "repository": "sindresorhus/array-union", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "array", "set", "uniq", "unique", "duplicate", "remove", "union", "combine", "merge" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" } } array-union-2.1.0/readme.md000066400000000000000000000013111345727135600155460ustar00rootroot00000000000000# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) > Create an array of unique values, in order, from the input arrays ## Install ``` $ npm install array-union ``` ## Usage ```js const arrayUnion = require('array-union'); arrayUnion([1, 1, 2, 3], [2, 3]); //=> [1, 2, 3] arrayUnion(['foo', 'foo', 'bar']); //=> ['foo', 'bar'] arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); //=> ['🐱', '🦄', '🐻', '🌈'] arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); //=> ['🐱', '🦄', '🐻', '🐶', '🌈'] ``` ## License MIT © [Sindre Sorhus](https://sindresorhus.com) array-union-2.1.0/test.js000066400000000000000000000005311345727135600153070ustar00rootroot00000000000000import test from 'ava'; import arrayUnion from '.'; test('main', t => { t.deepEqual(arrayUnion([1, 2, 2, 3, 1, 2, 4], [1, 2, 3, 6, 7]), [1, 2, 3, 4, 6, 7]); t.deepEqual(arrayUnion([1, 2, 2, 3, 1, 2, 4], ['c', 'a', 'd']), [1, 2, 3, 4, 'c', 'a', 'd']); t.deepEqual(arrayUnion(['a', 'a', 'b', 'a'], ['c', 'a', 'd']), ['a', 'b', 'c', 'd']); });