Copies an object without its undefined
properties. π«₯
npm i without-undefined-properties
Two functions are exported:
withoutUndefinedProperties
: Copies all of an object's properties except those that areundefined
withoutUndefinedPropertiesDeep
: Copies all of an object's properties except those that areundefined
, recursively
import { withoutUndefinedProperties } from "without-undefined-properties";
// { a: true }
withoutUndefinedProperties({ a: true, b: undefined });
import { withoutUndefinedPropertiesDeep } from "without-undefined-properties";
// { a: true, b: { c: false } }
withoutUndefinedPropertiesDeep({ a: true, b: { c: false, d: undefined } });
See .github/CONTRIBUTING.md
, then .github/DEVELOPMENT.md
.
Thanks! π
Josh Goldberg β¨ π» π π π€ π π§ π π§ |
π This package was templated with
create-typescript-app
using thecreate
engine.