@trapi/swagger
Version:
Generate Swagger files from a decorator APIs.
21 lines • 749 B
JavaScript
;
/*
* Copyright (c) 2021-2022.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeFinalCharacter = exports.removeDuplicateSlashes = void 0;
function removeDuplicateSlashes(str) {
return str.replace('/([^:]$)/+/g', '$1');
}
exports.removeDuplicateSlashes = removeDuplicateSlashes;
function removeFinalCharacter(str, character) {
while (str.charAt(str.length - 1) === character && str.length > 0) {
str = str.slice(0, -1);
}
return str;
}
exports.removeFinalCharacter = removeFinalCharacter;
//# sourceMappingURL=character.js.map