How to use for-own - 2 common examples

To help you get started, we’ve selected a few for-own 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 hjkcai / vue-modal-dialogs / src / util.js View on Github external
function copy (target, current) {
    forOwn(current, function (value, key) {
      var val = target[key]
      // add the missing property, or allow a null property to be updated
      if (val == null) {
        target[key] = value
      } else if (isObject(val) && isObject(value)) {
        target[key] = defaultsDeep(val, value)
      }
    })
  }
github tinajs / tina / src / adapters / data / sigmund.js View on Github external
constructor (plain) {
    each(plain, (value, key) => {
      this[key] = value
    })

    Object.defineProperty(this, '__signatures', {
      enumerable: false,
      writable: true,
    })

    this.sign()
  }

for-own

Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.

MIT
Latest version published 8 years ago

Package Health Score

68 / 100
Full package analysis

Popular for-own functions