boats
Version:
Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.
17 lines (16 loc) • 846 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const tslib_1 = require("tslib");
const upath_1 = tslib_1.__importDefault(require("upath"));
const buildIndexFromPath_1 = tslib_1.__importDefault(require("./utils/buildIndexFromPath"));
function default_1(currentFilePointer, fileName, options, boatsrc) {
const dir = upath_1.default.dirname(currentFilePointer);
const lastSegment = dir.substring(dir.indexOf(options.componentsPath) + options.componentsPath.length);
const fullPath = upath_1.default.normalize(upath_1.default.join(lastSegment, fileName));
return `"#/${options.componentsPath}/${(0, buildIndexFromPath_1.default)({
cleanPath: fullPath,
autoComponentIndexerOptions: {},
enableFancyPluralization: boatsrc.fancyPluralization
})}"`;
}