object-value-to-object-path
v1.0.0
Published
Replace json values with the key path.
Maintainers
Readme
object-value-to-object-path
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
Install with npm:
npm install object-value-to-object-pathInstall with deno(jsr):
deno add jsr:@tiagoporto/object-value-to-object-pathUsage
import { objectValueToObjectPath } from 'object-value-to-object-path'
const data = { a: { b: 'Text Note' } }
// Result { a: { b: 'a.b' } }
const result = objectValueToObjectPath(data)License
Object Value to Object Path © 2020 by Tiago Porto is licensed under MIT License.
