1.1.0 โข Published 9 months ago
@sbimochan/pathify v1.1.0
pathify
Generate dot-notated key paths from deeply nested JavaScript objects โ clean, recursive, and zero dependencies.
โจ Features
- ๐ 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
๐ฆ Install
npm install @sbimochan/pathifyTest
npm run testUsage
const input = {
user: {
profile: {
name: '',
age: ''
},
settings: {
theme: ''
}
}
};Expected output
{
user: {
profile: {
name: 'user.profile.name',
age: 'user.profile.age'
},
settings: {
theme: 'user.settings.theme'
}
}
}