exclude-match
Exclude items in an array matching a given pattern.
npm:
Install with$ npm install --save exclude-match
Usage
var exclude = ;;
Strings and Arrays
// match single strings...var array1 = ;// ['b', 'c'] // or array of stringsvar array2 = ;// ['c']
Globs
// match globs, and ignore case...var array3 = ;// ['a.txt', 'B.txt', 'C.txt'] // or array of globsvar array4 = ;// ['b.json', 'c.js']
Numbers
// works with numbers too...var array5 = ;// [1, 2, 3, 5] // and glob matches...var array6 = ;// [5] // and even an array of globsvar array7 = ;// [2, 3, 5, 6, 7, 8, 9, 10]
array
{Array}: Array to remove a matched item(s) from.pattern
{Number|String|Array}: Glob pattern(s) to match against.options.nocase
{Boolean}: Set this totrue
force case-insensitive filename checks. This is useful on case sensitive file systems.returns
{Array}: Returns the resolved array with removed matches if they exist, otherwise returns the original array.
Running tests
Install dev dependencies:
$ npm install -d && npm test
Contributing
Take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
For bugs or feature requests, please create an issue.
Release History
2016-10-09 - v1.0.7 - Patch fixes.
2016-10-09 - v1.0.6 - Patch fixes.
2016-10-06 - v1.0.5 - Modified CI build config.
2016-10-06 - v1.0.4 - Added LICENSE.
2016-10-05 - v1.0.1 - Added build status to README.
2016-10-05 - v1.0.0 - Updated README.md. Added CI file for passing builds.
2016-10-03 - v0.2.0 - Updated dependencies. Reinforced type-checks.
2016-10-01 - v0.1.0 - Initial release.
Author
License
Copyright © 2016, "Captain" Morgan Worrell.
Released under the MIT license.