# object-map

> Map a function over some Object's values to produce a new Object.

Latest version **1.0.2** (published 2016-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-map
pnpm add object-map
yarn add object-map
bun add object-map
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-06-21 |
| First published | 2013-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/object-map) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | xixixao |
| Maintainers | xixixao |
| Keywords | object, map, functional |

## Links

- npm: https://www.npmjs.com/package/object-map
- Repository: https://github.com/xixixao/object-map
- Issues: https://github.com/xixixao/object-map/issues
- npm.io page: https://npm.io/package/object-map

## Recent versions

- 1.0.2 (latest) — 2016-06-21
- 1.0.1 — 2015-10-27
- 1.0.0 — 2015-10-27
- 0.0.0 — 2013-10-20

## README

Map a function over the values of an Object to produce a new Object with the same keys.

The API is modelled after the native [Array#map](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method.

## Installation
```bash
$ npm install --save object-map
```

## Example
```js
var objectMap = require('object-map');

var target = {
  foo: 1,
  bar: 2
};

var result = objectMap(target, function(value) {
  return value * value;
});
// => {foo: 1, bar: 4}
```

## API

`objectMap(target, callback[, thisArg])`

- `target` an object who's properties are iterated using `hasOwnProperty`
- `callback` a function producing a value of the new Object, taking three arguments:
  - `currentValue` the value currently associated with the key
  - `key` the current key
  - `object` the original object passed to `objectMap`
- `thisArg` Optional. Value to use as `this` when executing `callback`.

## License
[MIT](https://tldrlegal.com/license/mit-license)

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