How to use the deepdash-es/filterDeep function in deepdash-es

To help you get started, we’ve selected a few deepdash-es examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pangolinjs / core / ui / src / store / index.js View on Github external
filteredComponents (state) {
      if (!state.search) {
        return state.components
      }

      const search = state.search.toLowerCase()
      const options = {
        childrenPath: 'children',
        onTrue: {
          skipChildren: true
        }
      }

      const result = filterDeep(state.components, component => {
        return component.name
          .toLowerCase()
          .includes(search)
      }, options)

      // `filterDeep` returns `null` if nothing has been found,
      // but we need at least an empty array for consistency.
      return result || []
    }
  },

deepdash-es

➔ 𝐃eep extension for 𝐋odash-es: ✓ eachDeep ✓ filterDeep ✓ pickDeep ✓ omitDeep ✓ keysDeep ✓ index ✓ condenseDeep ⋮ Parent nodes tracking ⋮ Circular references check ⋮ Leaves only mode ⋮ Path as a valid js string or an array ⋮

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular deepdash-es functions