dnull

Replace null with undefined on any value

Usage no npm install needed!

<script type="module">
  import dnull from 'https://cdn.skypack.dev/dnull';
</script>

README

dnull

Installation

npm install dnull

Usage

import { dnull } from "dnull";

const obj = {
  name: "john",
  address: {
    street: "john's street",
    number: null,
    tags: [1, 2, null, 4],
  },
};

typeof dnull(obj); // { name: "john", address: { street: "john's street", number: undefined, tags: [ 1, 2, undefined, 4 ] } }