MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / getRelativeUrlFromDocument

Function getRelativeUrlFromDocument

packages/vite/src/bridge/build.ts:28–33  ·  view source on GitHub ↗
(relativePath: string, umd = false)

Source from the content-addressed store, hash-verified

26const getResolveUrl = (path: string, URL = 'URL') => `new ${URL}(${path}).href`;
27
28const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
29 getResolveUrl(
30 `'${escapeId(partialEncodeURIPath(relativePath))}', ${
31 umd ? `typeof document === 'undefined' ? location.href : ` : ''
32 }document.currentScript && document.currentScript.src || document.baseURI`
33 );
34
35const getFileUrlFromFullPath = (path: string) => `require('u' + 'rl').pathToFileURL(${path}).href`;
36

Callers 1

build.tsFile · 0.85

Calls 3

partialEncodeURIPathFunction · 0.90
getResolveUrlFunction · 0.85
escapeIdFunction · 0.85

Tested by

no test coverage detected