Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1x 7x 1x 5x | export type AsynchronousFunction = () => Promise<unknown>;
/** @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types#comment123255834_53229567 */
type UnionKeys<T> = T extends T ? keyof T : never;
// Improve intellisense
type Expand<T> = T extends T ? { [K in keyof T]: T[K] } : never;
export type OneOf<T extends object[]> = {
[K in keyof T]: Expand<
T[K] & Partial<Record<Exclude<UnionKeys<T[number]>, keyof T[K]>, never>>
>;
}[number];
export function isUnknown(obj: unknown): obj is unknown {
return true;
}
export function isString(obj: unknown): obj is string {
return typeof obj === 'string';
}
|