omit-nil

Creates an object composed of the own and inherited enumerable string keyed properties of object that doesn't null or undefined.

Usage no npm install needed!

<script type="module">
  import omitNil from 'https://cdn.skypack.dev/omit-nil';
</script>

README

omitNil

Creates an object composed of the own and inherited enumerable string keyed properties of object that doesn't null or undefined.

Usage: omitNil<T>(object: T): T

import { omitNil } from 'omit-nil'

omitNil({
  a: null,
  b: `Some value`,
  c: undefined,
  d: false
})
// Output: { b: 'Some value', d: false }

This module exported from utilizes project.