flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
29
VISUALIZACION/node_modules/parcel-bundler/src/builtins/bundle-url.js
generated
vendored
Executable file
29
VISUALIZACION/node_modules/parcel-bundler/src/builtins/bundle-url.js
generated
vendored
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
var bundleURL = null;
|
||||
function getBundleURLCached() {
|
||||
if (!bundleURL) {
|
||||
bundleURL = getBundleURL();
|
||||
}
|
||||
|
||||
return bundleURL;
|
||||
}
|
||||
|
||||
function getBundleURL() {
|
||||
// Attempt to find the URL of the current script and use that as the base URL
|
||||
try {
|
||||
throw new Error;
|
||||
} catch (err) {
|
||||
var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g);
|
||||
if (matches) {
|
||||
return getBaseURL(matches[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return '/';
|
||||
}
|
||||
|
||||
function getBaseURL(url) {
|
||||
return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/';
|
||||
}
|
||||
|
||||
exports.getBundleURL = getBundleURLCached;
|
||||
exports.getBaseURL = getBaseURL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue