array-pull-all-with-glob 6.0.10 → 6.0.11

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # array-pull-all-with-glob
2
2
 
3
- > Like _.pullAll but with globs (wildcards)
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">
@@ -26,14 +26,12 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
29
+ The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `5.1.0`.
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
-
37
35
  ## Quick Take
38
36
 
39
37
  ```js
@@ -62,8 +60,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
62
60
 
63
61
  MIT License
64
62
 
65
- Copyright (c) 2010-2021 Roy Revelt and other contributors
66
-
63
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
67
64
 
68
65
  <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,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.10
4
+ * @version 6.0.11
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 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};
10
+ import{isMatch as o}from"matcher";var r="6.0.11";var h=r;function f(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={...{caseSensitive:!0},...s};return Array.from(e).filter(i=>!l.some(a=>o(i,a,{caseSensitive:n.caseSensitive})))}export{f 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.10
4
+ * @version 6.0.11
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 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);})();
10
+ var arrayPullAllWithGlob=(()=>{var d=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?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o=(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=>d(e,"__esModule",{value:!0});var $=(e,t)=>{for(var r in t)d(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")&&d(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 f(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=o({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=f(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,p=[...t].fill(!1);for(let[i,u]of t.entries())if(u.test(a)&&(p[i]=!0,n=!u.negated,!n))break;if(!(n===!1||n===void 0&&t.some(i=>!i.negated)||s&&p.some((i,u)=>!i&&!t[u].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.11";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=o(o({},{caseSensitive:!0}),r);return Array.from(e).filter(n=>!l.some(p=>x(n,p,{caseSensitive:c.caseSensitive})))}return A(D);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "array-pull-all-with-glob",
3
- "version": "6.0.10",
3
+ "version": "6.0.11",
4
4
  "description": "Like _.pullAll but with globs (wildcards)",
5
5
  "keywords": [
6
6
  "array",
@@ -40,13 +40,15 @@
40
40
  "scripts": {
41
41
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
42
42
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
43
- "dts": "rollup -c",
43
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
44
44
  "examples": "node '../../ops/scripts/run-examples.js'",
45
45
  "lect": "node '../../ops/lect/lect.js'",
46
46
  "letspublish": "yarn publish || :",
47
47
  "lint": "eslint . --fix",
48
48
  "perf": "node perf/check.js",
49
49
  "prepare": "echo 'ready'",
50
+ "prettier": "prettier",
51
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
50
52
  "pretest": "yarn run lect && yarn run build",
51
53
  "test": "c8 yarn run unit && yarn run examples && yarn run lint",
52
54
  "unit": "uvu test"
package/types/index.d.ts CHANGED
@@ -1,10 +1,14 @@
1
1
  declare const version: string;
2
2
  interface Opts {
3
- caseSensitive?: boolean;
3
+ caseSensitive?: boolean;
4
4
  }
5
5
  /**
6
6
  * Like _.pullAll but with globs (wildcards)
7
7
  */
8
- declare function pull(originalInput: string[], originalToBeRemoved: string | string[], originalOpts?: Opts): string[];
8
+ declare function pull(
9
+ originalInput: string[],
10
+ originalToBeRemoved: string | string[],
11
+ originalOpts?: Opts
12
+ ): string[];
9
13
 
10
14
  export { pull, version };