@typed/content-hash
Version:
Content hash a directory of HTML/JS/CSS files and other static assets
23 lines • 879 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createReadFilePath = void 0;
const FxEnv_1 = require("@typed/fp/FxEnv");
const Option_1 = require("fp-ts/Option");
const logging_1 = require("../application/services/logging");
function createReadFilePath(plugins) {
return function readFilePath(filePath) {
const eff = (0, FxEnv_1.Do)(function* (_) {
yield* _((0, logging_1.debug)(`Reading ${filePath}...`));
for (const plugin of plugins) {
const document = yield* _(plugin.readFilePath(filePath));
if ((0, Option_1.isSome)(document)) {
return document;
}
}
return Option_1.none;
});
return eff;
};
}
exports.createReadFilePath = createReadFilePath;
//# sourceMappingURL=createReadFilePath.js.map