mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
9 lines
191 B
TypeScript
9 lines
191 B
TypeScript
export function assertExists<TType>(
|
|
v: TType,
|
|
message = `Value does not exist`,
|
|
): asserts v is NonNullable<TType> {
|
|
if (typeof v === 'undefined') {
|
|
throw new Error(message)
|
|
}
|
|
}
|