1.0.0 • Published 7 years ago

deep-project v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

deep-project

Copy properties off of an object.

usage

const project = require(`deep-project`)

const captains = project(`
  {
    tos {
      captain
    }
    tng {
      captain
    }
  }
`)

const ships = {
  tos: {
    captain: `Kirk`,
    firstOfficer: `Spock`
  },
  tng: {
    captain: `Jean-Luc`,
    firstOfficer: `William`
  }
}

captains(ships)
// {
//   tos: {
//     captain: `Kirk`
//   },
//   tng: {
//     captain: `Jean-Luc`
//   }
// }