Skip to content
Snippets Groups Projects
Commit a3c9d2ab authored by Marin Karamihalev's avatar Marin Karamihalev
Browse files

merged quickjs changes, minor fix to get command decoding

parent f39381e4
No related branches found
No related tags found
No related merge requests found
Pipeline #39644 passed
...@@ -20,7 +20,7 @@ const decode: DecodeFn = (msg) => { ...@@ -20,7 +20,7 @@ const decode: DecodeFn = (msg) => {
pathSplit pathSplit
); );
const shouldBeArray = pathIncludesSearch || hasMultipleIndexes; const shouldBeArray = pathIncludesSearch || hasMultipleIndexes || resolvedPathResultsArr.length > 1;
const unflattened = util.convertToNestedObject(resolvedPathResultsArr); const unflattened = util.convertToNestedObject(resolvedPathResultsArr);
const unwrapped = util.fullyUnwrapObject(unflattened, shouldBeArray); const unwrapped = util.fullyUnwrapObject(unflattened, shouldBeArray);
return [unwrapped]; return [unwrapped];
... ...
......
{ {
"ws": { "ws": {
"host": "192.168.1.1", "host": "iopsys.lan",
"username": "admin", "username": "admin",
"password": "admin", "password": "admin",
"port": 9001, "port": 9001,
... ...
......
...@@ -98,7 +98,7 @@ describe("Test general API", () => { ...@@ -98,7 +98,7 @@ describe("Test general API", () => {
const msg = await device const msg = await device
.get("Device.Bridging.Bridge.1.Port.1.LowerLayers") .get("Device.Bridging.Bridge.1.Port.1.LowerLayers")
.then(device.resolve); .then(device.resolve);
assert.strictEqual(Array.isArray(msg), true); assert.strictEqual(typeof msg, "object");
}); });
it("returns string when it cannot resolve path", async () => { it("returns string when it cannot resolve path", async () => {
... ...
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment