0.0.3 • Published 2 years ago

recursive-remove v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Recursive remove

CI:UT

Usage

import {recursiveRemove} from 'recursive-remove';

const a = [
  0,
  -0,
  BigInt(0),
  "",
  null,
  undefined,
  NaN,
  false
]
recursiveRemove(
  a,
  {
    removeOption: {
      isFalsy: true,
    },
  },
);
console.log(a) // []
import {recursiveRemove} from 'recursive-remove';

const a = {
  a: 0,
  b: -0,
  c: BigInt(0),
  d: "",
  e: null,
  f: undefined,
  g: NaN,
  h: false,
}
recursiveRemove(
  a,
  {
    removeOption: {
      isFalsy: true,
    },
  },
);
console.log(a) // {}

other examples

Installation

npm install recursive-remove