json-map-keys
v1.0.2
Published
Replace json values with the key path.
Maintainers
Readme
json-map-keys
Replace object values with the full keys path.
Example:
{
"foo": {
"bar": "Bar value",
"baz": {
"qux": 1234
}
}
}Will generate
{
"foo": {
"bar": "foo.bar",
"baz": {
"qux": "foo.baz.qux"
}
}
}Install
npm install json-map-keys --saveUsage
import { jsonMapKeys } from 'json-map-keys'
const data = { a: { b: 'Text Note' } }
// Result { a: { b: 'a.b' } }
const result = mapKeys(data)License
JSON Map Keys © 2020 by Tiago Porto is licensed under MIT License.
