1.0.7 • Published 2 years ago
empty-strings-nuller v1.0.7
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");