# change-name-of-all-keys

> Change names of all keys and subkeys given a hash table

Latest version **1.0.3** (published 2018-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install change-name-of-all-keys
pnpm add change-name-of-all-keys
yarn add change-name-of-all-keys
bun add change-name-of-all-keys
```

## 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.3 |
| Published | 2018-09-05 |
| First published | 2018-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fabio Espinosa |
| Maintainers | fabioespinosa |

## Links

- npm: https://www.npmjs.com/package/change-name-of-all-keys
- npm.io page: https://npm.io/package/change-name-of-all-keys

## Recent versions

- 1.0.3 (latest) — 2018-09-05
- 1.0.2 — 2018-08-31
- 1.0.1 — 2018-08-31
- 1.0.0 — 2018-08-31

## README

# change-name-of-all-keys

> Change the key name of all attributes of an object given a hash, children as well (handy utility)

## Install

```
$ npm install change-name-of-all-keys
```

## Usage

```js
const changeNameOfAllKeys = require('change-name-of-all-keys');

const original_object = {
    '>': 23,
    and: {
        '>': 44,
        '<': 46,
        or: {
            like: 'bye',
            notlike: 'hello'
        }
    }
};

const hash = {
    or: 'Op.or',
    and: 'Op.and',
    '>': 'Op.gt',
    '<': 'Op.lt',
    '>=': 'Op.gte',
    '<=': 'Op.lte',
    like: 'Op.like',
    notlike: 'Op.notLike',
    '=': 'Op.eq',
    '<>': 'Op.n'
};

const resulting_object = appendToAllAttributes(original_object, hash);
console.log(resulting_object);
//=>
{
    'Op.gt': 23,
    'Op.and': {
        'Op.gt': 44,
        'Op.lt': 46,
        'Op.or': {
            'Op.like': 'bye',
            'Op.notLike': 'hello'
        }
    }
};
```

## License

MIT © [Fabio Espinosa](http://fabioespinosa.mit.edu)

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