Start implementation of model relations
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -9,3 +9,12 @@ export type ParameterizedCallback<T> = ((arg: T) => any)
|
||||
|
||||
/** A key-value form of a given type. */
|
||||
export type KeyValue<T> = {key: string, value: T}
|
||||
|
||||
/** Simple helper method to verify that a key is a keyof some object. */
|
||||
export function isKeyof<T>(key: unknown, obj: T): key is keyof T {
|
||||
if ( typeof key !== 'string' && typeof key !== 'symbol' ) {
|
||||
return false
|
||||
}
|
||||
|
||||
return key in obj
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user