Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

find-and-apply

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-and-apply

Recursively search any json structure and make changes at a certain leaf

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

find-and-apply

Recursively search any json structure and make changes at a certain leaf.

Install

npm install find-and-apply

Use

const { findAndApply, isObject } = require("find-and-apply")

findAndApply([
  { foo: "bar" },
  { foo: "baz" }
], candidate => (
  isObject(candidate) && candidate.foo === "baz"
), hit => ({
  foo: "banana"
}))

// [{ foo: "bar" }, { foo: "banana" }]

FAQs

Package last updated on 26 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts