array-pull-all-with-glob 7.2.1 → 7.2.2
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 +14 -0
- package/README.md +1 -1
- package/dist/array-pull-all-with-glob.esm.js +3 -3
- package/dist/array-pull-all-with-glob.umd.js +12 -4
- package/package.json +3 -4
- package/types/index.d.ts +26 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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
|
+
## 7.2.2 (2026-09-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- accept readonly array removal inputs ([804254d](https://github.com/codsen/codsen/commit/804254dac354c85ad20d831f9df65fbef78f4589))
|
|
11
|
+
- align null options type contract ([4693b8a](https://github.com/codsen/codsen/commit/4693b8a16cf2fcbf25b1166f13b567e7a9097995))
|
|
12
|
+
- normalize empty array removal patterns ([6f7c03e](https://github.com/codsen/codsen/commit/6f7c03ebe944e3a7c5d0d59f63e9b5a997c23d17))
|
|
13
|
+
- preserve array pull option defaults ([0799e99](https://github.com/codsen/codsen/commit/0799e99def43c94eb06cfbab91fae976f0969abc))
|
|
14
|
+
|
|
15
|
+
### Performance Improvements
|
|
16
|
+
|
|
17
|
+
- accelerate literal array removals ([fbbd70c](https://github.com/codsen/codsen/commit/fbbd70ce3f35f903b09d150635d9ffa3d34737e9))
|
|
18
|
+
- avoid array matcher cache thrashing ([2daab5f](https://github.com/codsen/codsen/commit/2daab5fad46dbeadb0cfa2d0fe2876d9e6a7f876))
|
|
19
|
+
|
|
6
20
|
## 7.2.1 (2026-08-22)
|
|
7
21
|
|
|
8
22
|
### Performance Improvements
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1 align="center">array-pull-all-with-glob</h1>
|
|
2
2
|
|
|
3
|
-
<p align="center">
|
|
3
|
+
<p align="center">Remove array entries using whole-string wildcard patterns</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<a href="https://codsen.com/os/array-pull-all-with-glob" rel="nofollow noreferrer noopener">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-pull-all-with-glob
|
|
3
|
-
* @fileoverview
|
|
4
|
-
* @version 7.2.
|
|
3
|
+
* @fileoverview Remove array entries using whole-string wildcard patterns
|
|
4
|
+
* @version 7.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-pull-all-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{match as
|
|
10
|
+
import{match as a}from"codsen-utils";var c="7.2.2";var w=c,g={caseSensitive:!0},p=256,u=400;function h(t,r,s){let n=new Uint8Array(t.length),i={caseSensitiveMatch:s},e=0;for(let o of r)if(o){for(let l=0;l<t.length;l++)!n[l]&&a(t[l],o,i)&&(n[l]=1,e++);if(e===t.length)return[]}return t.filter((o,l)=>!n[l])}function f(t,r,s){let n={caseSensitiveMatch:s},i=[];e:for(let e=0;e<t.length;e++){if(!(e in t))continue;let o=t[e];for(let l of r)if(l.length!==0&&a(o,l,n))continue e;i.push(o)}return i}function m(t,r){let s=[],n=[];for(let e of r)e&&(e.charCodeAt(0)===33||e.includes("*")||e.includes("\\")?n.push(e):s.push(e));if(!s.length||t.length*s.length<u||n.length>p)return;let i=new Set(s);return n.length?t.filter(e=>!i.has(e)&&!n.some(o=>a(e,o,{caseSensitiveMatch:!0}))):t.filter(e=>!i.has(e))}function j(t,r,s){if(!t.length)return[];let n=typeof r=="string"?r?[r]:[]:r;if(!n.length)return Array.from(t);let i=s?.caseSensitive??g.caseSensitive;if(i&&t.length*n.length>=u){let e=m(t,n);if(e!==void 0)return e}return t.length>1&&n.length>p?h(t,n,i):f(t,n,i)}export{g as defaults,j as pull,w as version};
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-pull-all-with-glob
|
|
3
|
-
* @fileoverview
|
|
4
|
-
* @version 7.2.
|
|
3
|
+
* @fileoverview Remove array entries using whole-string wildcard patterns
|
|
4
|
+
* @version 7.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-pull-all-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var arrayPullAllWithGlob=(()=>{var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=(t,e,r)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||(e={}))D.call(e,r)&&j(t,r,e[r]);if(k)for(var r of k(e))N.call(e,r)&&j(t,r,e[r]);return t};var V=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},Q=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of F(e))!D.call(t,l)&&l!==r&&v(t,l,{get:()=>e[l],enumerable:!(n=U(e,l))||n.enumerable});return t};var _=t=>Q(v({},"__esModule",{value:!0}),t);var ie={};V(ie,{defaults:()=>T,pull:()=>ne,version:()=>re});var oe=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var $,ue=($=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:$.get;var ae=Date.prototype.getTime;var H=256,z=1024,G=1,K=new Map,Z=new Map;function S(t){if(t>=97&&t<=122)return t-32;if(t>65535)return t;let e=String.fromCharCode(t).toUpperCase();if(e.length!==1)return t;let r=e.charCodeAt(0);return t>127&&r<128?t:r}function O(t,e,r,n,l,s){for(let i=0;i<l;i++){let o=t.charCodeAt(e+i),u=r.charCodeAt(n+i);if(s||(o>=97&&o<=122&&(o-=32),u>=97&&u<=122&&(u-=32)),o!==u)return!1}return!0}function M(t,e,r){let n=e.indexOf("\\");if(n===-1&&t===e)return!0;let l=e.indexOf("*");if(n===-1&&l===-1){if(r)return!1;for(let c=0;c<e.length;c++)if(e.charCodeAt(c)>127)return;return t.length===e.length&&O(t,0,e,0,e.length,!1)}if(n!==-1)return;let s=0,i=!1,o=-1;for(let c=0;c<e.length;c++){let m=e.charCodeAt(c);if(m>127)return;if(m===42){if(o=c,!i){if(s++,s>1)return;i=!0}}else i=!1}let u=o+1,a=e.length-u;return t.length<l+a?!1:O(t,0,e,0,l,r)&&O(t,t.length-a,e,u,a,r)}function q(t){let e=new Uint32Array(t.length),r=0;for(let n=1;n<t.length;n++){for(;r>0&&t[n]!==t[r];)r=e[r-1];t[n]===t[r]&&r++,e[n]=r}return e}function J(t,e){let r=[[]],n=!0,l=!1,s=!1,i=0;for(let f=0;f<t.length;){let g=t.codePointAt(f);if(g!==92){if(g===42)l=!0,s||(r.push([]),s=!0);else{let h=e?g:S(g);r[r.length-1].push(h),n&&(n=h<=127),i++,s=!1}f+=g>65535?2:1;continue}let d=f+1;for(;t.charCodeAt(d)===92;)d++;let y=d-f,p=t.codePointAt(d),b,C=!1;p===42?(C=y%2===0,b=C?y/2:(y-1)/2):p===void 0||p===10||p===13||p===8232||p===8233?b=Math.ceil(y/2):b=Math.floor(y/2);for(let h=0;h<b;h++)r[r.length-1].push(92),i++;if(C){s=!1,f=d;continue}if(p!==void 0){let h=e?p:S(p);r[r.length-1].push(h),n&&(n=h<=127),i++,d+=p>65535?2:1}s=!1,f=d}let o=l&&r[0].length===0,u=l&&r[r.length-1].length===0,a=[];for(let f of r)f.length&&a.push({values:f});let c=o?0:1,m=a.length-(u?0:1);for(let f=c;f<m;f++)a[f].values.length>G&&(a[f].failure=q(a[f].values));return{asciiOnly:n,endsWithWildcard:u,hasWildcard:l,minimumInputLength:i,segments:a,startsWithWildcard:o}}function R(t,e){let r=e?K:Z,n=t.length<=z;if(n){let s=r.get(t);if(s)return s}let l=J(t,e);if(n){if(r.size>=H){let s=r.keys().next().value;s!==void 0&&r.delete(s)}r.set(t,l)}return l}function I(t,e){if(e){let l=[];for(let s=0;s<t.length;){let i=t.codePointAt(s);l.push(i),s+=i>65535?2:1}return l}let r=new Uint32Array(t.length),n=0;for(let l=0;l<t.length;){let s=t.codePointAt(l);r[n]=S(s),n++,l+=s>65535?2:1}return n===r.length?r:r.subarray(0,n)}function A(t,e,r,n){for(let l=0;l<r.values.length;l++){let s=t.charCodeAt(e+l);if(!n&&s>=97&&s<=122&&(s-=32),s!==r.values[l])return!1}return!0}function Y(t,e,r,n,l){let s=n-e.values.length;if(s<r)return-1;if(!e.failure){for(let o=r;o<=s;o++)if(A(t,o,e,l))return o;return-1}let i=0;for(let o=r;o<n;o++){let u=t.charCodeAt(o);for(!l&&u>=97&&u<=122&&(u-=32);i>0&&u!==e.values[i];)i=e.failure[i-1];if(u===e.values[i]&&(i++,i===e.values.length))return o-i+1}return-1}function B(t,e,r){if(t.length<e.minimumInputLength)return!1;if(!e.hasWildcard)return t.length===e.minimumInputLength&&A(t,0,e.segments[0],r);let n=0,l=e.segments.length,s=0,i=t.length;if(!e.startsWithWildcard){let o=e.segments[0];if(!A(t,0,o,r))return!1;s=o.values.length,n++}if(!e.endsWithWildcard){l--;let o=e.segments[l];if(i-=o.values.length,!A(t,i,o,r))return!1}for(let o=n;o<l;o++){let u=e.segments[o],a=Y(t,u,s,i,r);if(a===-1)return!1;s=a+u.values.length}return!0}function w(t,e,r){for(let n=0;n<r.values.length;n++)if(t[e+n]!==r.values[n])return!1;return!0}function X(t,e,r,n){let l=n-e.values.length;if(l<r)return-1;if(!e.failure){for(let i=r;i<=l;i++)if(w(t,i,e))return i;return-1}let s=0;for(let i=r;i<n;i++){for(;s>0&&t[i]!==e.values[s];)s=e.failure[s-1];if(t[i]===e.values[s]&&(s++,s===e.values.length))return i-s+1}return-1}function L(t,e){if(t.length<e.minimumInputLength)return!1;if(!e.hasWildcard)return t.length===e.minimumInputLength&&w(t,0,e.segments[0]);let r=0,n=e.segments.length,l=0,s=t.length;if(!e.startsWithWildcard){let i=e.segments[0];if(!w(t,0,i))return!1;l=i.values.length,r++}if(!e.endsWithWildcard){n--;let i=e.segments[n];if(s-=i.values.length,!w(t,s,i))return!1}for(let i=r;i<n;i++){let o=e.segments[i],u=X(t,o,l,s);if(u===-1)return!1;l=u+o.values.length}return!0}function ee(t,e,r){let n=M(t,e,r);if(n!==void 0)return n;let l=R(e,r);return l.asciiOnly?B(t,l,r):L(I(t,r),l)}function W(t,e,r,n){var i;let l=M(t,e,r);if(l!==void 0)return l;let s=R(e,r);return s.asciiOnly?B(t,s,r):((i=n.tokens)!=null||(n.tokens=I(t,r)),L(n.tokens,s))}function P(t,e,r){if(typeof e!="string"&&!e.length)return!1;let n=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof e=="string"){let o=e.charCodeAt(0)===33,u=o?e.slice(1):e,a=ee(t,u,n);return o?!a:a}let l={},s=!1,i=!1;for(let o of e){let u=o.charCodeAt(0)===33,a=u?o.slice(1):o;if(u){if(W(t,a,n,l))return!1}else s=!0,!i&&W(t,a,n,l)&&(i=!0)}return s?i:!0}var E="7.2.1";var re=E,T={caseSensitive:!0};function ne(t,e,r){if(!t.length)return[];if(!t.length||!e.length)return Array.from(t);let n=typeof e=="string"?[e]:Array.from(e),l=x(x({},T),r);return Array.from(t).filter(i=>!n.some(o=>P(i,o,{caseSensitiveMatch:l.caseSensitive})))}return _(ie);})();
|
|
10
|
+
"use strict";var arrayPullAllWithGlob=(()=>{var O=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var q=(e,_)=>{for(var t in _)O(e,t,{get:_[t],enumerable:!0})},H=(e,_,t,n)=>{if(_&&typeof _=="object"||typeof _=="function")for(let l of T(_))!V.call(e,l)&&l!==t&&O(e,l,{get:()=>_[l],enumerable:!(n=F(_,l))||n.enumerable});return e};var K=e=>H(O({},"__esModule",{value:!0}),e);var pe={};q(pe,{defaults:()=>z,pull:()=>fe,version:()=>se});var Q=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4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g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),A=Q.slice(1).split("_"),G=[],C=127;for(let e=0;e<A.length;e+=2){let _=C+1+Number.parseInt(A[e],36),t=_+Number.parseInt(A[e+1],36);G.push([_,t]),C=t}var be=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var J=Function.prototype.toString,ve=J.call(Object);var we=Map.prototype.entries,je=Set.prototype.values;var D,Oe=(D=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:D.get,R,Ae=(R=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:R.get,P,xe=(P=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:P.get,M,ke=(M=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:M.get,Ce=RegExp.prototype.test;var Se=Date.prototype.getTime;var Z=256,Y=1024,X=1,ee=new Map,_e=new Map;function k(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let _=String.fromCharCode(e).toUpperCase();if(_.length!==1)return e;let t=_.charCodeAt(0);return e>127&&t<128?e:t}function x(e,_,t,n,l,r){for(let i=0;i<l;i++){let o=e.charCodeAt(_+i),s=t.charCodeAt(n+i);if(r||(o>=97&&o<=122&&(o-=32),s>=97&&s<=122&&(s-=32)),o!==s)return!1}return!0}function W(e,_,t){let n=_.indexOf("\\");if(n===-1&&e===_)return!0;let l=_.indexOf("*");if(n===-1&&l===-1){if(t)return!1;for(let c=0;c<_.length;c++)if(_.charCodeAt(c)>127)return;return e.length===_.length&&x(e,0,_,0,_.length,!1)}if(n!==-1)return;let r=0,i=!1,o=-1;for(let c=0;c<_.length;c++){let y=_.charCodeAt(c);if(y>127)return;if(y===42){if(o=c,!i){if(r++,r>1)return;i=!0}}else i=!1}let s=o+1,a=_.length-s;return e.length<l+a?!1:x(e,0,_,0,l,t)&&x(e,e.length-a,_,s,a,t)}function te(e){let _=new Uint32Array(e.length),t=0;for(let n=1;n<e.length;n++){for(;t>0&&e[n]!==e[t];)t=_[t-1];e[n]===e[t]&&t++,_[n]=t}return _}function ne(e,_){let t=[[]],n=!0,l=!1,r=!1,i=0;for(let u=0;u<e.length;){let g=e.codePointAt(u);if(g!==92){if(g===42)l=!0,r||(t.push([]),r=!0);else{let p=_?g:k(g);t[t.length-1].push(p),n&&(n=p<=127),i++,r=!1}u+=g>65535?2:1;continue}let h=u+1;for(;e.charCodeAt(h)===92;)h++;let d=h-u,f=e.codePointAt(h),m,j=!1;f===42?(j=d%2===0,m=j?d/2:(d-1)/2):f===void 0||f===10||f===13||f===8232||f===8233?m=Math.ceil(d/2):m=Math.floor(d/2);for(let p=0;p<m;p++)t[t.length-1].push(92),i++;if(j){r=!1,u=h;continue}if(f!==void 0){let p=_?f:k(f);t[t.length-1].push(p),n&&(n=p<=127),i++,h+=f>65535?2:1}r=!1,u=h}let o=l&&t[0].length===0,s=l&&t[t.length-1].length===0,a=[];for(let u of t)u.length&&a.push({values:u});let c=o?0:1,y=a.length-(s?0:1);for(let u=c;u<y;u++)a[u].values.length>X&&(a[u].failure=te(a[u].values));return{asciiOnly:n,endsWithWildcard:s,hasWildcard:l,minimumInputLength:i,segments:a,startsWithWildcard:o}}function I(e,_){let t=_?ee:_e,n=e.length<=Y;if(n){let r=t.get(e);if(r)return r}let l=ne(e,_);if(n){if(t.size>=Z){let r=t.keys().next().value;r!==void 0&&t.delete(r)}t.set(e,l)}return l}function $(e,_){if(_){let l=[];for(let r=0;r<e.length;){let i=e.codePointAt(r);l.push(i),r+=i>65535?2:1}return l}let t=new Uint32Array(e.length),n=0;for(let l=0;l<e.length;){let r=e.codePointAt(l);t[n]=k(r),n++,l+=r>65535?2:1}return n===t.length?t:t.subarray(0,n)}function b(e,_,t,n){for(let l=0;l<t.values.length;l++){let r=e.charCodeAt(_+l);if(!n&&r>=97&&r<=122&&(r-=32),r!==t.values[l])return!1}return!0}function re(e,_,t,n,l){let r=n-_.values.length;if(r<t)return-1;if(!_.failure){for(let o=t;o<=r;o++)if(b(e,o,_,l))return o;return-1}let i=0;for(let o=t;o<n;o++){let s=e.charCodeAt(o);for(!l&&s>=97&&s<=122&&(s-=32);i>0&&s!==_.values[i];)i=_.failure[i-1];if(s===_.values[i]&&(i++,i===_.values.length))return o-i+1}return-1}function E(e,_,t){if(e.length<_.minimumInputLength)return!1;if(!_.hasWildcard)return e.length===_.minimumInputLength&&b(e,0,_.segments[0],t);let n=0,l=_.segments.length,r=0,i=e.length;if(!_.startsWithWildcard){let o=_.segments[0];if(!b(e,0,o,t))return!1;r=o.values.length,n++}if(!_.endsWithWildcard){l--;let o=_.segments[l];if(i-=o.values.length,!b(e,i,o,t))return!1}for(let o=n;o<l;o++){let s=_.segments[o],a=re(e,s,r,i,t);if(a===-1)return!1;r=a+s.values.length}return!0}function v(e,_,t){for(let n=0;n<t.values.length;n++)if(e[_+n]!==t.values[n])return!1;return!0}function ie(e,_,t,n){let l=n-_.values.length;if(l<t)return-1;if(!_.failure){for(let i=t;i<=l;i++)if(v(e,i,_))return i;return-1}let r=0;for(let i=t;i<n;i++){for(;r>0&&e[i]!==_.values[r];)r=_.failure[r-1];if(e[i]===_.values[r]&&(r++,r===_.values.length))return i-r+1}return-1}function L(e,_){if(e.length<_.minimumInputLength)return!1;if(!_.hasWildcard)return e.length===_.minimumInputLength&&v(e,0,_.segments[0]);let t=0,n=_.segments.length,l=0,r=e.length;if(!_.startsWithWildcard){let i=_.segments[0];if(!v(e,0,i))return!1;l=i.values.length,t++}if(!_.endsWithWildcard){n--;let i=_.segments[n];if(r-=i.values.length,!v(e,r,i))return!1}for(let i=t;i<n;i++){let o=_.segments[i],s=ie(e,o,l,r);if(s===-1)return!1;l=s+o.values.length}return!0}function le(e,_,t){let n=W(e,_,t);if(n!==void 0)return n;let l=I(_,t);return l.asciiOnly?E(e,l,t):L($(e,t),l)}function S(e,_,t,n){var i;let l=W(e,_,t);if(l!==void 0)return l;let r=I(_,t);return r.asciiOnly?E(e,r,t):((i=n.tokens)!=null||(n.tokens=$(e,t)),L(n.tokens,r))}function w(e,_,t){if(typeof _!="string"&&!_.length)return!1;let n=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof _=="string"){let o=_.charCodeAt(0)===33,s=o?_.slice(1):_,a=le(e,s,n);return o?!a:a}let l={},r=!1,i=!1;for(let o of _){let s=o.charCodeAt(0)===33,a=s?o.slice(1):o;if(s){if(S(e,a,n,l))return!1}else r=!0,!i&&S(e,a,n,l)&&(i=!0)}return r?i:!0}var B="7.2.2";var se=B,z={caseSensitive:!0},N=256,U=400;function ae(e,_,t){let n=new Uint8Array(e.length),l={caseSensitiveMatch:t},r=0;for(let i of _)if(i){for(let o=0;o<e.length;o++)!n[o]&&w(e[o],i,l)&&(n[o]=1,r++);if(r===e.length)return[]}return e.filter((i,o)=>!n[o])}function ue(e,_,t){let n={caseSensitiveMatch:t},l=[];e:for(let r=0;r<e.length;r++){if(!(r in e))continue;let i=e[r];for(let o of _)if(o.length!==0&&w(i,o,n))continue e;l.push(i)}return l}function ce(e,_){let t=[],n=[];for(let r of _)r&&(r.charCodeAt(0)===33||r.includes("*")||r.includes("\\")?n.push(r):t.push(r));if(!t.length||e.length*t.length<U||n.length>N)return;let l=new Set(t);return n.length?e.filter(r=>!l.has(r)&&!n.some(i=>w(r,i,{caseSensitiveMatch:!0}))):e.filter(r=>!l.has(r))}function fe(e,_,t){var r;if(!e.length)return[];let n=typeof _=="string"?_?[_]:[]:_;if(!n.length)return Array.from(e);let l=(r=t==null?void 0:t.caseSensitive)!=null?r:z.caseSensitive;if(l&&e.length*n.length>=U){let i=ce(e,n);if(i!==void 0)return i}return e.length>1&&n.length>N?ae(e,n,l):ue(e,n,l)}return K(pe);})();
|
|
11
|
+
/**
|
|
12
|
+
* @name codsen-format-diagnostic-value
|
|
13
|
+
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
14
|
+
* @version 1.1.0
|
|
15
|
+
* @author Roy Revelt
|
|
16
|
+
* @license MIT
|
|
17
|
+
* {@link https://codsen.com/os/codsen-format-diagnostic-value/}
|
|
18
|
+
*/
|
|
11
19
|
/**
|
|
12
20
|
* @name codsen-utils
|
|
13
21
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
22
|
+
* @version 1.10.0
|
|
15
23
|
* @author Roy Revelt
|
|
16
24
|
* @license MIT
|
|
17
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "array-pull-all-with-glob",
|
|
3
|
-
"version": "7.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.2.2",
|
|
4
|
+
"description": "Remove array entries using whole-string wildcard patterns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
7
7
|
"delete",
|
|
8
8
|
"element",
|
|
9
9
|
"from",
|
|
10
10
|
"glob",
|
|
11
|
-
"globby",
|
|
12
11
|
"pattern",
|
|
13
12
|
"pulal",
|
|
14
13
|
"pulall",
|
|
@@ -74,7 +73,7 @@
|
|
|
74
73
|
}
|
|
75
74
|
},
|
|
76
75
|
"dependencies": {
|
|
77
|
-
"codsen-utils": "^1.
|
|
76
|
+
"codsen-utils": "^1.10.0"
|
|
78
77
|
},
|
|
79
78
|
"engines": {
|
|
80
79
|
"node": ">=18.20.8"
|
package/types/index.d.ts
CHANGED
|
@@ -4,12 +4,34 @@ interface Opts {
|
|
|
4
4
|
}
|
|
5
5
|
declare const defaults: Opts;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Return a new array without values that match any removal pattern.
|
|
8
|
+
*
|
|
9
|
+
* Patterns match the whole value. `*` matches zero or more Unicode code
|
|
10
|
+
* points, including directory separators and line breaks; consecutive stars
|
|
11
|
+
* are equivalent to one. A backslash escapes the character after it, so `\*`
|
|
12
|
+
* matches a literal asterisk and `\\` matches a literal backslash. A leading
|
|
13
|
+
* `!` negates that one pattern. Every removal pattern is evaluated separately,
|
|
14
|
+
* and a value is removed when any resulting predicate is true. Negative
|
|
15
|
+
* patterns therefore do not veto positive patterns in the same array.
|
|
16
|
+
*
|
|
17
|
+
* All other characters, including `?`, brackets, braces, and extglob-like
|
|
18
|
+
* punctuation, are literals. To match a literal leading `!`, escape it as
|
|
19
|
+
* `\!`. Case-insensitive matching uses one-code-point uppercase comparisons;
|
|
20
|
+
* it is not locale-aware and does not apply multi-code-point case folding.
|
|
21
|
+
*
|
|
22
|
+
* @param strArr source values; this array is not mutated
|
|
23
|
+
* @param toBeRemoved one removal pattern or an array of patterns; arrays are
|
|
24
|
+
* not mutated
|
|
25
|
+
* @param opts matching options
|
|
26
|
+
* @returns a new array containing the values that no pattern removed
|
|
27
|
+
* @example
|
|
28
|
+
* pull(["keep.js", "remove.js", "file*"], ["remove*", "file\\*"]);
|
|
29
|
+
* // => ["keep.js"]
|
|
8
30
|
*/
|
|
9
31
|
declare function pull(
|
|
10
|
-
strArr: string[],
|
|
11
|
-
toBeRemoved: string | string[],
|
|
12
|
-
opts?: Partial<Opts
|
|
32
|
+
strArr: readonly string[],
|
|
33
|
+
toBeRemoved: string | readonly string[],
|
|
34
|
+
opts?: Partial<Opts> | null,
|
|
13
35
|
): string[];
|
|
14
36
|
|
|
15
37
|
export { defaults, pull, version };
|