mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
spelling: characters
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
parent
724cf7937e
commit
477dfc7300
@ -28,7 +28,7 @@ describe("parseJsonPath", () => {
|
|||||||
expect(res).toBe(".metadata.labels['kubesphere.io/alias-name']");
|
expect(res).toBe(".metadata.labels['kubesphere.io/alias-name']");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("should convert keys with escpaped charatecrs to use indexed notation", () => {
|
test("should convert keys with escpaped characters to use indexed notation", () => {
|
||||||
const res = parseJsonPath(".metadata.labels.kubesphere\\\"io/alias-name");
|
const res = parseJsonPath(".metadata.labels.kubesphere\\\"io/alias-name");
|
||||||
|
|
||||||
expect(res).toBe(".metadata.labels['kubesphere\"io/alias-name']");
|
expect(res).toBe(".metadata.labels['kubesphere\"io/alias-name']");
|
||||||
|
|||||||
@ -48,7 +48,7 @@ function convertToIndexNotation(key: string, firstItem = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return `['${key}']`;
|
return `['${key}']`;
|
||||||
} else { // no illegal chracters found, do not touch
|
} else { // no illegal characters found, do not touch
|
||||||
const prefix = firstItem ? "" : ".";
|
const prefix = firstItem ? "" : ".";
|
||||||
|
|
||||||
return `${prefix}${key}`;
|
return `${prefix}${key}`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user