@glissade/core 0.31.0 → 0.32.0-pre.1
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/dist/targetRef.js +7 -0
- package/package.json +1 -1
package/dist/targetRef.js
CHANGED
|
@@ -882,6 +882,13 @@ function validateTrack(track) {
|
|
|
882
882
|
if (vt.defaultHandoff === "cut") {
|
|
883
883
|
for (const k of track.keys) if (k.interp !== "hold") k.interp = "hold";
|
|
884
884
|
}
|
|
885
|
+
const repr = vt.repr ?? vt.id;
|
|
886
|
+
if (repr === "number" || repr === "vec2") {
|
|
887
|
+
for (const k of track.keys) if (!(repr === "number" ? typeof k.value === "number" && Number.isFinite(k.value) : Array.isArray(k.value) && k.value.length === 2 && k.value.every((n) => typeof n === "number" && Number.isFinite(n)))) {
|
|
888
|
+
const got = typeof k.value === "function" ? "a function (a signal accessor? call it — e.g. node.height(), not node.height)" : typeof k.value === "object" ? JSON.stringify(k.value) : String(k.value);
|
|
889
|
+
throw new TrackValidationError(track.target, `${repr} keyframe at t=${k.t} must be ${repr === "number" ? "a finite number" : "a [x, y] of finite numbers"}, got ${got}`);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
885
892
|
for (let i = 1; i < track.keys.length; i++) {
|
|
886
893
|
const prev = track.keys[i - 1];
|
|
887
894
|
const cur = track.keys[i];
|
package/package.json
CHANGED