frontend client for gemstone. decentralised workplace app
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: enum helper

serenity 752e6e7a 604de1f5

+14
+14
src/lib/utils/types.ts
··· 1 + /** 2 + * If given an object's `typeof`, turns it into an enum-like type. 3 + * e.g. 4 + *```typescript 5 + * const LogLevel = { 6 + * DEBUG: "DEBUG", 7 + * WARNING: "WARNING", 8 + * ERROR: "ERROR", 9 + * } 10 + * type LogLevel = Enumify<typeof LogLevel>; 11 + * ``` 12 + * Which is a better way (imo) of declaring a typescript enum. 13 + */ 14 + export type Enumify<T> = T[keyof T];