Skip to main content
Module

x/enzastdlib/collections/object.ts>OmitValues

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
type alias OmitValues
import { type OmitValues } from "https://deno.land/x/enzastdlib@v0.0.4/collections/object.ts";

Returns an Object where members with the given type are omitted from a new Object type.

Examples

Example 1

import type { OmitValues } from 'https://deno.land/x/enzastdlib/collections/mod.ts';

const MY_CONSTANT_OBJECT = {
    myBoolean: false,

    myNumber: 42,

    myString: 'Hello World',

    otherNumber: 84,
} as const;

type FilteredValues = OmitValues<typeof MY_CONSTANT_OBJECT, number>; // `{ readonly myBoolean: false; readonly myString: "Hello World"; }`
definition: [Key in keyof Objin keyof Obj[Key] extends Value ? never : Key]: Obj[Key]