Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/interfaces/AllowedNames.ts
1028 views
1
type FilterFlags<Base, Condition> = {
2
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;
3
};
4
5
type FilterOutFlags<Base, Condition> = {
6
[Key in keyof Base]: Base[Key] extends Condition ? never : Key;
7
};
8
9
type OnlyProperties<Base> = FilterOutFlags<Base, (...args: any[]) => any>[keyof Base];
10
type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base];
11
12
export { FilterOutFlags, FilterFlags, AllowedNames, OnlyProperties };
13
14