Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/workerd/index.ts>Ensured

A JavaScript extension package for building strong and modern applications.
Latest
type alias Ensured
import { type Ensured } from "https://deno.land/x/ayonli_jsext@v0.9.72/workerd/index.ts";

Constructs a type by ensuring the specified keys are required.

Examples

Example 1

import { Ensured } from "@ayonli/jsext/types";

interface User {
    name: string;
    age?: number;
}

type UserRequired = Ensured<User, "age">; // { name: string; age: number; }

Type Parameters

T
K extends keyof T
definition: Required<Pick<T, K>> & Omit<T, K>