https://github.com/simplyhexagonal/json-expand
A TypeScript library for expanding flat JSON objects into nested structures based on dot-notation keys.
https://github.com/simplyhexagonal/json-expand
Last synced: 11 months ago
JSON representation
A TypeScript library for expanding flat JSON objects into nested structures based on dot-notation keys.
- Host: GitHub
- URL: https://github.com/simplyhexagonal/json-expand
- Owner: simplyhexagonal
- Created: 2023-08-31T18:53:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T23:13:10.000Z (almost 3 years ago)
- Last Synced: 2025-06-06T18:43:00.900Z (about 1 year ago)
- Language: TypeScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @simplyhexagonal/json-expand



A TypeScript library for expanding flat JSON objects into nested structures based on dot-notation keys.
## Usage
```typescript
import expand from '@simplyhexagonal/json-expand';
const input = JSON.stringify({
"en.title": "Hello World",
"en.description": "This is a description"
});
const output = expand(input);
console.log(output);
```
### Output
```json
{
"en": {
"title": "Hello World",
"description": "This is a description"
}
}
```
## Open Source Notice
This project is open to updates by its users. We ensure that PRs are relevant to the community. In other words, if you find a bug or want a new feature, please help us by becoming one of the contributors ✌️! See the contributing section below.
## Like this module? ❤
Please consider:
- [Buying me a coffee](https://www.buymeacoffee.com/jeanlescure) ☕
- Supporting Simply Hexagonal on [Open Collective](https://opencollective.com/simplyhexagonal) 🏆
- Starring this repo on [Github](https://github.com/simplyhexagonal/exec) 🌟
## Contributing
Yes, thank you! This plugin is community-driven, most of its features are from different authors.
Please update the docs and tests and add your name to the `exec.json` file.
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
## License
Copyright (c) 2021-Present [Exec Contributors](https://github.com/simplyhexagonal/exec/#contributors-).
Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).