0.2.2 • Published 1 year ago

visit-json v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

visit-json.js

npm latest package Test

import visitJson, { REMOVE } from "visit-json"
// or
import * as json from "visit-json"
const { visit: visitJson, REMOVE } = json

const object = {
  a: {
    b: [
      2,
      "3",
    ],
  },
}
const newObject = visitJson(object, value => {
  if (typeof value === "number") {
    return value + 2
  }

  return REMOVE
})

console.log(newObject)
// {
//   a: {
//     b: [
//       4,
//     ],
//   },
// }
0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago