# set-each

> Set value to path's in object. value can be a function (with three arguments: currentValue, path, object) that invoked for the specific path. When value is function, the return value from it is set for the current path. if the return value is undefined

Latest version **1.2.4** (published 2021-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install set-each
pnpm add set-each
yarn add set-each
bun add set-each
```

## 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.2.4 |
| Published | 2021-05-31 |
| First published | 2019-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 53.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Natan Farkash |
| Maintainers | natqe3 |
| Keywords | set, each, set-each, each-set |

## Links

- npm: https://www.npmjs.com/package/set-each
- Repository: https://github.com/natqe/utilizes
- Homepage: https://github.com/natqe/utilizes#readme
- Issues: https://github.com/natqe/utilizes/issues
- npm.io page: https://npm.io/package/set-each

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2021-05-31
- 1.2.3 — 2020-02-18
- 1.2.2 — 2019-09-19
- 1.2.1 — 2019-08-06
- 1.2.0 — 2019-06-12
- 1.1.10 — 2019-06-07
- 1.1.9 — 2019-05-23
- 1.1.8 — 2019-01-20
- 1.1.6 — 2019-01-20
- 1.1.4 — 2019-01-19
- 1.1.3 — 2019-01-15
- 1.1.2 — 2019-01-15
- 1.1.0 — 2019-01-15
- 1.0.12 — 2019-01-15
- 1.0.5 — 2019-01-14
- … 4 more at https://npm.io/package/set-each/versions

## README

# setEach

Set value to path's in object. value can be a function (with three arguments: currentValue, path, object) that invoked for the specific path.

When value is function, the return value from it is set for the current path. if the return value is undefined, the current path is skipped.

this method is for multiple objects.

**Usage:** `setEach<T extends object>(object: []T, value: any, ...paths: Many<string | number | symbol>[]): []T`

```typescript
import { setEach } from 'set-each'

const obs = [
   {
    prop: 1
   },
   {
     prop: 1
   }
]

setEach(ob, 2, 'prop')
// Output:  [
//    {
//     prop: 2
//    },
//    {
//      prop: 2
//    }
// ]
```

<!-- *keywords [] *keywordsend -->


This module exported from [utilizes](https://www.npmjs.com/package/utilizes) project.

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