# anonymous-object-handler

> A package containing functions that handles object strucutres and perform operations without knowing the object properties

Latest version **1.1.1** (published 2019-06-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install anonymous-object-handler
pnpm add anonymous-object-handler
yarn add anonymous-object-handler
bun add anonymous-object-handler
```

## 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.1.1 |
| Published | 2019-06-10 |
| First published | 2019-06-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | MDA |
| Maintainers | mdhaker |
| Keywords | js-object, mongo-query, object-handler, object-mapper, object-properties, object-values, assign-deep, object-assign |

## Links

- npm: https://www.npmjs.com/package/anonymous-object-handler
- Repository: https://github.com/Mdhaker/object-handler
- Homepage: https://github.com/Mdhaker/object-handler#readme
- Issues: https://github.com/Mdhaker/object-handler/issues
- npm.io page: https://npm.io/package/anonymous-object-handler

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2019-06-10
- 1.1.0 — 2019-06-07
- 1.0.0 — 2019-06-02

## README

# Object handler

> This package is made to handle JS objects without knowing their structure, you perform actions such assign, getting and setting values without knowing their paths.

[![1.1.1][npm-image]][npm-url]

## Install

```bash
npm i anonymous-object-handler
```

## Usage

```javascript
var aoh = require('anonymous-object-handler');
let obj = {
   "key1":{
      "key11":{
         "key111":"foo",
         "key112":"bar"
      },
      "key12":"lorem"
   },
   "key2":"value2",
   "key3":"value3"
};

aoh.getValueByPath(obj,"key1.key11.key112")  // returns "bar"

aoh.setValueBypath(obj,"key1.key11.key113.key1131","baz"); 
/** return
{
   "key1":{
      "key11":{
         "key111":"foo",
         "key112":"bar",
         "key113" : {
             "key1131" : "baz"
         }
      },
      "key12":"lorem"
   },
   "key2":"value2",
   "key3":"value3"
};
**/
let obj2 = {
   "key1":{
      "key11":{
         "key111":"foo",
         "key112":"baz",
         "key113" : {
             "key1131" : {"key11311":"value11311"}
         }
      }
};

aoh.deepAssign(obj,obj2);
/** return
{
   "key1":{
      "key11":{
         "key111":"foo",
         "key112":"baz",
         "key113" : {
             "key1131" : {"key11311":"value11311"}
         }
      },
      "key12":"lorem"
   },
   "key2":"value2",
   "key3":"value3"
};
**/

/** This is the key function to all the package **/

aoh.mapObject(obj);
/** return
{
   "key1.key11.key111":"foo",
   "key1.key11.key112":"bar",
    "key1.key12":"lorem",
    "key2":"value2",
    "key3":"value3"
};
**/
aoh.unMapObject(obj);
/**
return the same obj structure mentioned before
**/

```

## License

[MIT](http://vjpr.mit-license.org)

[npm-image]: https://camo.githubusercontent.com/0fe7b138152a3825e7516c850de315512f6052ae/68747470733a2f2f63646e2e737667706f726e2e636f6d2f6c6f676f732f737761676765722e737667
[npm-url]: https://www.npmjs.com/package/anonymous-object-handler

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