# @f/map

> Map a function over a container of some kind

Latest version **1.5.3** (published 2016-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/map
pnpm add @f/map
yarn add @f/map
bun add @f/map
```

## 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.5.3 |
| Published | 2016-01-27 |
| First published | 2015-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/map
- Repository: https://github.com/micro-js/map
- Homepage: https://github.com/micro-js/map#readme
- Issues: https://github.com/micro-js/map/issues
- npm.io page: https://npm.io/package/@f/map

## Dependencies (8)

- [@f/map-gen](https://npm.io/package/@f/map-gen.md) ^1.6.0
- [@f/map-obj](https://npm.io/package/@f/map-obj.md) ^1.1.2
- [@f/is-array](https://npm.io/package/@f/is-array.md) ^1.0.0
- [@f/is-object](https://npm.io/package/@f/is-object.md) ^1.0.0
- [@f/map-array](https://npm.io/package/@f/map-array.md) ^1.1.0
- [@f/is-functor](https://npm.io/package/@f/is-functor.md) ^1.0.0
- [@f/is-iterator](https://npm.io/package/@f/is-iterator.md) ^1.0.1
- [@f/is-generator](https://npm.io/package/@f/is-generator.md) ^1.3.2

## Recent versions

- 1.5.3 (latest) — 2016-01-27
- 1.5.2 — 2015-12-28
- 1.5.1 — 2015-12-28
- 1.5.0 — 2015-12-28
- 1.4.0 — 2015-12-18
- 1.3.0 — 2015-12-17
- 1.2.4 — 2015-12-17
- 1.2.3 — 2015-12-17
- 1.2.2 — 2015-12-16
- 1.2.1 — 2015-12-16
- 1.2.0 — 2015-12-16

## README

# map

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Map a function over a container of some kind

## Installation

    $ npm install @f/map

## Usage

```js
var map = require('@f/map')

map(add1, [1, 2, 3])          // => [2, 3, 4]
map(add1, {a: 1, b: 2, c: 3}) // => {a: 2, b: 3, c: 4}
map(add1, function * () {yield 1; yield 2; yield 3}) // => function * () {yield 2; yield 3; yield 4}

function add1 (n) {
  return n + 1
}
```

## API

### map(fn, container)

- `fn` - The function to map over val. Accepts `(val, key)` and returns a new `val` to be set at `key`.
- `container` - A container of some kind (objects, arrays, generators or functors).

**Returns:** A new entity of the same type as `container` with all of its values being replaced by the result of `fn(val, key)`.

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/map.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/map
[git-image]: https://img.shields.io/github/tag/micro-js/map.svg
[git-url]: https://github.com/micro-js/map
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/map.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/map

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