array-includes-with-glob 4.0.1 → 4.0.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/README.md
CHANGED
|
@@ -32,7 +32,7 @@ This package is ESM only: Node 12+ is needed to use it and it must be imported i
|
|
|
32
32
|
npm i array-includes-with-glob
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
If you need a legacy version which works with require
|
|
35
|
+
If you need a legacy version which works with `require`, use version 3.1.0
|
|
36
36
|
|
|
37
37
|
## Quick Take
|
|
38
38
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 4.0.
|
|
4
|
+
* @version 4.0.2
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-includes-with-glob/}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import matcher from 'matcher';
|
|
11
11
|
|
|
12
|
-
var version$1 = "4.0.
|
|
12
|
+
var version$1 = "4.0.2";
|
|
13
13
|
|
|
14
14
|
const version = version$1;
|
|
15
15
|
const defaults = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 4.0.
|
|
4
|
+
* @version 4.0.2
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-includes-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayIncludesWithGlob={})}(this,(function(e){"use strict";var t={exports:{}};const r=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},n=new Map;function s(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((e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0}))}function o(e,t){t={caseSensitive:!1,...t};const s=e+JSON.stringify(t);if(n.has(s))return n.get(s);const o="!"===e[0];o&&(e=e.slice(1)),e=r(e).replace(/\\\*/g,"[\\s\\S]*");const i=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return i.negated=o,n.set(s,i),i}t.exports=(e,t,r)=>{if(e=s(e,"inputs"),0===(t=s(t,"patterns")).length)return[];const n="!"===t[0][0];t=t.map((e=>o(e,r)));const i=[];for(const r of e){let e=n;for(const n of t)n.test(r)&&(e=!n.negated);e&&i.push(r)}return i},t.exports.isMatch=(e,t,r)=>(e=s(e,"inputs"),0!==(t=s(t,"patterns")).length&&e.some((e=>t.every((t=>{const n=o(t,r),s=n.test(e);return n.negated?!s:s})))));var i=t.exports;const a={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};e.defaults=a,e.includesWithGlob=function(e,t,r){if(!e.length||!t.length)return!1;const n={...a,...r},s="string"==typeof e?[e]:Array.from(e);return"string"==typeof t?s.some((e=>i.isMatch(e,t,{caseSensitive:n.caseSensitive}))):"any"===n.arrayVsArrayAllMustBeFound?t.some((e=>s.some((t=>i.isMatch(t,e,{caseSensitive:n.caseSensitive}))))):t.every((e=>s.some((t=>i.isMatch(t,e,{caseSensitive:n.caseSensitive})))))},e.version="4.0.
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayIncludesWithGlob={})}(this,(function(e){"use strict";var t={exports:{}};const r=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},n=new Map;function s(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((e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0}))}function o(e,t){t={caseSensitive:!1,...t};const s=e+JSON.stringify(t);if(n.has(s))return n.get(s);const o="!"===e[0];o&&(e=e.slice(1)),e=r(e).replace(/\\\*/g,"[\\s\\S]*");const i=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return i.negated=o,n.set(s,i),i}t.exports=(e,t,r)=>{if(e=s(e,"inputs"),0===(t=s(t,"patterns")).length)return[];const n="!"===t[0][0];t=t.map((e=>o(e,r)));const i=[];for(const r of e){let e=n;for(const n of t)n.test(r)&&(e=!n.negated);e&&i.push(r)}return i},t.exports.isMatch=(e,t,r)=>(e=s(e,"inputs"),0!==(t=s(t,"patterns")).length&&e.some((e=>t.every((t=>{const n=o(t,r),s=n.test(e);return n.negated?!s:s})))));var i=t.exports;const a={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};e.defaults=a,e.includesWithGlob=function(e,t,r){if(!e.length||!t.length)return!1;const n={...a,...r},s="string"==typeof e?[e]:Array.from(e);return"string"==typeof t?s.some((e=>i.isMatch(e,t,{caseSensitive:n.caseSensitive}))):"any"===n.arrayVsArrayAllMustBeFound?t.some((e=>s.some((t=>i.isMatch(t,e,{caseSensitive:n.caseSensitive}))))):t.every((e=>s.some((t=>i.isMatch(t,e,{caseSensitive:n.caseSensitive})))))},e.version="4.0.2",Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "array-includes-with-glob",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Like _.includes but with wildcards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"core-js": "^3.17.3",
|
|
114
114
|
"cross-env": "^7.0.3",
|
|
115
115
|
"eslint": "^7.32.0",
|
|
116
|
-
"lect": "^0.18.
|
|
116
|
+
"lect": "^0.18.2",
|
|
117
117
|
"rollup": "^2.56.3",
|
|
118
118
|
"rollup-plugin-ascii": "^0.0.3",
|
|
119
119
|
"rollup-plugin-banner": "^0.2.1",
|