empty-strings-nuller
v1.0.7
Published
Replaces object empty strings with null
Downloads
2
Readme
Empty Strings Nuller
Replaces all fields with empty string in object with null
:
const obj = { a: "a", b: "" };
nullEmptyStrings(obj); // => { a: "a", b: null }
Works also on nested objects or objects in array.
Installation
$ npm i empty-strings-nuller
Import
Use in a stadard way:
import nullEmptyStrings from "empty-strings-nuller";
or
const nullEmptyStrings = require("empty-strings-nuller");