From a083afd83b114ad7687d429f4753fd14d2afc91b Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 26 Apr 2022 09:46:31 -0400 Subject: [PATCH] fix code to help CodeQL scanner Signed-off-by: Sebastian Malton --- src/renderer/utils/jsonPath.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/utils/jsonPath.ts b/src/renderer/utils/jsonPath.ts index a4ea5db3ae..3ba970a044 100644 --- a/src/renderer/utils/jsonPath.ts +++ b/src/renderer/utils/jsonPath.ts @@ -29,14 +29,14 @@ const trailingDotDot = /\.\.$/; * - Allow `...foo` as well as `..foo` */ export function convertKubectlJsonPathToNodeJsonPath(jsonPath: string) { - const startMatch = kubectlOptionPrefix.match(jsonPath); + const captures = kubectlOptionPrefix.captures(jsonPath); let start = "$"; - if (!startMatch.groups) { + if (!captures) { return start; } - let { pathExpression } = startMatch.groups; + let { pathExpression } = captures; if (pathExpression.match(slashDashSearch)) { const [first, ...rest] = pathExpression.split(pathByBareDots);