cal.pub0.org/packages/lib/isKeyInObject.ts

2 lines
95 B
TypeScript

export const isKeyInObject = <T extends object>(k: PropertyKey, o: T): k is keyof T => k in o;