Basic usage

Given two object, returns a new objects with all properties that exist on the second object applied to the first. Works recursively but only for child objects. This is not a merge function. It will not merge child arrays.

import { zip } from 'radash'

const ra = {
  name: 'Ra',
  power: 100,
  culture: {
    region: 'egypt',
    era: '1500 BC'
  }
}

const loki = {
  name: 'Loki',
  power: undefined,
  culture: {
    era: '1500 BC'
  }
}

const hybrid = zip(ra, loki)
// {
//   name: 'Loki',
//   power: 100,
//   culture: {
//     region: 'egypt',
//     era: '1500 BC'
//   }
// }

Testing

This _.zip function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.zip on GitHub.