Détail du package

without-undefined-properties

JoshuaKGoldberg33.3kMIT0.1.2

Copies an object without its undefined properties. 🫥

readme

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 Bingo engine.

changelog

0.1.1 (2024-12-20)

Bug Fixes

  • also export withoutUndefinedPropertiesDeep (f001c11)

0.1.0 (2024-12-20)

Features