array-includes-with-glob 5.1.3 → 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,28 @@
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.1.0 (2025-10-15)
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
+
12
+ ## 5.2.0 (2026-08-19)
13
+
14
+ ### Bug Fixes
15
+
16
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
17
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
7
18
 
8
19
  ### Features
9
20
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
21
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
22
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
23
+
24
+ ### Reverts
25
+
26
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
27
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
28
 
12
29
  ## 5.0.0 (2022-12-01)
13
30
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 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
@@ -32,23 +32,17 @@ npm i array-includes-with-glob
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { includesWithGlob } from "array-includes-with-glob";
38
38
 
39
39
  assert.equal(includesWithGlob(["xc", "yc", "zc"], "*c"), true);
40
- // (all 3)
41
-
42
- assert.equal(includesWithGlob(["xc", "yc", "zc"], "*a"), false);
43
- // (none found)
44
-
45
- assert.equal(includesWithGlob(["something", "anything", "zzz"], "some*"), true);
46
- // (1 hit)
47
40
  ```
48
41
 
42
+
49
43
  ## Documentation
50
44
 
51
- Please [visit codsen.com](https://codsen.com/os/array-includes-with-glob/) for a full description of the API.
45
+ Please [visit codsen.com](https://codsen.com/os/array-includes-with-glob/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/array-includes-with-glob/CHANGELOG.md).
52
46
 
53
47
  ## Contributing
54
48
 
@@ -58,6 +52,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
58
52
 
59
53
  MIT License
60
54
 
61
- Copyright © 2010-2025 Roy Revelt and other contributors
55
+ Copyright © 2010-2026 Roy Revelt and other contributors
62
56
 
63
57
  <p align="center"><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"></p>
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name array-includes-with-glob
3
3
  * @fileoverview Like _.includes but with wildcards
4
- * @version 5.1.3
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{isMatch as o}from"matcher";var l="5.1.3";var y=l,p={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function g(s,e,c){if(!s.length||!e.length)return!1;let r={...p,...c},n=typeof s=="string"?[s]:Array.from(s);return typeof e=="string"?n.some(t=>o(t,e,{caseSensitive:r.caseSensitive})):r.arrayVsArrayAllMustBeFound==="any"?e.some(t=>n.some(i=>o(i,t,{caseSensitive:r.caseSensitive}))):e.every(t=>n.some(i=>o(i,t,{caseSensitive: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,10 +1,18 @@
1
1
  /**
2
2
  * @name array-includes-with-glob
3
3
  * @fileoverview Like _.includes but with wildcards
4
- * @version 5.1.3
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 b=Object.freeze,p=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var v=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t)=>{for(var r in t||(t={}))A.call(t,r)&&v(e,r,t[r]);if(x)for(var r of x(t))C.call(t,r)&&v(e,r,t[r]);return e};var M=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},B=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $(t))!A.call(e,s)&&s!==r&&p(e,s,{get:()=>t[s],enumerable:!(i=R(t,s))||i.enumerable});return e};var D=e=>B(p({},"__esModule",{value:!0}),e);var f=(e,t)=>b(p(e,"raw",{value:b(t||e.slice())}));var H={};M(H,{defaults:()=>j,includesWithGlob:()=>O,version:()=>L});function m(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var h=new Map,S=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(r=>{if(typeof r!="string"){if(r===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof r,"' in the array"))}return!0})},w,_,E,V=(e,t)=>{t=u({caseSensitive:!1},t);let r="s"+(t.caseSensitive?"":"i"),i=e+"|"+r;if(h.has(i))return h.get(i);let s=e[0]==="!";s&&(e=e.slice(1)),e=e.replaceAll(String.raw(w||(w=f(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=m(e).replaceAll(String.raw(_||(_=f(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(E||(E=f(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let n=new RegExp("^".concat(e,"$"),r);return n.negated=s,h.set(i,n),n},F=(e,t,r,i)=>{if(e=S(e,"inputs"),t=S(t,"patterns"),t.length===0)return[];t=t.map(o=>V(o,r));let s=t.filter(o=>o.negated),n=t.filter(o=>!o.negated),{allPatterns:l}=r||{},c=[];if(l&&i&&s.length>1&&n.length===0){for(let o of e)for(let d of s)if(d.test(o))return[];return e.slice(0,1)}for(let o of e){let d=!1;for(let a of s)if(a.test(o)){d=!0;break}if(!d){if(n.length===0)c.push(o);else if(l){let a=Array.from({length:n.length},()=>!1);for(let[y,P]of n.entries())P.test(o)&&(a[y]=!0);a.every(Boolean)&&c.push(o)}else{let a=!1;for(let y of n)if(y.test(o)){a=!0;break}a&&c.push(o)}if(i&&c.length>0)break}}return c};function g(e,t,r){return F(e,t,r,!0).length>0}var k="5.1.3";var L=k,j={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function O(e,t,r){if(!e.length||!t.length)return!1;let i=u(u({},j),r),s=typeof e=="string"?[e]:Array.from(e);return typeof t=="string"?s.some(n=>g(n,t,{caseSensitive:i.caseSensitive})):i.arrayVsArrayAllMustBeFound==="any"?t.some(n=>s.some(l=>g(l,n,{caseSensitive:i.caseSensitive}))):t.every(n=>s.some(l=>g(l,n,{caseSensitive:i.caseSensitive})))}return D(H);})();
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
+ /**
12
+ * @name codsen-utils
13
+ * @fileoverview Various utility functions
14
+ * @version 1.9.0
15
+ * @author Roy Revelt
16
+ * @license MIT
17
+ * {@link https://codsen.com/os/codsen-utils/}
18
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "array-includes-with-glob",
3
- "version": "5.1.3",
3
+ "version": "5.2.1",
4
4
  "description": "Like _.includes but with wildcards",
5
5
  "keywords": [
6
6
  "array",
@@ -38,43 +38,45 @@
38
38
  },
39
39
  "types": "types/index.d.ts",
40
40
  "scripts": {
41
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
42
- "cjs-off": "exit 0",
43
- "cjs-on": "exit 0",
44
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
41
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
42
+ "coverage": "c8 uvu test",
43
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
45
44
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
46
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
45
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
47
46
  "examples": "node '../../ops/scripts/run-examples.js'",
48
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
49
- "letspublish": "npm publish --provenance || :",
50
- "lint": "eslint . --fix --concurrency=auto --cache",
47
+ "lect": "node '../../ops/lect/lect.js'",
48
+ "lect:check": "node '../../ops/lect/lect.js' --check",
49
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
50
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
51
51
  "perf": "node perf/check.js",
52
52
  "prep": "echo 'ready'",
53
- "prettier": "prettier",
54
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
55
- "pretest": "npm run lect && npm run build",
53
+ "prettier": "biome format",
54
+ "prettier:format": "biome format --write .",
55
+ "pretest": "npm run lect:check && npm run build",
56
56
  "test": "npm run devtest",
57
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
57
58
  "unit": "uvu test"
58
59
  },
59
- "engines": {
60
- "node": ">=14.18.0"
61
- },
62
60
  "c8": {
61
+ "all": true,
62
+ "branches": 100,
63
63
  "check-coverage": true,
64
- "exclude": [
65
- "**/test/**/*.*"
66
- ],
67
- "lines": 100
64
+ "exclude": ["**/test/**/*.*"],
65
+ "functions": 100,
66
+ "include": ["dist/*.esm.js"],
67
+ "lines": 100,
68
+ "statements": 100
68
69
  },
69
70
  "lect": {
70
71
  "licence": {
71
- "extras": [
72
- ""
73
- ]
72
+ "extras": [""]
74
73
  }
75
74
  },
76
75
  "dependencies": {
77
- "matcher": "^6.0.0"
76
+ "codsen-utils": "^1.9.0"
77
+ },
78
+ "engines": {
79
+ "node": ">=18.20.8"
78
80
  },
79
81
  "publishConfig": {
80
82
  "registry": "https://registry.npmjs.org/"