openapi-ts-request
Version:
Swagger2/OpenAPI3/Apifox to TypeScript/JavaScript, request client(support any client), request mock service, enum and enum translation, react-query/vue-query, type field label, JSON Schemas
24 lines (23 loc) • 698 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMultiselectOptions = createMultiselectOptions;
exports.parseInteractiveMode = parseInteractiveMode;
/**
* Helper function to create multiselect options with proper typing
*/
function createMultiselectOptions(configs) {
return configs.map((config) => ({
value: config,
label: config.describe ||
('schemaPath' in config ? config.schemaPath : 'Apifox Config'),
}));
}
function parseInteractiveMode(value) {
if (value === undefined) {
return true;
}
if (typeof value === 'boolean') {
return value;
}
return JSON.parse(value) === true;
}