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:
parent
cedde7f85a
commit
a083afd83b
@ -29,14 +29,14 @@ const trailingDotDot = /\.\.$/;
|
|||||||
* - Allow `...foo` as well as `..foo`
|
* - Allow `...foo` as well as `..foo`
|
||||||
*/
|
*/
|
||||||
export function convertKubectlJsonPathToNodeJsonPath(jsonPath: string) {
|
export function convertKubectlJsonPathToNodeJsonPath(jsonPath: string) {
|
||||||
const startMatch = kubectlOptionPrefix.match(jsonPath);
|
const captures = kubectlOptionPrefix.captures(jsonPath);
|
||||||
let start = "$";
|
let start = "$";
|
||||||
|
|
||||||
if (!startMatch.groups) {
|
if (!captures) {
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { pathExpression } = startMatch.groups;
|
let { pathExpression } = captures;
|
||||||
|
|
||||||
if (pathExpression.match(slashDashSearch)) {
|
if (pathExpression.match(slashDashSearch)) {
|
||||||
const [first, ...rest] = pathExpression.split(pathByBareDots);
|
const [first, ...rest] = pathExpression.split(pathByBareDots);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user