Copies an object without its undefined properties. ๐ซฅ
npm install without-undefined-properties
Copies an object without its undefined properties.
๐ซฅ
``shell`
npm i without-undefined-properties
Two functions are exported:
- withoutUndefinedProperties: Copies all of an object's properties except those that are undefinedwithoutUndefinedPropertiesDeep
- : Copies all of an object's properties except those that are undefined, recursively
`ts
import { withoutUndefinedProperties } from "without-undefined-properties";
// { a: true }
withoutUndefinedProperties({ a: true, b: undefined });
`
`ts
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 the Bingo engine.