dependency-injection-cat
Version:
DI Cat is a truly clean DI-container, which allows you not to pollute your business logic with decorators from DI/IOC libraries!
18 lines (17 loc) • 659 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeExtensionFromPath = void 0;
var upath_1 = __importDefault(require("upath"));
var lodash_1 = require("lodash");
function removeExtensionFromPath(oldPath) {
var ext = upath_1.default.extname(oldPath);
if (ext === '') {
return oldPath;
}
var regexp = new RegExp((0, lodash_1.escapeRegExp)(ext) + "$", 'g');
return oldPath.replace(regexp, '');
}
exports.removeExtensionFromPath = removeExtensionFromPath;