persona-community-5/.pnpm-store/v3/files/62/7014dceaac7f2429c66d037150ba137b14bc74c843550f185982e24ff6493d5e4cce79861d0fde4815a090b1cb79b1cc9e45f776f93d81eab213af20dee9af
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

37 lines
1.3 KiB
Plaintext

'use strict';
const ts$1 = require('typescript');
const ts = require('../lib/ts.cjs');
const utils = require('../lib/utils.cjs');
const responseObject = require('./response-object.cjs');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
const ts__default = /*#__PURE__*/_interopDefaultCompat(ts$1);
function transformResponsesObject(responsesObject, options) {
const type = [];
for (const [responseCode, responseObject$1] of utils.getEntries(responsesObject, options.ctx)) {
const responseType = "$ref" in responseObject$1 ? ts.oapiRef(responseObject$1.$ref) : responseObject(responseObject$1, {
...options,
path: utils.createRef([options.path, "responses", responseCode])
});
const property = ts__default.factory.createPropertySignature(
/* modifiers */
ts.tsModifiers({ readonly: options.ctx.immutable }),
/* name */
ts.tsPropertyIndex(responseCode),
/* questionToken */
void 0,
/* type */
responseType
);
ts.addJSDocComment(responseObject$1, property);
type.push(property);
}
return type.length ? ts__default.factory.createTypeLiteralNode(type) : ts.NEVER;
}
module.exports = transformResponsesObject;
//# sourceMappingURL=responses-object.cjs.map