Skip to content

Commit

Permalink
📚
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Feb 17, 2016
1 parent 3298271 commit 3809480
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -6,7 +6,7 @@ make the life easier and will avoid wasting time on things which are not
requested. :sparkles:

## Discuss the changes before doing them
- First of all, open an issue in the repository, using the bug tracker ,
- First of all, open an issue in the repository, using the [bug tracker][1],
describing the contribution you would like to make, the bug you found or any
other ideas you have. This will help us to get you started on the right
foot.
Expand Down Expand Up @@ -59,4 +59,6 @@ Contributions are more than welcome!

Thanks! :sweat_smile:

[1]: https://github.com/IonicaBizau/obj-unflatten/issues

[2]: https://github.com/IonicaBizau/code-style
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
64 changes: 64 additions & 0 deletions README.md
@@ -0,0 +1,64 @@
# 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

```sh
$ npm i --save obj-unflatten
```

## Example

```js
const unflatten = require("obj-unflatten");

console.log(unflatten({
"name.first": "Johnny"
, "name.last": "B."
, age: 20
}));
// { name: { first: 'Johnny', last: 'B.' }, age: 20 }

// Custom separator
console.log(unflatten({
"name-first": "Johnny"
, "name-last": "B."
, age: 20
}, "-"));
// { name: { first: 'Johnny', last: 'B.' }, age: 20 }
```

## Documentation

### `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

## 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

- [`obj-flatten`](https://github.com/IonicaBizau/obj-flatten) – Convert nested objects in flatten ones.

## License

[MIT][license] © [Ionică Bizău][website]

[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
[donate-now]: http://i.imgur.com/6cMbHOC.png

[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

0 comments on commit 3809480

Please sign in to comment.