UNPKG

counterfact

Version:

Generate a TypeScript-based mock server from an OpenAPI spec in seconds — with stateful routes, hot reload, and REPL support.

16 lines (14 loc) 568 B
/** * A unique symbol used as a brand for the `COUNTERFACT_RESPONSE` type. * This prevents arbitrary objects from being accidentally treated as a * completed response value. */ const counterfactResponse = Symbol("Counterfact Response"); /** * The terminal value type returned by the fluent response builder once all * required fields (body, headers, etc.) have been provided. When a route * handler returns this type, Counterfact treats the response as complete. */ export type COUNTERFACT_RESPONSE = { [counterfactResponse]: typeof counterfactResponse; };