@hyperframes/parsers 0.9.95 → 0.9.97
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/ffBinaries.js +10 -6
- package/dist/mediaTiming.d.ts +2 -1
- package/dist/mediaTiming.js +6 -1
- package/package.json +2 -2
package/dist/ffBinaries.js
CHANGED
|
@@ -95,9 +95,13 @@ function pathEntries(pathValue, platform = process.platform) {
|
|
|
95
95
|
function windowsFolderKey(dir) {
|
|
96
96
|
return dir.replaceAll("/", "\\").replace(/\\+$/, "").toLowerCase();
|
|
97
97
|
}
|
|
98
|
+
function readEnv(name, env = process.env, platform = process.platform) {
|
|
99
|
+
if (platform !== "win32") return env[name];
|
|
100
|
+
const key = Object.keys(env).find((candidate) => candidate.toUpperCase() === name);
|
|
101
|
+
return key === void 0 ? void 0 : env[key];
|
|
102
|
+
}
|
|
98
103
|
function windowsSystemFolders(env) {
|
|
99
|
-
const
|
|
100
|
-
const root = rootKey && env[rootKey] || "C:\\Windows";
|
|
104
|
+
const root = readEnv("SYSTEMROOT", env, "win32") || "C:\\Windows";
|
|
101
105
|
const system32 = win32.join(root, "System32");
|
|
102
106
|
return new Set(
|
|
103
107
|
[
|
|
@@ -108,14 +112,14 @@ function windowsSystemFolders(env) {
|
|
|
108
112
|
].map(windowsFolderKey)
|
|
109
113
|
);
|
|
110
114
|
}
|
|
111
|
-
function trustedPathDirs(pathValue
|
|
115
|
+
function trustedPathDirs(pathValue, platform = process.platform, env = process.env) {
|
|
112
116
|
const system = platform === "win32" ? windowsSystemFolders(env) : /* @__PURE__ */ new Set();
|
|
113
|
-
const entries = pathEntries(pathValue, platform);
|
|
117
|
+
const entries = pathEntries(pathValue ?? readEnv("PATH", env, platform) ?? "", platform);
|
|
114
118
|
const trusted = trustRule();
|
|
115
119
|
return [...new Set(entries.filter((dir) => system.has(windowsFolderKey(dir)) || trusted(dir)))];
|
|
116
120
|
}
|
|
117
121
|
function windowsExtensions() {
|
|
118
|
-
const listed = (
|
|
122
|
+
const listed = (readEnv("PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((ext) => ext.trim().toLowerCase()).filter(Boolean);
|
|
119
123
|
return [.../* @__PURE__ */ new Set([".exe", ...listed])];
|
|
120
124
|
}
|
|
121
125
|
function isExecutableFile(file) {
|
|
@@ -219,7 +223,7 @@ function scanPath(name) {
|
|
|
219
223
|
const extensions = process.platform === "win32" ? [
|
|
220
224
|
".exe",
|
|
221
225
|
...new Set(
|
|
222
|
-
(
|
|
226
|
+
(readEnv("PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((ext) => ext.trim().toLowerCase()).filter(Boolean)
|
|
223
227
|
),
|
|
224
228
|
""
|
|
225
229
|
] : [""];
|
package/dist/mediaTiming.d.ts
CHANGED
|
@@ -36,5 +36,6 @@ declare function cutToHostSlots(span: {
|
|
|
36
36
|
start: number;
|
|
37
37
|
end: number;
|
|
38
38
|
};
|
|
39
|
+
declare function wrapLoopedSourceTime(target: number, mediaStart: number, sourceDuration: number): number;
|
|
39
40
|
|
|
40
|
-
export { type HostSlot, MEDIA_START_BASIS_ATTR, type MediaStartBasis, type MediaStartInput, compositionOriginSeconds, cutToHostSlots, hostInPointSeconds, isRootGlobalMediaStart, readMediaStartBasis, resolveAbsoluteMediaStartSeconds, resolveMediaStartSeconds };
|
|
41
|
+
export { type HostSlot, MEDIA_START_BASIS_ATTR, type MediaStartBasis, type MediaStartInput, compositionOriginSeconds, cutToHostSlots, hostInPointSeconds, isRootGlobalMediaStart, readMediaStartBasis, resolveAbsoluteMediaStartSeconds, resolveMediaStartSeconds, wrapLoopedSourceTime };
|
package/dist/mediaTiming.js
CHANGED
|
@@ -67,6 +67,10 @@ function cutToHostSlots(span, hosts) {
|
|
|
67
67
|
return { start, end: Math.max(start, Math.min(kept.end, host.end)) };
|
|
68
68
|
}, span);
|
|
69
69
|
}
|
|
70
|
+
function wrapLoopedSourceTime(target, mediaStart, sourceDuration) {
|
|
71
|
+
const loopLength = sourceDuration - mediaStart;
|
|
72
|
+
return loopLength > 0 && target >= sourceDuration ? mediaStart + (target - mediaStart) % loopLength : target;
|
|
73
|
+
}
|
|
70
74
|
export {
|
|
71
75
|
MEDIA_START_BASIS_ATTR,
|
|
72
76
|
compositionOriginSeconds,
|
|
@@ -75,5 +79,6 @@ export {
|
|
|
75
79
|
isRootGlobalMediaStart,
|
|
76
80
|
readMediaStartBasis,
|
|
77
81
|
resolveAbsoluteMediaStartSeconds,
|
|
78
|
-
resolveMediaStartSeconds
|
|
82
|
+
resolveMediaStartSeconds,
|
|
83
|
+
wrapLoopedSourceTime
|
|
79
84
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/parsers",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.97",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"tsx": "^4.21.0",
|
|
156
156
|
"typescript": "^5.0.0",
|
|
157
157
|
"vitest": "^4.1.12",
|
|
158
|
-
"@hyperframes/core": "0.9.
|
|
158
|
+
"@hyperframes/core": "0.9.97"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "tsup",
|