How to use just-filter-object - 4 common examples

To help you get started, we’ve selected a few just-filter-object 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 tinajs / tina / src / translators / ant / component.js View on Github external
* }
     */
    if (!('type' in prop)) {
      return prop()
    }
    /**
     * properties: {
     *   foo: {
     *     type: String,
     *   },
     * }
     */
    return 'value' in prop ? prop.value : prop.type()
  })

  let observers = map(filter(properties, (key, prop) => {
    return 'observer' in prop
  }), (key, prop) => {
    return prop.observer
  })

  properties = map(properties, (key, value) => {
    if (!('type' in value)) {
      return {
        type: value,
        value: value(),
        observer () {},
      }
    }
    return Object.assign({
    }, value)
  })
github tinajs / tina / src / adapters / data / plain.js View on Github external
static diff (original, extra) {
    return filter(original, (key, value) => value !== extra[key])
  }
github tinajs / tina / src / adapters / data / sigmund.js View on Github external
static diff (original, extra) {
    return new SigmundData(filter(original, (key, value) => value !== extra[key] || original.signature(key) !== extra.signature(key)))
  }
github tinajs / tina / src / utils / helpers.js View on Github external
return () => {
    let { isData, fromPlainObject, merge } = adapter
    data = isData(data) ? data : fromPlainObject(clone(data))
    if (typeof properties === 'object') {
      let defaults = fromPlainObject(
        map(
          filter(
            properties,
            (name, property) => typeof property === 'object' && typeof property.value !== 'undefined',
          ),
          (name, property) => property.value,
        ),
      )
      data = merge(data, defaults)
    }
    return data
  }
}

just-filter-object

filter an object

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular just-filter-object functions