MCPcopy Create free account
hub / github.com/Effect-TS/effect / assertDefined

Function assertDefined

packages/vitest/src/utils.ts:227–234  ·  view source on GitHub ↗
(
  a: A | undefined,
  ..._: Array<never>
)

Source from the content-addressed store, hash-verified

225 * @since 4.0.0
226 */
227export function assertDefined<A>(
228 a: A | undefined,
229 ..._: Array<never>
230): asserts a is Exclude<A, undefined> {
231 if (a === undefined) {
232 fail("Expected value to be defined")
233 }
234}
235
236/**
237 * Asserts that `a` is `undefined`.

Callers 1

Calls 1

failFunction · 0.70

Tested by

no test coverage detected