A lightweight utility that recursively walks through a nested JavaScript object and replaces all leaf values with their corresponding dot-notation paths.
npm install @sbimochan/pathify> Generate dot-notated key paths from deeply nested JavaScript objects โ clean, recursive, and zero dependencies.
---
- ๐ Recursively walks any nested object
- ๐ Replaces all leaf values with their full dot-notation paths
- ๐งผ Preserves original object structure
- ๐ชถ Lightweight โ no dependencies
- โ๏ธ Optional base path prefix
---
``bash`
npm install @sbimochan/pathify
`bash`
npm run test
`javascript`
const input = {
user: {
profile: {
name: '',
age: ''
},
settings: {
theme: ''
}
}
};
`javascript``
{
user: {
profile: {
name: 'user.profile.name',
age: 'user.profile.age'
},
settings: {
theme: 'user.settings.theme'
}
}
}