1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

נקודה פסיק

This commit is contained in:
Avital-Fine
2022-04-03 15:04:01 +03:00
parent e2c3627870
commit 9eb9adc4a2
2 changed files with 6 additions and 14 deletions

View File

@@ -7,8 +7,8 @@ describe('COMMAND DOCS', () => {
it('transformArguments', () => { it('transformArguments', () => {
assert.deepEqual( assert.deepEqual(
transformArguments('SORT'), transformArguments('sort'),
['COMMAND', 'DOCS', 'SORT'] ['COMMAND', 'DOCS', 'sort']
); );
}); });
@@ -35,13 +35,5 @@ describe('COMMAND DOCS', () => {
if (item.subCommands) assert.equal(typeof item.subCommands, 'object'); if (item.subCommands) assert.equal(typeof item.subCommands, 'object');
} }
// check with commands names
const specifiedDocs = await client.commandDocs('sort', 'get', 'cluster')
assert.equal(typeof specifiedDocs, 'object');
// check with non existing command
const nonExistingCommandDocs = await client.commandDocs('foo')
assert.equal(typeof specifiedDocs, 'object');
}, GLOBAL.SERVERS.OPEN); }, GLOBAL.SERVERS.OPEN);
}); });

View File

@@ -53,7 +53,7 @@ export function transformReply(rawReply: Array<any>): CommandDocsReply {
} }
function createDocumentationInterface(rawDocumentation: Array<any>): Doc { function createDocumentationInterface(rawDocumentation: Array<any>): Doc {
const doc:Doc = {} const doc:Doc = {};
for (let j = 0; j < rawDocumentation.length; j++) { for (let j = 0; j < rawDocumentation.length; j++) {
switch (rawDocumentation[j++]) { switch (rawDocumentation[j++]) {
@@ -70,7 +70,7 @@ function createDocumentationInterface(rawDocumentation: Array<any>): Doc {
doc['complexity'] = rawDocumentation[j]; doc['complexity'] = rawDocumentation[j];
break; break;
case 'history': case 'history':
const historyArray = [] const historyArray = [];
for (let k = 0; k < rawDocumentation[j].length; k++) { for (let k = 0; k < rawDocumentation[j].length; k++) {
historyArray.push({ historyArray.push({
version: rawDocumentation[j][k][0], version: rawDocumentation[j][k][0],
@@ -92,7 +92,7 @@ function createDocumentationInterface(rawDocumentation: Array<any>): Doc {
} }
function createArgumentsDocumentation(rawDocumentation: Array<any>): ArgumentsDocsReply { function createArgumentsDocumentation(rawDocumentation: Array<any>): ArgumentsDocsReply {
const doc:ArgumentsDocsReply = {} const doc:ArgumentsDocsReply = {};
for (let k = 0; k < rawDocumentation.length; k++) { for (let k = 0; k < rawDocumentation.length; k++) {
let argumentName = ""; let argumentName = "";