mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-11-09 15:33:31 +00:00
Preserve renderer state through mute and export transitions, gate hover previews on a composed frame, and align timeline bounds with authored zoom intervals. Improve settings, cursor and webcam controls, inline recording countdown, project recovery and safe library cleanup.
21 lines
668 B
TypeScript
21 lines
668 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
/** Preserve the capture family even when its main file is missing through a folder alias. */
|
|
export async function canonicalSourceReference(source: string): Promise<string> {
|
|
let current = path.resolve(source);
|
|
const missing: string[] = [];
|
|
for (;;) {
|
|
try {
|
|
return path.join(await fs.realpath(current), ...missing);
|
|
} catch (error) {
|
|
if (!["ENOENT", "ENOTDIR"].includes((error as NodeJS.ErrnoException).code ?? ""))
|
|
throw error;
|
|
const parent = path.dirname(current);
|
|
if (parent === current) throw error;
|
|
missing.unshift(path.basename(current));
|
|
current = parent;
|
|
}
|
|
}
|
|
}
|