Skip to content

otplib API Documentation / @otplib/core / RequireKeys

Type Alias: RequireKeys<T, K>

RequireKeys<T, K> = Omit<T, K> & Required<Pick<T, K>>

Defined in: packages/core/src/utility-types.ts:75

Helper type to make all properties of T required except those in K

Type Parameters

T

T

K

K extends keyof T

Example

ts
type Options = { a?: string; b?: number; c?: boolean };
type RequiredAB = RequireKeys<Options, 'a' | 'b'>;
// { a: string; b: number; c?: boolean }

Released under the MIT License.