array-includes-with-glob 5.0.12 → 5.0.22
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.22
|
|
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
|
-
import{isMatch as o}from"matcher";var l="5.0.
|
|
10
|
+
import{isMatch as o}from"matcher";var l="5.0.22";var y=l,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,{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};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.22
|
|
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
|
-
"use strict";var arrayIncludesWithGlob=(()=>{var
|
|
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:a}=r||{},c=[];if(a&&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 l of s)if(l.test(o)){d=!0;break}if(!d){if(n.length===0)c.push(o);else if(a){let l=Array.from({length:n.length},()=>!1);for(let[y,P]of n.entries())P.test(o)&&(l[y]=!0);l.every(Boolean)&&c.push(o)}else{let l=!1;for(let y of n)if(y.test(o)){l=!0;break}l&&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.0.22";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(a=>g(a,n,{caseSensitive:i.caseSensitive}))):t.every(n=>s.some(a=>g(a,n,{caseSensitive:i.caseSensitive})))}return D(H);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "array-includes-with-glob",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.22",
|
|
4
4
|
"description": "Like _.includes but with wildcards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
|
|
47
47
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
48
48
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
49
|
-
"letspublish": "npm publish || :",
|
|
49
|
+
"letspublish": "npm publish --provenance || :",
|
|
50
50
|
"lint": "eslint . --fix",
|
|
51
51
|
"perf": "node perf/check.js",
|
|
52
52
|
"prep": "echo 'ready'",
|
|
@@ -74,6 +74,9 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"matcher": "^
|
|
77
|
+
"matcher": "^6.0.0"
|
|
78
|
+
},
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"registry": "https://registry.npmjs.org/"
|
|
78
81
|
}
|
|
79
82
|
}
|
package/types/index.d.ts
CHANGED