MCPcopy
hub / github.com/directus/directus / importFileUrl

Function importFileUrl

api/src/utils/import-file-url.ts:9–11  ·  view source on GitHub ↗
(url: string, root: string, options: ImportOptions = {})

Source from the content-addressed store, hash-verified

7}
8
9export function importFileUrl(url: string, root: string, options: ImportOptions = {}): Promise<any> {
10 return import(`./${pathToRelativeUrl(url, dirname(fileURLToPath(root)))}${options.fresh ? `?t=${Date.now()}` : ''}`);
11}

Callers 4

registerHookExtensionMethod · 0.85

Calls 2

pathToRelativeUrlFunction · 0.90
dirnameFunction · 0.85

Tested by

no test coverage detected