mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-22 18:35:21 -06:00
8 lines
300 B
TypeScript
8 lines
300 B
TypeScript
// Keep the public declaration local so sibling normalization helpers stay private.
|
|
export function expectDefined<T>(value: T | null | undefined, context: string): T {
|
|
if (value === null || value === undefined) {
|
|
throw new Error("expected " + context + " to be defined");
|
|
}
|
|
return value;
|
|
}
|