This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------------------- */ | |
/* Implementation ------------------ */ | |
/* --------------------------------- */ | |
type Class<A extends any[] = [], T = {}> = new (...args: A) => T; | |
type StaticProps<T> = T extends Class<any, infer I> | |
? Omit<T, "prototype" | "constructor"> & { prototype: I } | |
: never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type NotFunction = | |
| string | |
| number | |
| boolean | |
| null | |
| undefined | |
| bigint | |
| readonly any[] | |
| { apply?: never; [k: string]: any } | |
| { call?: never; [k: string]: any }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function flattenObject( | |
obj: object, | |
opts: { | |
prefix?: string; | |
postfix?: string; | |
delimiter?: string; | |
wordExtractor?: (text: string) => string[]; | |
} | |
) { | |
const flattened: Record<string, any> = {}; |