UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

6 lines (5 loc) 658 B
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. v3.2.1 */ import{b as i,c as u}from"./OQOKN4KP.js";var y=(n,c,a)=>{let l=i(c),d=new RegExp(l,"i");n.length===0&&console.warn(`No data was passed to the filter function. The data argument should be an array of objects`);let o=(t,f,s)=>{if(t?.constant||t?.filterDisabled)return!0;let r=!1;return u(t,(e,p)=>{typeof e=="function"||e==null||s&&!s.includes(p)||(Array.isArray(e)||typeof e=="object"&&e!==null?o(e,f)&&(r=!0):f.test(e)&&(r=!0))}),r};return n.filter(t=>o(t,d,a))};export{y as a};