@empreintes/pathmap
v0.0.4
Published
Give a dotted path, return the value somewhere in a json object
Downloads
3
Readme
PathMap
return value somewhere in a json object, from a dotted string path
Getting Started
This script target nodejs environment
npm install @empreintes/pathmath
# or
yarn add @empreintes/pathmath
const { PathMap } = require("@empreintes/pathmap")
const data = {
data: [
{
id: 47179,
stuff: {
id: 2
}
}
...
]
foo : {
bar : true
}
}
const pathMap = new PathMap(data)
pathMap.path("data#0.stuff.id") // 2
pathMap.path("data#0.id") // 47179
pathMap.path("foo.bar") // true
Licence
released under the MIT license.
Versioning
Semantic Versioning for versioning.
Authors
Acknowledgments
- This is a side project of a side project of a side project (for real)
- Use in production only if you know what you do.
- Extend Map Object for personal choice.