Skip to main content
Module

x/discord_api_types/utils/internals.ts>AddUndefinedToPossiblyUndefinedPropertiesOfInterface

Up to date Discord API Typings, versioned by the API version
Go to Latest
type alias AddUndefinedToPossiblyUndefinedPropertiesOfInterface
import { type AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from "https://deno.land/x/discord_api_types@0.37.2/utils/internals.ts";

Allows support for TS 4.5's exactOptionalPropertyTypes option by ensuring a property present and undefined is valid (since JSON.stringify ignores undefined properties)

definition: [K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ? AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> : AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined