Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/windmill/node_modules/tsafe/lab/withDefaults.d.ts>withDefaults

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
function withDefaults
import { withDefaults } from "https://deno.land/x/windmill@v1.96.3/node_modules/tsafe/lab/withDefaults.d.ts";

Like Function.prototype.bind() but for a function that receives their parameters wrapped in an object. See documentation for more details: https://docs.tsafe.dev/withdefaults

Type Parameters

Params extends Record<string, unknown>
DefaultKey extends keyof Params
R

Parameters

f: (params: Params) => R
defaultParams: keyof Params extends never ? Record<string, never> : [Key in DefaultKey]: Params[Key]

Returns

(params: [Key in keyof Omit<Params, DefaultKey>]: Params[Key] & { defaultsOverwrite?: [Key in DefaultKey]?: [Params[Key]]; }) => R