UNPKG

@trapi/swagger

Version:

Generate Swagger files from a decorator APIs.

20 lines 653 B
"use strict"; /* * 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.normalizePathParameters = normalizePathParameters; function normalizePathParameters(str) { // <:id> -> {id} // todo: maybe escaping / is necessary str = str.replace(/<:([^/]+)>/g, '{$1}'); // :id -> {id} str = str.replace(/:([^/]+)/g, '{$1}'); // <id> -> {id} str = str.replace(/<([^/]+)>/g, '{$1}'); return str; } //# sourceMappingURL=path.js.map