array-includes-with-glob 5.2.0 → 5.2.1

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,11 +3,17 @@
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
+ ## 5.2.1 (2026-08-22)
7
+
8
+ ### Performance Improvements
9
+
10
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
11
+
6
12
  ## 5.2.0 (2026-08-19)
7
13
 
8
14
  ### Bug Fixes
9
15
 
10
- - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
16
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
11
17
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
12
18
 
13
19
  ### Features
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name array-includes-with-glob
3
3
  * @fileoverview Like _.includes but with wildcards
4
- * @version 5.2.0
4
+ * @version 5.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/array-includes-with-glob/}
8
8
  */
9
9
 
10
- import{match as o}from"codsen-utils";var c="5.2.0";var y=c,p={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function g(s,e,a){if(!s.length||!e.length)return!1;let r={...p,...a},n=typeof s=="string"?[s]:Array.from(s);return typeof e=="string"?n.some(t=>o(t,e,{caseSensitiveMatch:r.caseSensitive})):r.arrayVsArrayAllMustBeFound==="any"?e.some(t=>n.some(i=>o(i,t,{caseSensitiveMatch:r.caseSensitive}))):e.every(t=>n.some(i=>o(i,t,{caseSensitiveMatch:r.caseSensitive})))}export{p as defaults,g as includesWithGlob,y as version};
10
+ import{match as o}from"codsen-utils";var c="5.2.1";var y=c,p={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function g(s,e,a){if(!s.length||!e.length)return!1;let r={...p,...a},n=typeof s=="string"?[s]:Array.from(s);return typeof e=="string"?n.some(t=>o(t,e,{caseSensitiveMatch:r.caseSensitive})):r.arrayVsArrayAllMustBeFound==="any"?e.some(t=>n.some(i=>o(i,t,{caseSensitiveMatch:r.caseSensitive}))):e.every(t=>n.some(i=>o(i,t,{caseSensitiveMatch:r.caseSensitive})))}export{p as defaults,g as includesWithGlob,y as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name array-includes-with-glob
3
3
  * @fileoverview Like _.includes but with wildcards
4
- * @version 5.2.0
4
+ * @version 5.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/array-includes-with-glob/}
8
8
  */
9
9
 
10
- "use strict";var arrayIncludesWithGlob=(()=>{var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var M=(t,e,r)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C=(t,e)=>{for(var r in e||(e={}))W.call(e,r)&&M(t,r,e[r]);if(j)for(var r of j(e))N.call(e,r)&&M(t,r,e[r]);return t};var T=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},V=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of E(e))!W.call(t,l)&&l!==r&&v(t,l,{get:()=>e[l],enumerable:!(n=U(e,l))||n.enumerable});return t};var Q=t=>V(v({},"__esModule",{value:!0}),t);var ne={};T(ne,{defaults:()=>P,includesWithGlob:()=>re,version:()=>te});var le=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 _=256,H=1024,G=1,z=new Map,K=new Map;function O(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 k(t,e,r,n,l,i){for(let s=0;s<l;s++){let o=t.charCodeAt(e+s),u=r.charCodeAt(n+s);if(i||(o>=97&&o<=122&&(o-=32),u>=97&&u<=122&&(u-=32)),o!==u)return!1}return!0}function $(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&&k(t,0,e,0,e.length,!1)}if(n!==-1)return;let i=0,s=!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,!s){if(i++,i>1)return;s=!0}}else s=!1}let u=o+1,a=e.length-u;return t.length<l+a?!1:k(t,0,e,0,l,r)&&k(t,t.length-a,e,u,a,r)}function Z(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 q(t,e){let r=[[]],n=!0,l=!1,i=!1,s=0;for(let f=0;f<t.length;){let g=t.codePointAt(f);if(g!==92){if(g===42)l=!0,i||(r.push([]),i=!0);else{let h=e?g:O(g);r[r.length-1].push(h),n&&(n=h<=127),s++,i=!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,x=!1;p===42?(x=y%2===0,b=x?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),s++;if(x){i=!1,f=d;continue}if(p!==void 0){let h=e?p:O(p);r[r.length-1].push(h),n&&(n=h<=127),s++,d+=p>65535?2:1}i=!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=Z(a[f].values));return{asciiOnly:n,endsWithWildcard:u,hasWildcard:l,minimumInputLength:s,segments:a,startsWithWildcard:o}}function B(t,e){let r=e?z:K,n=t.length<=H;if(n){let i=r.get(t);if(i)return i}let l=q(t,e);if(n){if(r.size>=_){let i=r.keys().next().value;i!==void 0&&r.delete(i)}r.set(t,l)}return l}function R(t,e){if(e){let l=[];for(let i=0;i<t.length;){let s=t.codePointAt(i);l.push(s),i+=s>65535?2:1}return l}let r=new Uint32Array(t.length),n=0;for(let l=0;l<t.length;){let i=t.codePointAt(l);r[n]=O(i),n++,l+=i>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 i=t.charCodeAt(e+l);if(!n&&i>=97&&i<=122&&(i-=32),i!==r.values[l])return!1}return!0}function J(t,e,r,n,l){let i=n-e.values.length;if(i<r)return-1;if(!e.failure){for(let o=r;o<=i;o++)if(A(t,o,e,l))return o;return-1}let s=0;for(let o=r;o<n;o++){let u=t.charCodeAt(o);for(!l&&u>=97&&u<=122&&(u-=32);s>0&&u!==e.values[s];)s=e.failure[s-1];if(u===e.values[s]&&(s++,s===e.values.length))return o-s+1}return-1}function I(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,i=0,s=t.length;if(!e.startsWithWildcard){let o=e.segments[0];if(!A(t,0,o,r))return!1;i=o.values.length,n++}if(!e.endsWithWildcard){l--;let o=e.segments[l];if(s-=o.values.length,!A(t,s,o,r))return!1}for(let o=n;o<l;o++){let u=e.segments[o],a=J(t,u,i,s,r);if(a===-1)return!1;i=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 Y(t,e,r,n){let l=n-e.values.length;if(l<r)return-1;if(!e.failure){for(let s=r;s<=l;s++)if(w(t,s,e))return s;return-1}let i=0;for(let s=r;s<n;s++){for(;i>0&&t[s]!==e.values[i];)i=e.failure[i-1];if(t[s]===e.values[i]&&(i++,i===e.values.length))return s-i+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,i=t.length;if(!e.startsWithWildcard){let s=e.segments[0];if(!w(t,0,s))return!1;l=s.values.length,r++}if(!e.endsWithWildcard){n--;let s=e.segments[n];if(i-=s.values.length,!w(t,i,s))return!1}for(let s=r;s<n;s++){let o=e.segments[s],u=Y(t,o,l,i);if(u===-1)return!1;l=u+o.values.length}return!0}function X(t,e,r){let n=$(t,e,r);if(n!==void 0)return n;let l=B(e,r);return l.asciiOnly?I(t,l,r):L(R(t,r),l)}function D(t,e,r,n){var s;let l=$(t,e,r);if(l!==void 0)return l;let i=B(e,r);return i.asciiOnly?I(t,i,r):((s=n.tokens)!=null||(n.tokens=R(t,r)),L(n.tokens,i))}function S(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=X(t,u,n);return o?!a:a}let l={},i=!1,s=!1;for(let o of e){let u=o.charCodeAt(0)===33,a=u?o.slice(1):o;if(u){if(D(t,a,n,l))return!1}else i=!0,!s&&D(t,a,n,l)&&(s=!0)}return i?s:!0}var F="5.2.0";var te=F,P={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function re(t,e,r){if(!t.length||!e.length)return!1;let n=C(C({},P),r),l=typeof t=="string"?[t]:Array.from(t);return typeof e=="string"?l.some(i=>S(i,e,{caseSensitiveMatch:n.caseSensitive})):n.arrayVsArrayAllMustBeFound==="any"?e.some(i=>l.some(s=>S(s,i,{caseSensitiveMatch:n.caseSensitive}))):e.every(i=>l.some(s=>S(s,i,{caseSensitiveMatch:n.caseSensitive})))}return Q(ne);})();
10
+ "use strict";var arrayIncludesWithGlob=(()=>{var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var D=(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={}))M.call(e,r)&&D(t,r,e[r]);if(j)for(var r of j(e))N.call(e,r)&&D(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 T(e))!M.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:()=>F,includesWithGlob:()=>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 R,ue=(R=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:R.get;var ae=Date.prototype.getTime;var H=256,G=1024,z=1,K=new Map,Z=new Map;function k(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,i){for(let s=0;s<l;s++){let o=t.charCodeAt(e+s),u=r.charCodeAt(n+s);if(i||(o>=97&&o<=122&&(o-=32),u>=97&&u<=122&&(u-=32)),o!==u)return!1}return!0}function $(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 i=0,s=!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,!s){if(i++,i>1)return;s=!0}}else s=!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,i=!1,s=0;for(let f=0;f<t.length;){let g=t.codePointAt(f);if(g!==92){if(g===42)l=!0,i||(r.push([]),i=!0);else{let d=e?g:k(g);r[r.length-1].push(d),n&&(n=d<=127),s++,i=!1}f+=g>65535?2:1;continue}let h=f+1;for(;t.charCodeAt(h)===92;)h++;let y=h-f,p=t.codePointAt(h),b,S=!1;p===42?(S=y%2===0,b=S?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 d=0;d<b;d++)r[r.length-1].push(92),s++;if(S){i=!1,f=h;continue}if(p!==void 0){let d=e?p:k(p);r[r.length-1].push(d),n&&(n=d<=127),s++,h+=p>65535?2:1}i=!1,f=h}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>z&&(a[f].failure=q(a[f].values));return{asciiOnly:n,endsWithWildcard:u,hasWildcard:l,minimumInputLength:s,segments:a,startsWithWildcard:o}}function B(t,e){let r=e?K:Z,n=t.length<=G;if(n){let i=r.get(t);if(i)return i}let l=J(t,e);if(n){if(r.size>=H){let i=r.keys().next().value;i!==void 0&&r.delete(i)}r.set(t,l)}return l}function I(t,e){if(e){let l=[];for(let i=0;i<t.length;){let s=t.codePointAt(i);l.push(s),i+=s>65535?2:1}return l}let r=new Uint32Array(t.length),n=0;for(let l=0;l<t.length;){let i=t.codePointAt(l);r[n]=k(i),n++,l+=i>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 i=t.charCodeAt(e+l);if(!n&&i>=97&&i<=122&&(i-=32),i!==r.values[l])return!1}return!0}function Y(t,e,r,n,l){let i=n-e.values.length;if(i<r)return-1;if(!e.failure){for(let o=r;o<=i;o++)if(A(t,o,e,l))return o;return-1}let s=0;for(let o=r;o<n;o++){let u=t.charCodeAt(o);for(!l&&u>=97&&u<=122&&(u-=32);s>0&&u!==e.values[s];)s=e.failure[s-1];if(u===e.values[s]&&(s++,s===e.values.length))return o-s+1}return-1}function L(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,i=0,s=t.length;if(!e.startsWithWildcard){let o=e.segments[0];if(!A(t,0,o,r))return!1;i=o.values.length,n++}if(!e.endsWithWildcard){l--;let o=e.segments[l];if(s-=o.values.length,!A(t,s,o,r))return!1}for(let o=n;o<l;o++){let u=e.segments[o],a=Y(t,u,i,s,r);if(a===-1)return!1;i=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 s=r;s<=l;s++)if(w(t,s,e))return s;return-1}let i=0;for(let s=r;s<n;s++){for(;i>0&&t[s]!==e.values[i];)i=e.failure[i-1];if(t[s]===e.values[i]&&(i++,i===e.values.length))return s-i+1}return-1}function P(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,i=t.length;if(!e.startsWithWildcard){let s=e.segments[0];if(!w(t,0,s))return!1;l=s.values.length,r++}if(!e.endsWithWildcard){n--;let s=e.segments[n];if(i-=s.values.length,!w(t,i,s))return!1}for(let s=r;s<n;s++){let o=e.segments[s],u=X(t,o,l,i);if(u===-1)return!1;l=u+o.values.length}return!0}function ee(t,e,r){let n=$(t,e,r);if(n!==void 0)return n;let l=B(e,r);return l.asciiOnly?L(t,l,r):P(I(t,r),l)}function W(t,e,r,n){var s;let l=$(t,e,r);if(l!==void 0)return l;let i=B(e,r);return i.asciiOnly?L(t,i,r):((s=n.tokens)!=null||(n.tokens=I(t,r)),P(n.tokens,i))}function C(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={},i=!1,s=!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 i=!0,!s&&W(t,a,n,l)&&(s=!0)}return i?s:!0}var E="5.2.1";var re=E,F={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function ne(t,e,r){if(!t.length||!e.length)return!1;let n=x(x({},F),r),l=typeof t=="string"?[t]:Array.from(t);return typeof e=="string"?l.some(i=>C(i,e,{caseSensitiveMatch:n.caseSensitive})):n.arrayVsArrayAllMustBeFound==="any"?e.some(i=>l.some(s=>C(s,i,{caseSensitiveMatch:n.caseSensitive}))):e.every(i=>l.some(s=>C(s,i,{caseSensitiveMatch:n.caseSensitive})))}return _(ie);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.8.0
14
+ * @version 1.9.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "array-includes-with-glob",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Like _.includes but with wildcards",
5
5
  "keywords": [
6
6
  "array",
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "codsen-utils": "^1.8.0"
76
+ "codsen-utils": "^1.9.0"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=18.20.8"