UNPKG

arch-unit-ts

Version:
28 lines 837 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RelativePath = void 0; const typeScriptPath = require("path"); const Assert_1 = require("../../../error/domain/Assert"); class RelativePath { path; constructor(path) { Assert_1.Assert.notBlank('path', path); const pathTrimmed = path.trim().replace((typeScriptPath.resolve() + '/').replace(/\\/g, '/'), ''); Assert_1.Assert.path('path', pathTrimmed); this.path = pathTrimmed; } get() { return this.path; } getDotsPath() { return this.path.replaceAll('/', '.'); } static of(path) { return new RelativePath(path); } contains(path) { return this.path.includes(path); } } exports.RelativePath = RelativePath; //# sourceMappingURL=RelativePath.js.map