1.1.0 โ€ข Published 9 months ago

@sbimochan/pathify v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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/pathify

Test

npm run test

Usage

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'
    }
  }
}
1.1.0

9 months ago

1.0.0

9 months ago