This repository has been archived on 2026-05-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
novarix-networks-homepage/node_modules/next/dist/shared/lib/normalized-asset-prefix.js
T
Kismet Hasanaj 34dc9aec52 .
2026-05-02 20:07:02 +02:00

28 lines
929 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "normalizedAssetPrefix", {
enumerable: true,
get: function() {
return normalizedAssetPrefix;
}
});
function normalizedAssetPrefix(assetPrefix) {
// remove all leading slashes and trailing slashes
const escapedAssetPrefix = assetPrefix?.replace(/^\/+|\/+$/g, '') || false;
// if an assetPrefix was '/', we return empty string
// because it could be an unnecessary trailing slash
if (!escapedAssetPrefix) {
return '';
}
if (URL.canParse(escapedAssetPrefix)) {
const url = new URL(escapedAssetPrefix).toString();
return url.endsWith('/') ? url.slice(0, -1) : url;
}
// assuming assetPrefix here is a pathname-style,
// restore the leading slash
return `/${escapedAssetPrefix}`;
}
//# sourceMappingURL=normalized-asset-prefix.js.map