@itwin/core-bentley
Version:
Bentley JavaScript core components
23 lines • 1.03 kB
TypeScript
/**
* Expects that a value is defined (not undefined).
* @note Almost always, places that use this function should in the future be cleaned up to properly
* handle undefined values instead of throwing an error.
* @param value The value to check.
* @param message Optional error message to be used in thrown Error.
* @returns The original value if it is defined.
* @throws Error if the value is undefined.
* @internal
*/
export declare function expectDefined<T>(value: T | undefined, message?: string): T;
/**
* Expects that a value is not null.
* @note Almost always, places that use this function should in the future be cleaned up to properly
* handle null values instead of throwing an error.
* @param value The value to check.
* @param message Optional error message to be used in thrown Error.
* @returns The original value if it is not null.
* @throws Error if the value is null.
* @internal
*/
export declare function expectNotNull<T>(value: T | null, message?: string): T;
//# sourceMappingURL=Expect.d.ts.map