# deep-replace

> deep replace objects using property string, regex, fn match

Latest version **0.0.8** (published 2017-04-11) · 0 weekly downloads

## Install

```sh
npm install deep-replace
pnpm add deep-replace
yarn add deep-replace
bun add deep-replace
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2017-04-11 |
| First published | 2017-03-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | James |
| Maintainers | aretecode |
| Keywords | deep, replace, object, obj, fliphub, delete-recursive, delete-reference |

## Links

- npm: https://www.npmjs.com/package/deep-replace
- Repository: https://github.com/fliphub/fliphub
- Homepage: https://github.com/fliphub/fliphub#readme
- Issues: https://github.com/fliphub/fliphub/issues
- npm.io page: https://npm.io/package/deep-replace

## Recent versions

- 0.0.8 (latest) — 2017-04-11
- 0.0.3-alpha.17585ee1 (lerna-temp) — 2017-03-23
- 0.0.7 — 2017-04-06
- 0.0.5 — 2017-03-23
- 0.0.2 — 2017-03-16
- 0.0.1 — 2017-03-16

## README

# 🕳 deep-replace

[![NPM version][deep-replace-npm-image]][deep-replace-npm-url]
[![MIT License][license-image]][license-url]
[![fliphub][gitter-badge]][gitter-url]
[![flipfam][flipfam-image]][flipfam-url]

[deep-replace-npm-image]: https://img.shields.io/npm/v/deep-replace.svg
[deep-replace-npm-url]: https://npmjs.org/package/deep-replace
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: https://spdx.org/licenses/MIT
[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg
[gitter-url]: https://gitter.im/fliphub/Lobby
[flipfam-image]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg
[flipfam-url]: https://www.npmjs.com/package/flipfam

> deep replace objects using property string, regex, fn match

## 📦 usage
```bash
yarn add deep-replace
npm i deep-replace --save
```

```js
const deepReplace = require('deep-replace')
```

## 📘 examples

```js
const {match} = require('deep-replace')

// obj, valueTest, propertyTest, decoratorFn
const fixture = {
  value: 'string',
  nested: {
    again: {
      again: 'string',
      object: {},
      array: [],
    },
  },
}

const valueTest = (value) => typeof value === 'string'
const propertyTest = null
const decorator = ({val, obj, prop}) => {
  obj[prop] = val + ' added me!'
}

match(object, valueTest, propertyTest, decorator)

// comes out as
// fixture.nested.again.again === 'string added me!'
// fixture.value === 'string added me!'

```

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