mapobj
v1.0.7
Published
map obj
Downloads
5
Readme
use
map a object to another obj, use for api
example
var res = $get('your server url', 'your arg');
// res = {'a': b, 'c': d}
// but you need format to {'k': b, 'c': d}
// fuck back-end who write java
var objmap = require('apimap');
var obj = {};
map = objmap(res, obj, ['c'], true)
map('a', origin => orgin.k)
// ok
objmap(origin, target, proList, acceptEmpty)