# objects-utils

> utilities methods on objects

Latest version **1.0.4** (published 2016-06-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install objects-utils
pnpm add objects-utils
yarn add objects-utils
bun add objects-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2016-06-28 |
| First published | 2016-06-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniele Pellegrini |
| Maintainers | danieleplgr84 |
| Keywords | objects, object, keys, maps |

## Links

- npm: https://www.npmjs.com/package/objects-utils
- Repository: https://github.com/danieleplgr84/objects-utils
- Homepage: https://github.com/danieleplgr84/objects-utils#readme
- Issues: https://github.com/danieleplgr84/objects-utils/issues
- npm.io page: https://npm.io/package/objects-utils

## Recent versions

- 1.0.4 (latest) — 2016-06-28
- 1.0.3 — 2016-06-28
- 1.0.2 — 2016-06-23
- 1.0.1 — 2016-06-23
- 1.0.0 — 2016-06-22

## README

# objects-utils 
###### Object's keys manipulation

# Overview
This is a collection of varius methods to manipulate objects in javascript. For now this module has only some methods to manipulates object's keys.

# Use Keys
```js
var objects = require('objects-utils');

// delete all empty keys of an object
var instance = {"a":1, "b": null, "c": 0, "d": {"ab": 45, "cd": null}};
objects.Keys.cleanEmptyKeys(instance);
// now the "b" key has been deleted: {"a":1, "c": 0, "d": {"ab": 45}}


// replace empty keys with a token
var instance = {"a":1, "b": null, "c": 0};
objects.Keys.replaceEmptyKeys(instance, 'MY_TOKEN');
// now the "b" key has been replaced with: {"a":1, "b": "MY_TOKEN", "c": 0}


// apply a specific callback on each key of the object
var instance = {"a":1, "b": null, "c": 0};
objects.Keys.applyOnEmptyKeys(instance, function(instance, fieldName){
	var the_key_value = instance[fieldName];
	// do what you want!
});

```


# Use Maps
```js
var objects = require('objects-utils');

// create list at object key
var map = {"a":1, "b": null, "c": 0, "d": {"ab": 45, "cd": null}};
objects.Maps.createListAtKey(map, "k");


// add item to list at key (create list if not exists)
var map2 = {"a":1, "b": null, "c": 0}; 
objects.Maps.atKeyAddItemToList(map2, 'k');  

```

---
_Source: https://npm.io/package/objects-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
