Skip to content

MapDelete

Since 1.3.0

Delete a key from a type-level map. Returns a new map without the specified key.

Signature

typescript
export type MapDelete<M, K> = Omit<M, K>

Parameters

ParameterDescription
MThe original type-level map
KThe key to delete

Examples

Basic Usage

typescript
import type { MapDelete } from 'uni-types'

type Config = { host: string; port: number; ssl: boolean }
type Result = MapDelete<Config, 'ssl'>
// { host: string; port: number }

Deleting Non-Existent Key

typescript
type Result = MapDelete<Config, 'protocol'>
// { host: string; port: number; ssl: boolean }

Released under the MIT License.