array-pull-all-with-glob 6.0.7 → 6.0.10
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.
- package/README.md +5 -2
- package/dist/array-pull-all-with-glob.esm.js +2 -27
- package/dist/array-pull-all-with-glob.umd.js +2 -2
- package/examples/_quickTake.js +1 -0
- package/package.json +21 -74
- package/types/index.d.ts +0 -0
- package/examples/api.json +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# array-pull-all-with-glob
|
|
2
2
|
|
|
3
|
-
> Like
|
|
3
|
+
> Like _.pullAll but with globs (wildcards)
|
|
4
4
|
|
|
5
5
|
<div class="package-badges">
|
|
6
6
|
<a href="https://www.npmjs.com/package/array-pull-all-with-glob" rel="nofollow noreferrer noopener">
|
|
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 5.1.0
|
|
|
38
38
|
|
|
39
39
|
```js
|
|
40
40
|
import { strict as assert } from "assert";
|
|
41
|
+
|
|
41
42
|
import { pull } from "array-pull-all-with-glob";
|
|
42
43
|
|
|
43
44
|
assert.deepEqual(
|
|
@@ -51,7 +52,7 @@ assert.deepEqual(
|
|
|
51
52
|
|
|
52
53
|
## Documentation
|
|
53
54
|
|
|
54
|
-
Please [visit codsen.com](https://codsen.com/os/array-pull-all-with-glob/) for a full description of the API
|
|
55
|
+
Please [visit codsen.com](https://codsen.com/os/array-pull-all-with-glob/) for a full description of the API.
|
|
55
56
|
|
|
56
57
|
## Contributing
|
|
57
58
|
|
|
@@ -63,4 +64,6 @@ MIT License
|
|
|
63
64
|
|
|
64
65
|
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
65
66
|
|
|
67
|
+
|
|
66
68
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
69
|
+
|
|
@@ -1,35 +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.10
|
|
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
|
-
import {
|
|
11
|
-
|
|
12
|
-
var version$1 = "6.0.7";
|
|
13
|
-
|
|
14
|
-
const version = version$1;
|
|
15
|
-
function pull(originalInput, originalToBeRemoved, originalOpts) {
|
|
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
|
-
}
|
|
34
|
-
|
|
35
|
-
export { pull, version };
|
|
10
|
+
import{isMatch as p}from"matcher";var s="6.0.10";var h=s;function g(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),n={...{caseSensitive:!0},...r};return Array.from(e).filter(i=>!l.some(a=>p(i,a,{caseSensitive:n.caseSensitive})))}export{g as pull,h as 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.10
|
|
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
|
-
|
|
10
|
+
var arrayPullAllWithGlob=(()=>{var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var m=(e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&m(e,r,t[r]);if(g)for(var r of g(t))S.call(t,r)&&m(e,r,t[r]);return e};var E=e=>f(e,"__esModule",{value:!0});var $=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},j=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of k(t))!h.call(e,s)&&(r||s!=="default")&&f(e,s,{get:()=>t[s],enumerable:!(l=v(t,s))||l.enumerable});return e};var A=(e=>(t,r)=>e&&e.get(t)||(r=j(E({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var D={};$(D,{pull:()=>C,version:()=>z});function d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var y=new Map,b=(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(r=>{if(typeof r!="string"){if(typeof r=="undefined")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},M=(e,t)=>{t=i({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(y.has(r))return y.get(r);let l=e[0]==="!";l&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return s.negated=l,y.set(r,s),s},O=(e,t,r,l)=>{if(e=b(e,"inputs"),t=b(t,"patterns"),t.length===0)return[];t=t.map(a=>M(a,r));let{allPatterns:s}=r||{},c=[];for(let a of e){let n,u=[...t].fill(!1);for(let[o,p]of t.entries())if(p.test(a)&&(u[o]=!0,n=!p.negated,!n))break;if(!(n===!1||n===void 0&&t.some(o=>!o.negated)||s&&u.some((o,p)=>!o&&!t[p].negated))&&(c.push(a),l))break}return c};function x(e,t,r){return O(e,t,r,!0).length>0}var w="6.0.10";var z=w;function C(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),c=i(i({},{caseSensitive:!0}),r);return Array.from(e).filter(n=>!l.some(u=>x(n,u,{caseSensitive:c.caseSensitive})))}return A(D);})();
|
package/examples/_quickTake.js
CHANGED
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.10",
|
|
4
4
|
"description": "Like _.pullAll but with globs (wildcards)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -38,90 +38,37 @@
|
|
|
38
38
|
},
|
|
39
39
|
"types": "types/index.d.ts",
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"republish": "npm publish || :",
|
|
54
|
-
"tap": "tap",
|
|
55
|
-
"pretest": "npm run build",
|
|
56
|
-
"test": "npm run test:ci && npm run perf",
|
|
57
|
-
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
58
|
-
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
59
|
-
"tsc": "tsc",
|
|
60
|
-
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
41
|
+
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
42
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
43
|
+
"dts": "rollup -c",
|
|
44
|
+
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
45
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
46
|
+
"letspublish": "yarn publish || :",
|
|
47
|
+
"lint": "eslint . --fix",
|
|
48
|
+
"perf": "node perf/check.js",
|
|
49
|
+
"prepare": "echo 'ready'",
|
|
50
|
+
"pretest": "yarn run lect && yarn run build",
|
|
51
|
+
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
52
|
+
"unit": "uvu test"
|
|
61
53
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
56
|
+
},
|
|
57
|
+
"c8": {
|
|
58
|
+
"check-coverage": true,
|
|
59
|
+
"exclude": [
|
|
60
|
+
"**/test/**/*.*"
|
|
68
61
|
],
|
|
69
|
-
"
|
|
62
|
+
"lines": 100
|
|
70
63
|
},
|
|
71
64
|
"lect": {
|
|
72
65
|
"licence": {
|
|
73
66
|
"extras": [
|
|
74
67
|
""
|
|
75
68
|
]
|
|
76
|
-
},
|
|
77
|
-
"req": "{ pull }",
|
|
78
|
-
"various": {
|
|
79
|
-
"devDependencies": []
|
|
80
69
|
}
|
|
81
70
|
},
|
|
82
71
|
"dependencies": {
|
|
83
|
-
"@babel/runtime": "^7.16.3",
|
|
84
72
|
"matcher": "^5.0.0"
|
|
85
|
-
},
|
|
86
|
-
"devDependencies": {
|
|
87
|
-
"@babel/cli": "^7.16.0",
|
|
88
|
-
"@babel/core": "^7.16.0",
|
|
89
|
-
"@babel/node": "^7.16.0",
|
|
90
|
-
"@babel/plugin-external-helpers": "^7.16.0",
|
|
91
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
92
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
93
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
94
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
95
|
-
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
96
|
-
"@babel/preset-env": "^7.16.4",
|
|
97
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
98
|
-
"@babel/register": "^7.16.0",
|
|
99
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
100
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
101
|
-
"@rollup/plugin-commonjs": "^21.0.1",
|
|
102
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
103
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
104
|
-
"@rollup/plugin-strip": "^2.1.0",
|
|
105
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
106
|
-
"@types/node": "^16.11.10",
|
|
107
|
-
"@types/tap": "^15.0.5",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
109
|
-
"@typescript-eslint/parser": "^5.5.0",
|
|
110
|
-
"core-js": "^3.19.2",
|
|
111
|
-
"cross-env": "^7.0.3",
|
|
112
|
-
"eslint": "^8.3.0",
|
|
113
|
-
"lect": "^0.18.7",
|
|
114
|
-
"rollup": "^2.60.1",
|
|
115
|
-
"rollup-plugin-ascii": "^0.0.3",
|
|
116
|
-
"rollup-plugin-banner": "^0.2.1",
|
|
117
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
118
|
-
"rollup-plugin-dts": "^4.0.1",
|
|
119
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
120
|
-
"tap": "^15.1.5",
|
|
121
|
-
"tslib": "^2.3.1",
|
|
122
|
-
"typescript": "^4.5.2"
|
|
123
|
-
},
|
|
124
|
-
"engines": {
|
|
125
|
-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
126
73
|
}
|
|
127
74
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/examples/api.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport { pull } from \"array-pull-all-with-glob\";\n\nassert.deepEqual(\n pull(\n [\"keep_me\", \"name-1\", \"name-2\", \"name-jhkgdhgkhdfghdkghfdk\"],\n [\"name-*\"]\n ),\n [\"keep_me\"]\n);"}}
|