1.0.0 • Published 5 years ago
@mxstrive/proxy-mapper v1.0.0
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