pax_global_header00006660000000000000000000000064141045246150014514gustar00rootroot0000000000000052 comment=47df99b7a8dcd0e5260206eb7bf597cdf88e887b arr-exclude-2.0.0/000077500000000000000000000000001410452461500137265ustar00rootroot00000000000000arr-exclude-2.0.0/.editorconfig000066400000000000000000000002571410452461500164070ustar00rootroot00000000000000root = 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 arr-exclude-2.0.0/.gitattributes000066400000000000000000000000231410452461500166140ustar00rootroot00000000000000* text=auto eol=lf arr-exclude-2.0.0/.github/000077500000000000000000000000001410452461500152665ustar00rootroot00000000000000arr-exclude-2.0.0/.github/workflows/000077500000000000000000000000001410452461500173235ustar00rootroot00000000000000arr-exclude-2.0.0/.github/workflows/main.yml000066400000000000000000000006261410452461500207760ustar00rootroot00000000000000name: CI on: - push - pull_request jobs: test: name: Node.js ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: node-version: - 16 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test arr-exclude-2.0.0/.gitignore000066400000000000000000000000271410452461500157150ustar00rootroot00000000000000node_modules yarn.lock arr-exclude-2.0.0/.npmrc000066400000000000000000000000231410452461500150410ustar00rootroot00000000000000package-lock=false arr-exclude-2.0.0/index.js000066400000000000000000000003351410452461500153740ustar00rootroot00000000000000export default function arrayExclude(array, exclusions) { if (!Array.isArray(array)) { throw new TypeError(`Expected an array, got \`${typeof array}\``); } return array.filter(item => !exclusions.includes(item)); } arr-exclude-2.0.0/license000066400000000000000000000021351410452461500152740ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (https://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. arr-exclude-2.0.0/package.json000066400000000000000000000013011410452461500162070ustar00rootroot00000000000000{ "name": "arr-exclude", "version": "2.0.0", "description": "Exclude certain items from an array", "license": "MIT", "repository": "sindresorhus/arr-exclude", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "type": "module", "exports": "./index.js", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "array", "list", "exclude", "ignore", "without", "items", "elements", "values", "filter" ], "devDependencies": { "ava": "^3.15.0", "xo": "^0.44.0" } } arr-exclude-2.0.0/readme.md000066400000000000000000000005131410452461500155040ustar00rootroot00000000000000# arr-exclude > Exclude certain items from an array ## Install ``` $ npm install arr-exclude ``` ## Usage ```js import arrayExclude from 'arr-exclude'; arrayExclude(['a', 'b', 'c'], ['b']); //=> ['a', 'c'] ``` ## Related - [arr-include](https://github.com/sindresorhus/arr-include) - Include only certain items in an array arr-exclude-2.0.0/test.js000066400000000000000000000003611410452461500152430ustar00rootroot00000000000000import test from 'ava'; import arrayExclude from './index.js'; test('main', t => { t.deepEqual(arrayExclude(['a', 'b', 'c'], ['b']), ['a', 'c']); t.deepEqual(arrayExclude([], ['a']), []); t.deepEqual(arrayExclude(['a'], []), ['a']); });