turnjson
v1.0.2
Published
JSON对象key值替换,value值替换
Downloads
2
Readme
JSON对象key值替换,value值替换
Input
{
"click": "点击",
"name": "名字"
"name": "name"
}
Output
{
'点击': '点击',
'名字': '名字',
'名字': '名字'
}
Example
const clickMap = {
"click": "点击",
"name": "名字"
}
const source = {
"click": "点击",
"name": "名字"
}
const turn = require('./').turn
const result = turn(source, clickMap)
console.log(result) //{"点击":"点击","名字":"名字"}