Function: assertNonEmptyString()
ts
function assertNonEmptyString(
value: Nillable<string>,
format?: string, ...
rest: AnyArgs): asserts value is string;Assertion function to ensure provided value is a non-empty string.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
value | Nillable<string> | undefined | Value to check. |
format | string | "Type assertion failed, expected non-empty string value." | Optional C-like formatted string for interpolation. |
...rest | AnyArgs | undefined | Rest parameters to interpolate into format string. |
Returns
asserts value is string
Remarks
@inline keeps the happy path as a local if check and avoids a function call at runtime.