An open API service indexing awesome lists of open source software.

https://github.com/danibram/object-cleaner

A little function to clean dirty arrays inside objects
https://github.com/danibram/object-cleaner

Last synced: 2 months ago
JSON representation

A little function to clean dirty arrays inside objects

Awesome Lists containing this project

README

        

# object-cleaner [![Dependency Status](https://david-dm.org/danibram/object-cleaner.svg)](https://david-dm.org/danibram/object-cleaner)

A little function to clean dirty Objects, find any array with lenght one and and put his content without array.

## Getting Started
Install the module with: `npm install object-cleaner`

```javascript
var objCleaner = new require('object-cleaner');
objCleaner(Object_to_clean); // Object_cleaned
```

## Examples

```javascript
var test = [{
property1: '',
property2: ''
}];
var result = objCleaner(test);
var result = {
property1: '',
property2: ''
};
```

## License
Copyright (c) 2014 Daniel Biedma Ramos
Licensed under the MIT license.