MCPcopy Create free account
hub / github.com/arktypeio/arktype / getThrownMessage

Function getThrownMessage

ark/attest/assert/assertions.ts:282–294  ·  view source on GitHub ↗
(
	result: AssertedFnCallResult,
	ctx: AssertionContext
)

Source from the content-addressed store, hash-verified

280 threw?: string
281}
282export const getThrownMessage = (
283 result: AssertedFnCallResult,
284 ctx: AssertionContext
285): string | undefined => {
286 if (!("threw" in result)) {
287 throwAssertionError({
288 message: "Function didn't throw",
289 stack: ctx.assertionStack
290 })
291 }
292
293 return result.threw
294}
295export const callAssertedFunction = (
296 asserted: Function
297): AssertedFnCallResult => {

Callers 2

throwsMethod · 0.90
throwsAndHasTypeErrorMethod · 0.90

Calls 1

throwAssertionErrorFunction · 0.85

Tested by

no test coverage detected