How to use the updeep.omitted function in updeep

To help you get started, we’ve selected a few updeep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github substantial / updeep / types / tests.ts View on Github external
// TypeScript Version: 3.2.2
import u from "updeep";

u.omitted('whatever'); // $ExpectType { __omitted: boolean; }

const obj = { this: 3 };

u(true, obj); // $ExpectType true
u(null, obj); // $ExpectType null
u(undefined, obj); // $ExpectType undefined
u("a specific string", obj); // $ExpectType "a specific string"

u(true as const)(obj); // $ExpectType true
u(null)(obj); // $ExpectType null
u(undefined)(obj); // $ExpectType undefined
u("a specific string" as const)(obj); // $ExpectType "a specific string"

const aString = "a" + "b";

u(aString, obj); // $ExpectType string

updeep

Easily update nested frozen objects and arrays in a declarative and immutable manner.

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis