MCPcopy Index your code
hub / github.com/TanStack/virtual / notUndefined

Function notUndefined

packages/virtual-core/src/utils.ts:71–77  ·  view source on GitHub ↗
(value: T | undefined, msg?: string)

Source from the content-addressed store, hash-verified

69}
70
71export function notUndefined<T>(value: T | undefined, msg?: string): T {
72 if (value === undefined) {
73 throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ''}`)
74 } else {
75 return value
76 }
77}
78
79export const approxEqual = (a: number, b: number) => Math.abs(a - b) < 1
80

Callers 1

VirtualizerClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected