You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
316 B
JavaScript

const path = require("path");
const fileUrl = require("file-url");
module.exports = function(viewDirectory, options) {
return function(viewPath) {
let fullPath = path.join(viewDirectory, viewPath);
if (options.extension != null) {
fullPath += `.${options.extension}`;
}
return fileUrl(fullPath);
}
}