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

x/ayonli_jsext/workerd/index.ts>Optional

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

Constructs a type by making the specified keys optional.

Examples

Example 1

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

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

type UserPartial = Optional<User, "age">; // { name: string; age?: number; }

Type Parameters

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