Skip to content

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

Notifications You must be signed in to change notification settings

marreman/find-and-apply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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" }]

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published