diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 084167d..d8a16af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,6 +59,8 @@ Contributions are more than welcome! Thanks! :sweat_smile: + + [1]: https://github.com/IonicaBizau/obj-unflatten/issues -[2]: https://github.com/IonicaBizau/code-style \ No newline at end of file +[2]: https://github.com/IonicaBizau/code-style diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md new file mode 100644 index 0000000..ba9f5a4 --- /dev/null +++ b/DOCUMENTATION.md @@ -0,0 +1,14 @@ +## Documentation + +You can see below the API reference of this module. + +### `unflattenObject(flatten, separator)` +Convert flatten objects in nested ones. + +#### Params +- **Object** `flatten`: The flatten object that should be converted. +- **Object** `separator`: The field separator (default: `"."`). + +#### Return +- **Object** Unflatten object + diff --git a/README.md b/README.md index 24cec51..e47e6f3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ + # obj-unflatten [![PayPal](https://img.shields.io/badge/%24-paypal-f39c12.svg)][paypal-donations] [![Version](https://img.shields.io/npm/v/obj-unflatten.svg)](https://www.npmjs.com/package/obj-unflatten) [![Downloads](https://img.shields.io/npm/dt/obj-unflatten.svg)](https://www.npmjs.com/package/obj-unflatten) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) > Convert flatten objects in nested ones. -## Installation +## :cloud: Installation ```sh $ npm i --save obj-unflatten ``` -## Example + +## :clipboard: Example + + ```js const unflatten = require("obj-unflatten"); @@ -29,7 +33,8 @@ console.log(unflatten({ // { name: { first: 'Johnny', last: 'B.' }, age: 20 } ``` -## Documentation +## :memo: Documentation + ### `unflattenObject(flatten, separator)` Convert flatten objects in nested ones. @@ -41,17 +46,18 @@ Convert flatten objects in nested ones. #### Return - **Object** Unflatten object -## How to contribute -Have an idea? Found a bug? See [how to contribute][contributing]. -## Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: -## Related +## :yum: How to contribute +Have an idea? Found a bug? See [how to contribute][contributing]. + +## :sparkles: Related - [`obj-flatten`](https://github.com/IonicaBizau/obj-flatten) – Convert nested objects in flatten ones. -## License + + +## :scroll: License [MIT][license] © [Ionică Bizău][website] @@ -61,4 +67,4 @@ If you are using this library in one of your projects, add it in this list. :spa [license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2016#license-mit [website]: http://ionicabizau.net [contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md \ No newline at end of file +[docs]: /DOCUMENTATION.md