@hyperframes/parsers 0.8.220 → 0.8.222
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/assetResolution.js +2 -1
- package/dist/assets.d.ts +3 -1
- package/dist/assets.js +55 -4
- package/dist/composition.d.ts +1 -1
- package/dist/composition.js +2 -0
- package/dist/compositionContract.d.ts +3 -1
- package/dist/compositionContract.js +2 -0
- package/dist/ffBinaries.d.ts +2 -2
- package/dist/ffBinaries.js +8 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/slideshow.js +4 -0
- package/package.json +2 -2
package/dist/assetResolution.js
CHANGED
|
@@ -122,8 +122,9 @@ import { posix } from "path";
|
|
|
122
122
|
|
|
123
123
|
// src/assetPaths.ts
|
|
124
124
|
import { isAbsolute, relative, resolve } from "path";
|
|
125
|
+
var URL_SCHEME_OF_TWO_OR_MORE_CHARS_RE = /^[a-z][a-z0-9+.-]+:/i;
|
|
125
126
|
function isNonRelativeUrl(val) {
|
|
126
|
-
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/");
|
|
127
|
+
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/") || URL_SCHEME_OF_TWO_OR_MORE_CHARS_RE.test(val);
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
// src/rewriteSubCompPaths.ts
|
package/dist/assets.d.ts
CHANGED
|
@@ -85,4 +85,6 @@ declare function rewriteInlineStyleAssetUrls<T>(elements: Iterable<T>, compSrcPa
|
|
|
85
85
|
*/
|
|
86
86
|
declare function rewriteCssAssetUrls(cssText: string, compSrcPath: string, assetExists?: AssetExists): string;
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
declare function rewriteSrcsetUrls(srcset: string, rewriteUrl: (url: string) => string): string;
|
|
89
|
+
|
|
90
|
+
export { type AssetExists, CSS_URL_RE, PATH_ATTRS, isNonRelativeUrl, isPathInside, rewriteAssetPath, rewriteAssetPaths, rewriteCssAssetUrls, rewriteInlineStyleAssetUrls, rewriteSrcsetUrls };
|
package/dist/assets.js
CHANGED
|
@@ -41,8 +41,9 @@ function decodeCssEscapes(text) {
|
|
|
41
41
|
// src/assetPaths.ts
|
|
42
42
|
var CSS_URL_RE = /\burl\(\s*(["']?)([^)"'\s](?:[^)"']*[^)"'\s])?)\1\s*\)/g;
|
|
43
43
|
var PATH_ATTRS = ["src", "href"];
|
|
44
|
+
var URL_SCHEME_OF_TWO_OR_MORE_CHARS_RE = /^[a-z][a-z0-9+.-]+:/i;
|
|
44
45
|
function isNonRelativeUrl(val) {
|
|
45
|
-
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/");
|
|
46
|
+
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/") || URL_SCHEME_OF_TWO_OR_MORE_CHARS_RE.test(val);
|
|
46
47
|
}
|
|
47
48
|
var LEADING_PARENT_SEGMENT_RE = /^\.\.(?:[\\/]|$)/;
|
|
48
49
|
function isPathInside(childPath, parentPath) {
|
|
@@ -55,6 +56,48 @@ function isPathInside(childPath, parentPath) {
|
|
|
55
56
|
|
|
56
57
|
// src/rewriteSubCompPaths.ts
|
|
57
58
|
import { posix } from "path";
|
|
59
|
+
|
|
60
|
+
// src/srcset.ts
|
|
61
|
+
function skipSrcsetDescriptors(srcset, position) {
|
|
62
|
+
let inParens = false;
|
|
63
|
+
while (position < srcset.length) {
|
|
64
|
+
const char = srcset.charAt(position++);
|
|
65
|
+
if (char === "(") inParens = true;
|
|
66
|
+
else if (char === ")") inParens = false;
|
|
67
|
+
else if (char === "," && !inParens) break;
|
|
68
|
+
}
|
|
69
|
+
return position;
|
|
70
|
+
}
|
|
71
|
+
function readSrcsetUrl(srcset, position) {
|
|
72
|
+
while (position < srcset.length && /[ \t\n\r\f,]/.test(srcset.charAt(position))) position++;
|
|
73
|
+
const start = position;
|
|
74
|
+
while (position < srcset.length && !/[ \t\n\r\f]/.test(srcset.charAt(position))) position++;
|
|
75
|
+
let end = position;
|
|
76
|
+
while (end > start && srcset.charAt(end - 1) === ",") end--;
|
|
77
|
+
return { start, end, next: position };
|
|
78
|
+
}
|
|
79
|
+
function rewriteSrcsetUrls(srcset, rewriteUrl) {
|
|
80
|
+
const parts = [];
|
|
81
|
+
let position = 0;
|
|
82
|
+
let written = 0;
|
|
83
|
+
while (position < srcset.length) {
|
|
84
|
+
const { start, end, next } = readSrcsetUrl(srcset, position);
|
|
85
|
+
position = next;
|
|
86
|
+
if (end > start) {
|
|
87
|
+
const url = srcset.slice(start, end);
|
|
88
|
+
const rewritten = rewriteUrl(url);
|
|
89
|
+
if (rewritten !== url) {
|
|
90
|
+
parts.push(srcset.slice(written, start), rewritten);
|
|
91
|
+
written = end;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (end < position) continue;
|
|
95
|
+
position = skipSrcsetDescriptors(srcset, position);
|
|
96
|
+
}
|
|
97
|
+
return parts.length > 0 ? parts.join("") + srcset.slice(written) : srcset;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/rewriteSubCompPaths.ts
|
|
58
101
|
var { join, resolve: resolve2, dirname } = posix;
|
|
59
102
|
var isAbsoluteOrSpecial = isNonRelativeUrl;
|
|
60
103
|
function needsRewrite(val) {
|
|
@@ -76,11 +119,18 @@ function rewriteAssetPaths(elements, compSrcPath, getAttr, setAttr, assetExists)
|
|
|
76
119
|
for (const el of elements) {
|
|
77
120
|
for (const attr of PATH_ATTRS) {
|
|
78
121
|
const val = (getAttr(el, attr) || "").trim();
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
setAttr(el, attr,
|
|
122
|
+
const rewritten2 = rewriteAssetPath(compSrcPath, val, assetExists);
|
|
123
|
+
if (rewritten2 !== val) {
|
|
124
|
+
setAttr(el, attr, rewritten2);
|
|
82
125
|
}
|
|
83
126
|
}
|
|
127
|
+
const srcset = getAttr(el, "srcset");
|
|
128
|
+
if (!srcset) continue;
|
|
129
|
+
const rewritten = rewriteSrcsetUrls(
|
|
130
|
+
srcset,
|
|
131
|
+
(url) => rewriteAssetPath(compSrcPath, url, assetExists)
|
|
132
|
+
);
|
|
133
|
+
if (rewritten !== srcset) setAttr(el, "srcset", rewritten);
|
|
84
134
|
}
|
|
85
135
|
}
|
|
86
136
|
function rewriteInlineStyleAssetUrls(elements, compSrcPath, getStyle, setStyle, assetExists) {
|
|
@@ -117,5 +167,6 @@ export {
|
|
|
117
167
|
rewriteAssetPaths,
|
|
118
168
|
rewriteCssAssetUrls,
|
|
119
169
|
rewriteInlineStyleAssetUrls,
|
|
170
|
+
rewriteSrcsetUrls,
|
|
120
171
|
splitUrlSuffix
|
|
121
172
|
};
|
package/dist/composition.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as CompositionVariable, F as FontValue, I as ImageValue } from './types-CdT7qqke.js';
|
|
2
2
|
export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, a as CanvasResolution, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, l as FontVariable, m as ImageVariable, K as Keyframe, n as KeyframeProperties, M as MediaElementType, o as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, p as StageZoom, S as StageZoomKeyframe, q as StringVariable, r as TIMELINE_COLORS, s as TimelineCompositionElement, T as TimelineElement, t as TimelineElementBase, u as TimelineElementType, v as TimelineMediaElement, w as TimelineTextElement, x as VALID_CANVAS_RESOLUTIONS, V as ValidationResult, W as WaveformData, y as getDefaultStageZoom, z as isAspectAgnosticResolutionAlias, G as isCompositionElement, H as isMediaElement, J as isTextElement, L as normalizeResolutionFlag, O as resolveResolutionFlagPair } from './types-CdT7qqke.js';
|
|
3
3
|
export { c as decodeUrlPathVariants } from './urlPath-C_0f_-Hp.js';
|
|
4
|
-
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, ClipAttributeReader, ClipAttributeWriter, ClipTiming, ClipTimingDiagnostic, ClipTimingDiagnosticCode, ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, ReadClipTimingOptions, ReferenceExpression, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming } from './compositionContract.js';
|
|
4
|
+
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, ClipAttributeReader, ClipAttributeWriter, ClipTiming, ClipTimingDiagnostic, ClipTimingDiagnosticCode, ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, ReadClipTimingOptions, ReferenceExpression, SPLIT_BOUNDARY_EPSILON_S, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming } from './compositionContract.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Browser-safe parser for the `data-composition-variables` schema attribute.
|
package/dist/composition.js
CHANGED
|
@@ -390,6 +390,7 @@ function scanVariableUsage(scriptText) {
|
|
|
390
390
|
|
|
391
391
|
// src/compositionContract.ts
|
|
392
392
|
var COMPOSITION_CONTRACT_VERSION = 1;
|
|
393
|
+
var SPLIT_BOUNDARY_EPSILON_S = 0.03;
|
|
393
394
|
var COMPOSITION_ATTRIBUTES = Object.freeze({
|
|
394
395
|
start: "data-start",
|
|
395
396
|
duration: "data-duration",
|
|
@@ -873,6 +874,7 @@ export {
|
|
|
873
874
|
HTML_BODY_CSS_HEIGHT_FIRST_RE,
|
|
874
875
|
HTML_BODY_CSS_WIDTH_FIRST_RE,
|
|
875
876
|
LEGACY_TIMING_ATTRIBUTES,
|
|
877
|
+
SPLIT_BOUNDARY_EPSILON_S,
|
|
876
878
|
TIMELINE_COLORS,
|
|
877
879
|
VALID_CANVAS_RESOLUTIONS,
|
|
878
880
|
VIEWPORT_META_SIZE_RE,
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* accept legacy documents; writers always emit the canonical representation.
|
|
7
7
|
*/
|
|
8
8
|
declare const COMPOSITION_CONTRACT_VERSION: 1;
|
|
9
|
+
/** Least a split leaves either side of its cut (s); timing is written to the ms, so less rounds to a 0-length half. */
|
|
10
|
+
declare const SPLIT_BOUNDARY_EPSILON_S = 0.03;
|
|
9
11
|
declare const COMPOSITION_ATTRIBUTES: Readonly<{
|
|
10
12
|
readonly start: "data-start";
|
|
11
13
|
readonly duration: "data-duration";
|
|
@@ -74,4 +76,4 @@ declare function readClipTiming(attributes: ClipAttributeReader, options?: ReadC
|
|
|
74
76
|
/** Write only canonical authored timing and remove derived/legacy source attributes. */
|
|
75
77
|
declare function writeClipTiming(attributes: ClipAttributeWriter, update: ClipTimingUpdate): ClipTiming;
|
|
76
78
|
|
|
77
|
-
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, type ClipAttributeReader, type ClipAttributeWriter, type ClipTiming, type ClipTimingDiagnostic, type ClipTimingDiagnosticCode, type ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, type ReadClipTimingOptions, type ReferenceExpression, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming };
|
|
79
|
+
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, type ClipAttributeReader, type ClipAttributeWriter, type ClipTiming, type ClipTimingDiagnostic, type ClipTimingDiagnosticCode, type ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, type ReadClipTimingOptions, type ReferenceExpression, SPLIT_BOUNDARY_EPSILON_S, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/compositionContract.ts
|
|
2
2
|
var COMPOSITION_CONTRACT_VERSION = 1;
|
|
3
|
+
var SPLIT_BOUNDARY_EPSILON_S = 0.03;
|
|
3
4
|
var COMPOSITION_ATTRIBUTES = Object.freeze({
|
|
4
5
|
start: "data-start",
|
|
5
6
|
duration: "data-duration",
|
|
@@ -286,6 +287,7 @@ export {
|
|
|
286
287
|
ClipTimingWriteError,
|
|
287
288
|
DERIVED_TIMING_ATTRIBUTES,
|
|
288
289
|
LEGACY_TIMING_ATTRIBUTES,
|
|
290
|
+
SPLIT_BOUNDARY_EPSILON_S,
|
|
289
291
|
parseNumeric,
|
|
290
292
|
parseStartExpression,
|
|
291
293
|
readClipTiming,
|
package/dist/ffBinaries.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ declare const FFMPEG_PATH_ENV = "HYPERFRAMES_FFMPEG_PATH";
|
|
|
7
7
|
declare const FFPROBE_PATH_ENV = "HYPERFRAMES_FFPROBE_PATH";
|
|
8
8
|
type FfBinaryName = "ffmpeg" | "ffprobe";
|
|
9
9
|
declare function isX86OnlyMachO(file: string): boolean;
|
|
10
|
-
/** The first x86_64-only binary skipped on this Mac, for naming in the "not found" hint. */
|
|
11
|
-
declare function getSkippedX86Binary(): string | undefined;
|
|
10
|
+
/** The first x86_64-only `name` binary skipped on this Mac, for naming in the "not found" hint. */
|
|
11
|
+
declare function getSkippedX86Binary(name: FfBinaryName): string | undefined;
|
|
12
12
|
interface FindFfBinaryOptions {
|
|
13
13
|
/**
|
|
14
14
|
* How to treat an env override that points at a missing file: `true`
|
package/dist/ffBinaries.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { execFileSync } from "child_process";
|
|
3
3
|
import { accessSync, closeSync, constants, existsSync, openSync, readSync } from "fs";
|
|
4
4
|
import { createRequire } from "module";
|
|
5
|
-
import { delimiter, dirname, join, resolve } from "path";
|
|
5
|
+
import { basename, delimiter, dirname, join, resolve } from "path";
|
|
6
6
|
var FFMPEG_PATH_ENV = "HYPERFRAMES_FFMPEG_PATH";
|
|
7
7
|
var FFPROBE_PATH_ENV = "HYPERFRAMES_FFPROBE_PATH";
|
|
8
8
|
var ENV_BY_NAME = {
|
|
@@ -40,12 +40,13 @@ function runsOnThisMac(candidate) {
|
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
42
|
if (!isX86OnlyMachO(candidate)) return true;
|
|
43
|
-
|
|
43
|
+
const name = basename(candidate);
|
|
44
|
+
if (!skippedX86Binaries.has(name)) skippedX86Binaries.set(name, candidate);
|
|
44
45
|
return false;
|
|
45
46
|
}
|
|
46
|
-
var
|
|
47
|
-
function getSkippedX86Binary() {
|
|
48
|
-
return
|
|
47
|
+
var skippedX86Binaries = /* @__PURE__ */ new Map();
|
|
48
|
+
function getSkippedX86Binary(name) {
|
|
49
|
+
return skippedX86Binaries.get(name);
|
|
49
50
|
}
|
|
50
51
|
function isExecutablePathCandidate(candidate) {
|
|
51
52
|
if (process.platform === "win32") return existsSync(candidate);
|
|
@@ -92,7 +93,7 @@ function binaryFileName(name) {
|
|
|
92
93
|
}
|
|
93
94
|
function findInProjectLocalBin(name) {
|
|
94
95
|
const candidate = resolve(".hyperframes", "bin", binaryFileName(name));
|
|
95
|
-
return existsSync(candidate) ? candidate : void 0;
|
|
96
|
+
return existsSync(candidate) && runsOnThisMac(candidate) ? candidate : void 0;
|
|
96
97
|
}
|
|
97
98
|
function tryResolve(fromFile, request) {
|
|
98
99
|
try {
|
|
@@ -154,7 +155,7 @@ function findFfBinary(name, options = {}) {
|
|
|
154
155
|
function clearFfBinaryLookupCache() {
|
|
155
156
|
pathLookupCache.clear();
|
|
156
157
|
lastMissAt.clear();
|
|
157
|
-
|
|
158
|
+
skippedX86Binaries.clear();
|
|
158
159
|
}
|
|
159
160
|
export {
|
|
160
161
|
FFMPEG_PATH_ENV,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEa
|
|
|
7
7
|
export { parseGsapScriptAcorn as parseGsapScript } from './gsapParserAcorn.js';
|
|
8
8
|
export { EXCLUDED_TAGS, ensureHfIds, isCompositionTemplate, mintHfId, stampHfIdsInPlace, walkCompositionDescendants } from './hfIds.js';
|
|
9
9
|
export { ParsableDocumentLike, SubCompositionValidity, SubCompositionValidityReason, checkSubCompositionUsability, resolveSubCompositionContent } from './subCompositionValidity.js';
|
|
10
|
-
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, ClipAttributeReader, ClipAttributeWriter, ClipTiming, ClipTimingDiagnostic, ClipTimingDiagnosticCode, ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, ReadClipTimingOptions, ReferenceExpression, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming } from './compositionContract.js';
|
|
10
|
+
export { CANONICAL_AUTHORED_TIMING_ATTRIBUTES, COMPOSITION_ATTRIBUTES, COMPOSITION_CONTRACT_VERSION, ClipAttributeReader, ClipAttributeWriter, ClipTiming, ClipTimingDiagnostic, ClipTimingDiagnosticCode, ClipTimingUpdate, ClipTimingWriteError, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, ReadClipTimingOptions, ReferenceExpression, SPLIT_BOUNDARY_EPSILON_S, parseNumeric, parseStartExpression, readClipTiming, writeClipTiming } from './compositionContract.js';
|
|
11
11
|
export { CANONICAL_FONT_DISPLAY_NAMES, FONT_ALIAS_KEYS, FONT_ALIAS_MAP, HTML_BODY_CSS_HEIGHT_FIRST_RE, HTML_BODY_CSS_WIDTH_FIRST_RE, MediaSrcMutation, VIEWPORT_META_SIZE_RE, VariableUsageScan, extractMediaSrcMutations, parseCompositionVariables, resolveAliasDisplayName, scanVariableUsage } from './composition.js';
|
|
12
12
|
export { StructureNode, TrackKind, TrackKindSource, isSubCompositionHost, isTimedElement, topLevelElements, trackKindOf } from './topLevelElements.js';
|
|
13
13
|
export { AttrReader, DEFAULT_IMAGE_TIMELINE_DURATION_SECONDS, MAX_PLAYBACK_RATE, MIN_PLAYBACK_RATE, MediaDurationResult, MediaDurationSource, MediaTag, PENDING_MEDIA_DURATION_READERS, ResolveMediaDurationInput, clampPlaybackRate, readAuthoredDurationSeconds, readDataDurationSeconds, readMediaOffsetSeconds, readPlaybackRate, resolveMediaDuration, resolveNaturalDurationSeconds } from './mediaDuration.js';
|
package/dist/index.js
CHANGED
|
@@ -2687,6 +2687,7 @@ function removeAnimationFromScript(script, animationId) {
|
|
|
2687
2687
|
|
|
2688
2688
|
// src/compositionContract.ts
|
|
2689
2689
|
var COMPOSITION_CONTRACT_VERSION = 1;
|
|
2690
|
+
var SPLIT_BOUNDARY_EPSILON_S = 0.03;
|
|
2690
2691
|
var COMPOSITION_ATTRIBUTES = Object.freeze({
|
|
2691
2692
|
start: "data-start",
|
|
2692
2693
|
duration: "data-duration",
|
|
@@ -4744,6 +4745,7 @@ export {
|
|
|
4744
4745
|
MIN_PLAYBACK_RATE,
|
|
4745
4746
|
PENDING_MEDIA_DURATION_READERS,
|
|
4746
4747
|
PROPERTY_GROUPS,
|
|
4748
|
+
SPLIT_BOUNDARY_EPSILON_S,
|
|
4747
4749
|
SPRING_PRESETS,
|
|
4748
4750
|
SUPPORTED_EASES,
|
|
4749
4751
|
SUPPORTED_PROPS,
|
package/dist/slideshow.js
CHANGED
|
@@ -26,6 +26,9 @@ function parseSlideshowManifest(html) {
|
|
|
26
26
|
function isOptionalNumberArray(v) {
|
|
27
27
|
return v === void 0 || Array.isArray(v) && v.every((n) => typeof n === "number");
|
|
28
28
|
}
|
|
29
|
+
function isOptionalFiniteNumber(v) {
|
|
30
|
+
return v === void 0 || typeof v === "number" && Number.isFinite(v);
|
|
31
|
+
}
|
|
29
32
|
function isOptionalBoolean(v) {
|
|
30
33
|
return v === void 0 || typeof v === "boolean";
|
|
31
34
|
}
|
|
@@ -44,6 +47,7 @@ function isSlideRef(v) {
|
|
|
44
47
|
if (!isRecord(v)) return false;
|
|
45
48
|
const r = v;
|
|
46
49
|
if (typeof r["sceneId"] !== "string") return false;
|
|
50
|
+
if (![r["startTime"], r["endTime"]].every(isOptionalFiniteNumber)) return false;
|
|
47
51
|
if (!isOptionalNumberArray(r["fragments"])) return false;
|
|
48
52
|
if (r["hotspots"] !== void 0 && (!Array.isArray(r["hotspots"]) || !r["hotspots"].every(isSlideHotspot)))
|
|
49
53
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/parsers",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.222",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"tsx": "^4.21.0",
|
|
140
140
|
"typescript": "^5.0.0",
|
|
141
141
|
"vitest": "^4.1.11",
|
|
142
|
-
"@hyperframes/core": "0.8.
|
|
142
|
+
"@hyperframes/core": "0.8.222"
|
|
143
143
|
},
|
|
144
144
|
"scripts": {
|
|
145
145
|
"build": "tsup",
|