Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class RejsonRlService {
path: string,
type: string,
): Promise<SafeRejsonRlDataDto[]> {
const result = [];
const promises = [];
let objectKeys: string[];
let arrayLength: number;

Expand All @@ -174,8 +174,8 @@ export class RejsonRlService {
? `['${objectKey}']`
: `["${objectKey}"]`;
const fullObjectKeyPath = `${rootPath}${childPath}`;
result.push(
await this.getDetails(
promises.push(
this.getDetails(
client,
keyName,
fullObjectKeyPath,
Expand All @@ -184,26 +184,22 @@ export class RejsonRlService {
);
}

break;
return Promise.all(promises);
case 'array':
arrayLength = await client.sendCommand([
BrowserToolRejsonRlCommands.JsonArrLen,
keyName,
path,
], { replyEncoding: 'utf8' }) as number;

for (let i = 0; i < arrayLength; i += 1) {
const fullObjectKeyPath = `${path === '.' ? '' : path}[${i}]`;
result.push(
await this.getDetails(client, keyName, fullObjectKeyPath, i),
);
promises.push(this.getDetails(client, keyName, fullObjectKeyPath, i));
}
break;

return Promise.all(promises);
default:
return this.forceGetJson(client, keyName, path);
}

return result;
}

/**
Expand Down
Loading