@typed/content-hash
Version:
Content hash a directory of HTML/JS/CSS files and other static assets
10 lines • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHashedPath = void 0;
const function_1 = require("fp-ts/function");
const Option_1 = require("fp-ts/Option");
const getContentHash_1 = require("./getContentHash");
const replaceHash_1 = require("./replaceHash");
const getHashedPath = (document, registry, hashLength) => (0, function_1.pipe)((0, getContentHash_1.getContentHash)(document, registry, hashLength), (0, Option_1.match)(() => document.filePath, (h) => (0, replaceHash_1.replaceHash)(document.filePath, document.fileExtension, h.slice(0, hashLength))));
exports.getHashedPath = getHashedPath;
//# sourceMappingURL=getHashedPath.js.map