UNPKG

671 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.staticFile = void 0;
4const trimLeadingSlash = (path) => {
5 if (path.startsWith('/')) {
6 return trimLeadingSlash(path.substr(1));
7 }
8 return path;
9};
10const inner = (path) => {
11 if (typeof window !== 'undefined' && window.remotion_staticBase) {
12 return `${window.remotion_staticBase}/${trimLeadingSlash(path)}`;
13 }
14 return `/${trimLeadingSlash(path)}`;
15};
16const staticFile = (path) => {
17 const preparsed = inner(path);
18 if (!preparsed.startsWith('/')) {
19 return `/${preparsed}`;
20 }
21 return preparsed;
22};
23exports.staticFile = staticFile;