array-includes-with-glob 5.0.2 → 5.0.4
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,10 +3,6 @@
|
|
|
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.0.2](https://github.com/codsen/codsen/compare/array-includes-with-glob@5.0.1...array-includes-with-glob@5.0.2) (2022-12-06)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package array-includes-with-glob
|
|
9
|
-
|
|
10
6
|
## 5.0.0 (2022-12-01)
|
|
11
7
|
|
|
12
8
|
### BREAKING CHANGES
|
|
@@ -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.4
|
|
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 d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var p=new Map,y=(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(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},m=(e,t)=>{t={caseSensitive:!1,...t};let r=e+JSON.stringify(t);if(p.has(r))return p.get(r);let s=e[0]==="!";s&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let n=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return n.negated=s,p.set(r,n),n},h=(e,t,r,s)=>{if(e=y(e,"inputs"),t=y(t,"patterns"),t.length===0)return[];t=t.map(o=>m(o,r));let{allPatterns:n}=r||{},i=[];for(let o of e){let c,f=[...t].fill(!1);for(let[a,l]of t.entries())if(l.test(o)&&(f[a]=!0,c=!l.negated,!c))break;if(!(c===!1||c===void 0&&t.some(a=>!a.negated)||n&&f.some((a,l)=>!a&&!t[l].negated))&&(i.push(o),s))break}return i};function u(e,t,r){return h(e,t,r,!0).length>0}var g="5.0.
|
|
10
|
+
function d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var p=new Map,y=(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(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},m=(e,t)=>{t={caseSensitive:!1,...t};let r=e+JSON.stringify(t);if(p.has(r))return p.get(r);let s=e[0]==="!";s&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let n=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return n.negated=s,p.set(r,n),n},h=(e,t,r,s)=>{if(e=y(e,"inputs"),t=y(t,"patterns"),t.length===0)return[];t=t.map(o=>m(o,r));let{allPatterns:n}=r||{},i=[];for(let o of e){let c,f=[...t].fill(!1);for(let[a,l]of t.entries())if(l.test(o)&&(f[a]=!0,c=!l.negated,!c))break;if(!(c===!1||c===void 0&&t.some(a=>!a.negated)||n&&f.some((a,l)=>!a&&!t[l].negated))&&(i.push(o),s))break}return i};function u(e,t,r){return h(e,t,r,!0).length>0}var g="5.0.4";var E=g,b={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function M(e,t,r){if(!e.length||!t.length)return!1;let s={...b,...r},n=typeof e=="string"?[e]:Array.from(e);return typeof t=="string"?n.some(i=>u(i,t,{caseSensitive:s.caseSensitive})):s.arrayVsArrayAllMustBeFound==="any"?t.some(i=>n.some(o=>u(o,i,{caseSensitive:s.caseSensitive}))):t.every(i=>n.some(o=>u(o,i,{caseSensitive:s.caseSensitive})))}export{b as defaults,M as includesWithGlob,E 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.4
|
|
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 d=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var h=(t,e,r)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>{for(var r in e||(e={}))x.call(e,r)&&h(t,r,e[r]);if(m)for(var r of m(e))k.call(e,r)&&h(t,r,e[r]);return t};var A=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},E=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of j(e))!x.call(t,s)&&s!==r&&d(t,s,{get:()=>e[s],enumerable:!(n=S(e,s))||n.enumerable});return t};var M=t=>E(d({},"__esModule",{value:!0}),t);var B={};A(B,{defaults:()=>w,includesWithGlob:()=>V,version:()=>F});function f(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var y=new Map,b=(t,e)=>{if(!Array.isArray(t))switch(typeof t){case"string":t=[t];break;case"undefined":t=[];break;default:throw new TypeError(`Expected '${e}' to be a string or an array, but got a type of '${typeof t}'`)}return t.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${e}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},$=(t,e)=>{e=c({caseSensitive:!1},e);let r=t+JSON.stringify(e);if(y.has(r))return y.get(r);let n=t[0]==="!";n&&(t=t.slice(1)),t=f(t).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${t}$`,e.caseSensitive?"":"i");return s.negated=n,y.set(r,s),s},R=(t,e,r,n)=>{if(t=b(t,"inputs"),e=b(e,"patterns"),e.length===0)return[];e=e.map(o=>$(o,r));let{allPatterns:s}=r||{},i=[];for(let o of t){let l,g=[...e].fill(!1);for(let[a,u]of e.entries())if(u.test(o)&&(g[a]=!0,l=!u.negated,!l))break;if(!(l===!1||l===void 0&&e.some(a=>!a.negated)||s&&g.some((a,u)=>!a&&!e[u].negated))&&(i.push(o),n))break}return i};function p(t,e,r){return R(t,e,r,!0).length>0}var v="5.0.
|
|
10
|
+
"use strict";var arrayIncludesWithGlob=(()=>{var d=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var h=(t,e,r)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>{for(var r in e||(e={}))x.call(e,r)&&h(t,r,e[r]);if(m)for(var r of m(e))k.call(e,r)&&h(t,r,e[r]);return t};var A=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},E=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of j(e))!x.call(t,s)&&s!==r&&d(t,s,{get:()=>e[s],enumerable:!(n=S(e,s))||n.enumerable});return t};var M=t=>E(d({},"__esModule",{value:!0}),t);var B={};A(B,{defaults:()=>w,includesWithGlob:()=>V,version:()=>F});function f(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var y=new Map,b=(t,e)=>{if(!Array.isArray(t))switch(typeof t){case"string":t=[t];break;case"undefined":t=[];break;default:throw new TypeError(`Expected '${e}' to be a string or an array, but got a type of '${typeof t}'`)}return t.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${e}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},$=(t,e)=>{e=c({caseSensitive:!1},e);let r=t+JSON.stringify(e);if(y.has(r))return y.get(r);let n=t[0]==="!";n&&(t=t.slice(1)),t=f(t).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${t}$`,e.caseSensitive?"":"i");return s.negated=n,y.set(r,s),s},R=(t,e,r,n)=>{if(t=b(t,"inputs"),e=b(e,"patterns"),e.length===0)return[];e=e.map(o=>$(o,r));let{allPatterns:s}=r||{},i=[];for(let o of t){let l,g=[...e].fill(!1);for(let[a,u]of e.entries())if(u.test(o)&&(g[a]=!0,l=!u.negated,!l))break;if(!(l===!1||l===void 0&&e.some(a=>!a.negated)||s&&g.some((a,u)=>!a&&!e[u].negated))&&(i.push(o),n))break}return i};function p(t,e,r){return R(t,e,r,!0).length>0}var v="5.0.4";var F=v,w={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function V(t,e,r){if(!t.length||!e.length)return!1;let n=c(c({},w),r),s=typeof t=="string"?[t]:Array.from(t);return typeof e=="string"?s.some(i=>p(i,e,{caseSensitive:n.caseSensitive})):n.arrayVsArrayAllMustBeFound==="any"?e.some(i=>s.some(o=>p(o,i,{caseSensitive:n.caseSensitive}))):e.every(i=>s.some(o=>p(o,i,{caseSensitive:n.caseSensitive})))}return M(B);})();
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
File without changes
|