@trapi/metadata
Version:
Generate REST-API metadata scheme from TypeScript Decorators.
29 lines • 847 B
JavaScript
;
/*
* Copyright (c) 2023.
* 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.transformJSDocComment = void 0;
const locter_1 = require("locter");
function transformJSDocComment(input) {
if (typeof input === 'string') {
return input;
}
if (!input || input.length === 0) {
return undefined;
}
const comment = input[0];
if (typeof comment === 'string') {
return comment;
}
if ((0, locter_1.isObject)(comment) &&
typeof comment.text === 'string') {
return comment.text;
}
return undefined;
}
exports.transformJSDocComment = transformJSDocComment;
//# sourceMappingURL=utils.js.map