mirror of
https://github.com/ente-io/ente.git
synced 2025-05-28 13:37:58 +00:00
8 lines
206 B
TypeScript
8 lines
206 B
TypeScript
/**
|
|
* Throw an exception if the given value is undefined.
|
|
*/
|
|
export const ensure = <T>(v: T | undefined): T => {
|
|
if (v === undefined) throw new Error("Required value was not found");
|
|
return v;
|
|
};
|