Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions public-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports.setPublicPath = function setPublicPath(
);
}

let moduleUrl;
var moduleUrl;
try {
moduleUrl = window.System.resolve(systemjsModuleName);
if (!moduleUrl) {
Expand All @@ -47,14 +47,14 @@ function resolveDirectory(urlString, rootDirectoryLevel) {
// https://github.com/single-spa/single-spa/issues/612
// https://gist.github.com/jlong/2428561

const a = document.createElement("a");
var a = document.createElement("a");
a.href = urlString;

const pathname = a.pathname[0] === "/" ? a.pathname : "/" + a.pathname;
let numDirsProcessed = 0,
var pathname = a.pathname[0] === "/" ? a.pathname : "/" + a.pathname;
var numDirsProcessed = 0,
index = pathname.length;
while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {
const char = pathname[--index];
var char = pathname[--index];
if (char === "/") {
numDirsProcessed++;
}
Expand All @@ -71,15 +71,15 @@ function resolveDirectory(urlString, rootDirectoryLevel) {
);
}

const finalPath = pathname.slice(0, index + 1);
var finalPath = pathname.slice(0, index + 1);

return a.protocol + "//" + a.host + finalPath;
}

exports.resolveDirectory = resolveDirectory;

// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js
const isInteger =
var isInteger =
Number.isInteger ||
function isInteger(val) {
return typeof val === "number" && isFinite(val) && Math.floor(val) === val;
Expand Down