UNPKG

@adyen/kyc-components

Version:

`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar

20 lines (19 loc) 1.27 kB
interface RecursiveKeyOfOptions { readonly includePartialPaths?: boolean; } export type RecursiveKeyOf<TObj extends object, Options extends RecursiveKeyOfOptions = { includePartialPaths: false; }> = { [TKey in keyof TObj & (string | number)]: RecursiveKeyOfHandleValue<TObj[TKey], `${TKey}`, Options>; }[keyof TObj & (string | number)]; type RecursiveKeyOfInner<TObj extends object, Options extends RecursiveKeyOfOptions> = { [TKey in keyof TObj & (string | number)]: RecursiveKeyOfHandleValue<TObj[TKey], `.${TKey}`, Options>; }[keyof TObj & (string | number)]; type RecursiveKeyOfHandleValue<TValue, Text extends string, Options extends RecursiveKeyOfOptions> = TValue extends any[] ? Text : TValue extends object ? `${Text}${RecursiveKeyOfInner<TValue, Options>}` | (Options['includePartialPaths'] extends true ? Text : never) : Text; /** * @returns A list of only the primitive keys of an object. * Includes those nested within other objects, e.g. `'name.firstName'`. * @param includeUndefined - whether to include properties which are defined but have a value of `undefined`. */ export declare function getNestedPropertyKeys<T extends object>(obj: T, includeUndefined?: boolean, includeFalsy?: boolean): Array<RecursiveKeyOf<T>>; export {};