1.0.0 • Published 5 years ago

proxy-mapper v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

proxy and map object

Installation

npm i proxy-map -S

Examples

use

const source = { name: 'proxy-map', greetWords: 'hello'}
const target = {}

ProxyMap.mapProperties(target, source, ['name'])
ProxyMap(target, source, {
  description: {
    get: function(s) { return s.greetWords + ', I\'am ' + this.name },
  }}
)

console.log(target)
console.log(target.description)
target:

{
  name: "proxy-map",
  description: "hello, I'am proxy-map"
}
1.0.0

5 years ago