tsplot
Version:
A CLI and tooling library to plot Typescript project information to different template targets.
19 lines • 705 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.insertBeforeExtension = exports.interpolate = exports.INTERPOLATION_REGEX = void 0;
/** @internal */
exports.INTERPOLATION_REGEX = /\${([^}]+)}/g;
/** @internal */
function interpolate(str, values) {
return str.replace(exports.INTERPOLATION_REGEX, (_, match) => {
var _a;
return (_a = values[match]) !== null && _a !== void 0 ? _a : match;
});
}
exports.interpolate = interpolate;
/** @internal */
function insertBeforeExtension(pathStr, str) {
return pathStr.replace(/(\.\w+$)/, `.${str}$1`);
}
exports.insertBeforeExtension = insertBeforeExtension;
//# sourceMappingURL=interpolation.js.map
;