MCPcopy Create free account
hub / github.com/denoland/std / assertIsCallbackFunction

Function assertIsCallbackFunction

testing/time.ts:130–139  ·  view source on GitHub ↗
(
  callback: unknown,
  fnName: "setTimeout" | "setInterval",
)

Source from the content-addressed store, hash-verified

128let time: FakeTime | undefined = undefined;
129
130function assertIsCallbackFunction(
131 callback: unknown,
132 fnName: "setTimeout" | "setInterval",
133): asserts callback is (...args: unknown[]) => void {
134 if (typeof callback !== "function") {
135 throw new TimeError(
136 `FakeTime does not support non-function callbacks to ${fnName}`,
137 );
138 }
139}
140
141function fakeSetTimeout(
142 callback: string | ((...args: unknown[]) => unknown),

Callers 2

fakeSetTimeoutFunction · 0.85
fakeSetIntervalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected