1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix code to help CodeQL scanner

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-04-26 09:46:31 -04:00
parent cedde7f85a
commit a083afd83b

View File

@ -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);