From e1de0037041c1cf1a7d5dc973d8175e3a0680f65 Mon Sep 17 00:00:00 2001 From: Ferdi Koomen Date: Fri, 19 Mar 2021 14:32:41 +0100 Subject: [PATCH] - Fixed lgtm comments --- rollup.config.js | 2 +- src/openApi/v2/parser/getEnumFromDescription.ts | 2 +- src/openApi/v3/parser/getEnumFromDescription.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 4449108b..6333316d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -57,7 +57,7 @@ const getPlugins = () => { return plugins; } return [...plugins, terser()]; -} +}; module.exports = { input: './src/index.ts', diff --git a/src/openApi/v2/parser/getEnumFromDescription.ts b/src/openApi/v2/parser/getEnumFromDescription.ts index 2e7b7348..ed33e1a2 100644 --- a/src/openApi/v2/parser/getEnumFromDescription.ts +++ b/src/openApi/v2/parser/getEnumFromDescription.ts @@ -3,7 +3,7 @@ import type { Enum } from '../../../client/interfaces/Enum'; export function getEnumFromDescription(description: string): Enum[] { // Check if we can find this special format string: // None=0,Something=1,AnotherThing=2 - if (/^(\w+=[0-9]+,?)+$/g.test(description)) { + if (/^(\w+=[0-9]+)/g.test(description)) { const matches = description.match(/(\w+=[0-9]+,?)/g); if (matches) { // Grab the values from the description diff --git a/src/openApi/v3/parser/getEnumFromDescription.ts b/src/openApi/v3/parser/getEnumFromDescription.ts index 2e7b7348..ed33e1a2 100644 --- a/src/openApi/v3/parser/getEnumFromDescription.ts +++ b/src/openApi/v3/parser/getEnumFromDescription.ts @@ -3,7 +3,7 @@ import type { Enum } from '../../../client/interfaces/Enum'; export function getEnumFromDescription(description: string): Enum[] { // Check if we can find this special format string: // None=0,Something=1,AnotherThing=2 - if (/^(\w+=[0-9]+,?)+$/g.test(description)) { + if (/^(\w+=[0-9]+)/g.test(description)) { const matches = description.match(/(\w+=[0-9]+,?)/g); if (matches) { // Grab the values from the description