explaingit

joshuakgoldberg/without-undefined-properties

Analysis updated 2026-07-08 · repo last pushed 2026-07-07

4TypeScriptAudience · developerComplexity · 1/5ActiveSetup · easy

TLDR

A tiny TypeScript utility that removes undefined properties from objects, either at the top level or recursively through nested objects, giving you clean data without empty fields.

Mindmap

mindmap
  root((repo))
    What it does
      Strips undefined properties
      Top level or deep
      Returns clean copy
    Tech stack
      TypeScript
      Node.js
      npm package
    Use cases
      Clean API payloads
      Tidy config objects
      Sanitize form data
    Audience
      TypeScript developers
      API builders
      Library authors
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Strip undefined fields from API request payloads before sending to a frontend or third-party service.

USE CASE 2

Clean up configuration objects so they only contain properties with actual values.

USE CASE 3

Sanitize form data objects to remove undefined entries before processing or storage.

What is it built with?

TypeScriptNode.jsnpm

How does it compare?

joshuakgoldberg/without-undefined-properties0labs-in/vision-linkarviahq/arvia
Stars444
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-07-07
MaintenanceActive
Setup difficultyeasymoderatemoderate
Complexity1/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install from npm and import the two functions directly into any TypeScript or Node.js project.

In plain English

Without Undefined Properties is a small TypeScript utility that does exactly what its name says: it takes an object and gives you back a copy with all the undefined properties stripped out. This is handy because in JavaScript, objects often end up with properties that exist but have no value set, and sometimes you want a clean version of that object without those empty fields cluttering things up. The package provides two functions. The first, withoutUndefinedProperties, handles just the top level of an object, so if you have { a: true, b: undefined }, you get back { a: true }. The second, withoutUndefinedPropertiesDeep, does the same thing but works recursively, meaning it also cleans up undefined values inside nested objects. So { a: true, b: { c: false, d: undefined } } becomes { a: true, b: { c: false } }. Who would use this? Think of a developer building an API that sends data to a frontend or a third-party service. If the request body includes fields that are undefined, it can cause confusion or errors on the receiving end. Running the data through one of these functions before sending it means the payload only contains fields that actually have values. Same goes for configuration objects, form data, or anything where you want a tidy object without placeholder undefined values lurking in it. The project is written in strict TypeScript and is available on npm, so it's easy to install in any Node.js or TypeScript project. The README is quite minimal, it covers the two functions with brief examples and points to contribution guidelines, but doesn't elaborate much beyond that. It's a focused, single-purpose tool rather than a broad utility library.

Copy-paste prompts

Prompt 1
Write a TypeScript function that takes a user object and uses withoutUndefinedPropertiesDeep to remove any undefined fields before sending it as a JSON API response.
Prompt 2
Install withoutUndefinedProperties from npm and create a utility that cleans up a config object recursively before passing it to a database connection initializer.
Prompt 3
Refactor my existing API middleware to use withoutUndefinedProperties on the request body so undefined fields are stripped before validation runs.

Frequently asked questions

What is without-undefined-properties?

A tiny TypeScript utility that removes undefined properties from objects, either at the top level or recursively through nested objects, giving you clean data without empty fields.

What language is without-undefined-properties written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, npm.

Is without-undefined-properties actively maintained?

Active — commit in last 30 days (last push 2026-07-07).

How hard is without-undefined-properties to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is without-undefined-properties for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.