array-pull-all-with-glob 6.0.5 → 6.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-pull-all-with-glob
|
|
3
3
|
* @fileoverview Like _.pullAll but with globs (wildcards)
|
|
4
|
-
* @version 6.0.
|
|
4
|
+
* @version 6.0.6
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-pull-all-with-glob/}
|
|
@@ -9,27 +9,27 @@
|
|
|
9
9
|
|
|
10
10
|
import { isMatch } from 'matcher';
|
|
11
11
|
|
|
12
|
-
var version$1 = "6.0.
|
|
12
|
+
var version$1 = "6.0.6";
|
|
13
13
|
|
|
14
14
|
const version = version$1;
|
|
15
15
|
function pull(originalInput, originalToBeRemoved, originalOpts) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
if (!originalInput.length) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
if (!originalInput.length || !originalToBeRemoved.length) {
|
|
20
|
+
return Array.from(originalInput);
|
|
21
|
+
}
|
|
22
|
+
const toBeRemoved = typeof originalToBeRemoved === "string"
|
|
23
|
+
? [originalToBeRemoved]
|
|
24
|
+
: Array.from(originalToBeRemoved);
|
|
25
|
+
const defaults = {
|
|
26
|
+
caseSensitive: true,
|
|
27
|
+
};
|
|
28
|
+
const opts = { ...defaults, ...originalOpts };
|
|
29
|
+
const res = Array.from(originalInput).filter((originalVal) => !toBeRemoved.some((remVal) => isMatch(originalVal, remVal, {
|
|
30
|
+
caseSensitive: opts.caseSensitive,
|
|
31
|
+
})));
|
|
32
|
+
return res;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export { pull, version };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-pull-all-with-glob
|
|
3
3
|
* @fileoverview Like _.pullAll but with globs (wildcards)
|
|
4
|
-
* @version 6.0.
|
|
4
|
+
* @version 6.0.6
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-pull-all-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayPullAllWithGlob={})}(this,(function(e){"use strict";const t=new Map,r=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter((e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0}))},n=(e,r)=>{r={caseSensitive:!1,...r};const n=e+JSON.stringify(r);if(t.has(n))return t.get(n);const o="!"===e[0];o&&(e=e.slice(1)),e=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e).replace(/\\\*/g,"[\\s\\S]*");const i=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return i.negated=o,t.set(n,i),i};function o(e,t,o){return((e,t,o,i)=>{if(e=r(e,"inputs"),0===(t=r(t,"patterns")).length)return[];t=t.map((e=>n(e,o)));const{allPatterns:s}=o||{},f=[];for(const r of e){let e;const n=[...t].fill(!1);for(const[o,i]of t.entries())if(i.test(r)&&(n[o]=!0,e=!i.negated,!e))break;if(!(!1===e||void 0===e&&t.some((e=>!e.negated))||s&&n.some(((e,r)=>!e&&!t[r].negated)))&&(f.push(r),i))break}return f})(e,t,o,!0).length>0}e.pull=function(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);const n="string"==typeof t?[t]:Array.from(t),i={caseSensitive:!0,...r};return Array.from(e).filter((e=>!n.some((t=>o(e,t,{caseSensitive:i.caseSensitive})))))},e.version="6.0.
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayPullAllWithGlob={})}(this,(function(e){"use strict";const t=new Map,r=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter((e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0}))},n=(e,r)=>{r={caseSensitive:!1,...r};const n=e+JSON.stringify(r);if(t.has(n))return t.get(n);const o="!"===e[0];o&&(e=e.slice(1)),e=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e).replace(/\\\*/g,"[\\s\\S]*");const i=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return i.negated=o,t.set(n,i),i};function o(e,t,o){return((e,t,o,i)=>{if(e=r(e,"inputs"),0===(t=r(t,"patterns")).length)return[];t=t.map((e=>n(e,o)));const{allPatterns:s}=o||{},f=[];for(const r of e){let e;const n=[...t].fill(!1);for(const[o,i]of t.entries())if(i.test(r)&&(n[o]=!0,e=!i.negated,!e))break;if(!(!1===e||void 0===e&&t.some((e=>!e.negated))||s&&n.some(((e,r)=>!e&&!t[r].negated)))&&(f.push(r),i))break}return f})(e,t,o,!0).length>0}e.pull=function(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);const n="string"==typeof t?[t]:Array.from(t),i={caseSensitive:!0,...r};return Array.from(e).filter((e=>!n.some((t=>o(e,t,{caseSensitive:i.caseSensitive})))))},e.version="6.0.6",Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "array-pull-all-with-glob",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
4
4
|
"description": "Like _.pullAll but with globs (wildcards)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -39,13 +39,12 @@
|
|
|
39
39
|
"types": "types/index.d.ts",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rollup -c",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"build:esbuild": "node '../../scripts/esbuild.js'",
|
|
43
|
+
"build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
44
|
+
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent",
|
|
44
45
|
"clean_types": "../../scripts/cleanTypes.js",
|
|
45
46
|
"dev": "rollup -c --dev",
|
|
46
47
|
"devunittest": "npm run dev && tap --only -R 'base'",
|
|
47
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
48
|
-
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
49
48
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
50
49
|
"lect": "lect",
|
|
51
50
|
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
|
|
@@ -54,17 +53,14 @@
|
|
|
54
53
|
"republish": "npm publish || :",
|
|
55
54
|
"tap": "tap",
|
|
56
55
|
"pretest": "npm run build",
|
|
57
|
-
"test": "npm run
|
|
56
|
+
"test": "npm run test:ci && npm run perf",
|
|
57
|
+
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
58
58
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
59
59
|
"tsc": "tsc",
|
|
60
|
-
"unittest": "tap --no-only --
|
|
60
|
+
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
61
61
|
},
|
|
62
62
|
"tap": {
|
|
63
63
|
"check-coverage": false,
|
|
64
|
-
"coverage-report": [
|
|
65
|
-
"json-summary",
|
|
66
|
-
"text"
|
|
67
|
-
],
|
|
68
64
|
"node-arg": [
|
|
69
65
|
"--no-warnings",
|
|
70
66
|
"--experimental-loader",
|
|
@@ -84,7 +80,7 @@
|
|
|
84
80
|
}
|
|
85
81
|
},
|
|
86
82
|
"dependencies": {
|
|
87
|
-
"@babel/runtime": "^7.16.
|
|
83
|
+
"@babel/runtime": "^7.16.3",
|
|
88
84
|
"matcher": "^5.0.0"
|
|
89
85
|
},
|
|
90
86
|
"devDependencies": {
|
|
@@ -96,8 +92,8 @@
|
|
|
96
92
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
97
93
|
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
98
94
|
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
99
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
100
|
-
"@babel/preset-env": "^7.16.
|
|
95
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
96
|
+
"@babel/preset-env": "^7.16.4",
|
|
101
97
|
"@babel/preset-typescript": "^7.16.0",
|
|
102
98
|
"@babel/register": "^7.16.0",
|
|
103
99
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
@@ -107,25 +103,25 @@
|
|
|
107
103
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
108
104
|
"@rollup/plugin-strip": "^2.1.0",
|
|
109
105
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
110
|
-
"@types/node": "^16.11.
|
|
106
|
+
"@types/node": "^16.11.9",
|
|
111
107
|
"@types/tap": "^15.0.5",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
113
|
-
"@typescript-eslint/parser": "^5.
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
109
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
114
110
|
"core-js": "^3.19.1",
|
|
115
111
|
"cross-env": "^7.0.3",
|
|
116
|
-
"eslint": "^8.
|
|
117
|
-
"lect": "^0.18.
|
|
118
|
-
"rollup": "^2.
|
|
112
|
+
"eslint": "^8.3.0",
|
|
113
|
+
"lect": "^0.18.6",
|
|
114
|
+
"rollup": "^2.60.0",
|
|
119
115
|
"rollup-plugin-ascii": "^0.0.3",
|
|
120
116
|
"rollup-plugin-banner": "^0.2.1",
|
|
121
117
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
122
118
|
"rollup-plugin-dts": "^4.0.1",
|
|
123
119
|
"rollup-plugin-terser": "^7.0.2",
|
|
124
|
-
"tap": "^15.
|
|
120
|
+
"tap": "^15.1.2",
|
|
125
121
|
"tslib": "^2.3.1",
|
|
126
|
-
"typescript": "^4.
|
|
122
|
+
"typescript": "^4.5.2"
|
|
127
123
|
},
|
|
128
124
|
"engines": {
|
|
129
|
-
"node": ">=
|
|
125
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
130
126
|
}
|
|
131
127
|
}
|