Personal Site

Add type utilities

vielle.dev b00e30c9 f3cc7307

verified
+10
+10
src/utils.ts
··· 1 + /** 2 + * via: https://www.totaltypescript.com/concepts/the-prettify-helper 3 + */ 4 + export type Prettify<T> = { 5 + [K in keyof T]: T[K]; 6 + } & {}; 7 + 8 + export function isObj(obj: unknown): obj is object { 9 + return typeof obj === "object" && obj !== null; 10 + }