ts-data-forge
Version:
[](https://www.npmjs.com/package/ts-data-forge) [](https://www.npmjs.com/package/ts-data-forge) [;
*
* assert.isTrue(Optional.expectToBe(optionalValue, 'value expected') === 'data');
*
* const expectValue = Optional.expectToBe<string>('missing optional');
*
* assert.throws(() => expectValue(Optional.none), /missing optional/u);
*
* assert.isTrue(expectValue(Optional.some('present')) === 'present');
* ```
*
* @template O The `UnknownOptional` type to unwrap.
* @param optional The `Optional` to unwrap.
* @param message The error message to throw if the `Optional` is
* `None`.
* @returns The contained value if `Some`.
* @throws Error with the provided message if the `Optional` is
* `None`.
*/
export declare function expectToBe<O extends UnknownOptional>(optional: O, message: string): Unwrap<O>;
export declare function expectToBe<S>(message: string): (optional: Optional<S>) => S;
//# sourceMappingURL=optional-expect-to-be.d.mts.map