Skip to content

JoshuaKGoldberg/without-undefined-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Without Undefined Properties

Copies an object without its undefined properties. πŸ«₯

πŸ‘ͺ All Contributors: 1 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

Usage

npm i without-undefined-properties

Two functions are exported:

  • withoutUndefinedProperties: Copies all of an object's properties except those that are undefined
  • withoutUndefinedPropertiesDeep: Copies all of an object's properties except those that are undefined, recursively

withoutUndefinedProperties

import { withoutUndefinedProperties } from "without-undefined-properties";

// { a: true }
withoutUndefinedProperties({ a: true, b: undefined });

withoutUndefinedPropertiesDeep

import { withoutUndefinedPropertiesDeep } from "without-undefined-properties";

// { a: true, b: { c: false } }
withoutUndefinedPropertiesDeep({ a: true, b: { c: false, d: undefined } });

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ’–

Contributors

Josh Goldberg ✨
Josh Goldberg ✨

πŸ’» πŸ–‹ πŸ“– πŸ€” πŸš‡ 🚧 πŸ“† πŸ”§

πŸ’ This package was templated with create-typescript-app using the create engine.

About

Copies an object without its undefined properties. πŸ«₯

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks