array-pull-all-with-glob 6.0.12 → 6.1.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 6.1.0 (2022-04-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- export defaults ([c375aa3](https://github.com/codsen/codsen/commit/c375aa34170a6dc98c9749ad64fbc2113f0a1953))
|
|
11
|
+
|
|
6
12
|
## 6.0.0 (2021-09-09)
|
|
7
13
|
|
|
8
14
|
### Features
|
package/README.md
CHANGED
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm i array-pull-all-with-glob
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
If you need a legacy version which works with `require`, use version 5.1.0
|
|
36
|
+
|
|
35
37
|
## Quick Take
|
|
36
38
|
|
|
37
39
|
```js
|
|
@@ -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.1.0
|
|
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{isMatch as
|
|
10
|
+
import{isMatch as p}from"matcher";var r="6.1.0";var h=r,c={caseSensitive:!0};function g(e,t,s){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),n={...c,...s};return Array.from(e).filter(i=>!l.some(a=>p(i,a,{caseSensitive:n.caseSensitive})))}export{c as defaults,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.1.0
|
|
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
|
-
var arrayPullAllWithGlob=(()=>{var
|
|
10
|
+
var arrayPullAllWithGlob=(()=>{var p=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var h=(e,r,t)=>r in e?p(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,o=(e,r)=>{for(var t in r||(r={}))m.call(r,t)&&h(e,t,r[t]);if(g)for(var t of g(r))S.call(r,t)&&h(e,t,r[t]);return e};var j=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},A=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of E(r))!m.call(e,s)&&s!==t&&p(e,s,{get:()=>r[s],enumerable:!(n=k(r,s))||n.enumerable});return e};var $=e=>A(p({},"__esModule",{value:!0}),e);var C={};j(C,{defaults:()=>v,pull:()=>z,version:()=>D});function d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var f=new Map,b=(e,r)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${r}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(t=>{if(typeof t!="string"){if(typeof t>"u")return!1;throw new TypeError(`Expected '${r}' to be an array of strings, but found a type of '${typeof t}' in the array`)}return!0})},M=(e,r)=>{r=o({caseSensitive:!1},r);let t=e+JSON.stringify(r);if(f.has(t))return f.get(t);let n=e[0]==="!";n&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return s.negated=n,f.set(t,s),s},O=(e,r,t,n)=>{if(e=b(e,"inputs"),r=b(r,"patterns"),r.length===0)return[];r=r.map(l=>M(l,t));let{allPatterns:s}=t||{},u=[];for(let l of e){let a,y=[...r].fill(!1);for(let[i,c]of r.entries())if(c.test(l)&&(y[i]=!0,a=!c.negated,!a))break;if(!(a===!1||a===void 0&&r.some(i=>!i.negated)||s&&y.some((i,c)=>!i&&!r[c].negated))&&(u.push(l),n))break}return u};function x(e,r,t){return O(e,r,t,!0).length>0}var w="6.1.0";var D=w,v={caseSensitive:!0};function z(e,r,t){if(!e.length)return[];if(!e.length||!r.length)return Array.from(e);let n=typeof r=="string"?[r]:Array.from(r),s=o(o({},v),t);return Array.from(e).filter(l=>!n.some(a=>x(l,a,{caseSensitive:s.caseSensitive})))}return $(C);})();
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare const version: string;
|
|
|
2
2
|
interface Opts {
|
|
3
3
|
caseSensitive?: boolean;
|
|
4
4
|
}
|
|
5
|
+
declare const defaults: Opts;
|
|
5
6
|
/**
|
|
6
7
|
* Like _.pullAll but with globs (wildcards)
|
|
7
8
|
*/
|
|
@@ -11,4 +12,4 @@ declare function pull(
|
|
|
11
12
|
originalOpts?: Opts
|
|
12
13
|
): string[];
|
|
13
14
|
|
|
14
|
-
export { pull, version };
|
|
15
|
+
export { defaults, pull, version };
|