@tanstack/virtual-core 3.0.0-beta.41 → 3.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/index.esm.js +5 -15
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +6 -14
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +5 -15
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/utils.d.ts +2 -0
- package/build/lib/utils.esm.js +11 -1
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +12 -0
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +11 -1
- package/build/lib/utils.mjs.map +1 -1
- package/build/umd/index.development.js +15 -13
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -17
- package/src/utils.ts +10 -0
package/src/utils.ts
CHANGED
|
@@ -69,3 +69,13 @@ export function memo<
|
|
|
69
69
|
return result!
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
export function notUndefined<T>(value: T | undefined, msg?: string): T {
|
|
74
|
+
if (value === undefined) {
|
|
75
|
+
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ''}`)
|
|
76
|
+
} else {
|
|
77
|
+
return value
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const approxEqual = (a: number, b: number) => Math.abs(a - b) < 1
|