type-fns
Version:
A set of types, type checks, and type guards for simpler, safer, and easier to read code.
13 lines (12 loc) • 296 B
TypeScript
/**
* asserts that an object has a uuid
*/
export type HasUuid<T> = T & {
uuid: string;
};
/**
* checks whether not an object that may have a uuid does have the uuid, at runtime
*/
export declare const hasUuid: <T extends {
uuid?: undefined | string;
}>(obj: T) => obj is HasUuid<T>;