@typed/content-hash
Version:
Content hash a directory of HTML/JS/CSS files and other static assets
14 lines • 549 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyOrigin = void 0;
const path_1 = require("path");
/**
* Generates an absolute URL given the build directory you're working from,
* the file you're trying to make a change within, the origin you'd like to use,
* and the relative URL you have.
*/
function applyOrigin(buildDirectory, file, origin) {
return new URL(path_1.posix.relative(buildDirectory, file), origin).pathname;
}
exports.applyOrigin = applyOrigin;
//# sourceMappingURL=applyOrigin.js.map