Update utils.ts

This commit is contained in:
ITOH
2021-05-01 23:37:26 +02:00
parent 95fdb6b064
commit 9ff0c2c693
+1 -1
View File
@@ -208,7 +208,7 @@ export function validateSlashCommands(
// Typescript is not so good as we developers so we need this little utility function to help it out // Typescript is not so good as we developers so we need this little utility function to help it out
// Taken from https://fettblog.eu/typescript-hasownproperty/ // Taken from https://fettblog.eu/typescript-hasownproperty/
/** TS save way to check if a property exists in an object */ /** TS save way to check if a property exists in an object */
export function hasOwnProperty<T extends {}, Y extends PropertyKey>( export function hasOwnProperty<T extends {}, Y extends PropertyKey = string>(
obj: T, obj: T,
prop: Y, prop: Y,
): obj is T & Record<Y, unknown> { ): obj is T & Record<Y, unknown> {