MCPcopy Index your code
hub / github.com/oakserver/oak / assert

Function assert

testing.ts:142–156  ·  view source on GitHub ↗
(
      condition: any,
      errorStatus: ErrorStatus = 500,
      message?: string,
      props?: Record<string, unknown>,
    )

Source from the content-addressed store, hash-verified

140 response,
141 state: Object.assign({}, app.state),
142 assert(
143 condition: any,
144 errorStatus: ErrorStatus = 500,
145 message?: string,
146 props?: Record<string, unknown>,
147 ): asserts condition {
148 if (condition) {
149 return;
150 }
151 const err = createHttpError(errorStatus, message);
152 if (props) {
153 Object.assign(err, props);
154 }
155 throw err;
156 },
157 throw(
158 errorStatus: ErrorStatus,
159 message?: string,

Callers 15

fnFunction · 0.90
fnFunction · 0.90
fnFunction · 0.90
fnFunction · 0.90
middlewareMethod · 0.90
allowedMethodsMethod · 0.90
fnFunction · 0.90
fnFunction · 0.90
fnFunction · 0.90
#handleRequestMethod · 0.90
ApplicationClass · 0.90
fnFunction · 0.90

Calls

no outgoing calls

Tested by 15

fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72
jsonBodyReviverFunction · 0.72
jsonBodyReplacerFunction · 0.72
fnFunction · 0.72
fnFunction · 0.72