@zerocity/define-ensure@0.2.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Type-safe runtime assertions with definable error factories and TypeScript narrowing
default
Type-safe runtime assertions with definable error factories and TypeScript narrowing.
Assert a condition is truthy (tiny-invariant style with inline configuration).
Uses TypeScript's asserts to narrow types based on the condition.
Argument can be message string/function or full options object.
Options for assert with inline configuration.
Constructor type for instanceof checks. Supports no-arg, message-only, and Error-style constructors.
Create an ensure validator with custom configuration.
Return type of defineEnsure.
Ensure a value is not null, undefined, or false.
Second argument can be message or options object.
Error class constructor type.
Type guard for AssertError.
Type guard for EnsureError.
Type guard function returned by defineEnsure.
Message can be a string or lazy function.
Check if Error.captureStackTrace is supported.