File tree Expand file tree Collapse file tree 9 files changed +132
-0
lines changed Expand file tree Collapse file tree 9 files changed +132
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ import * as MGET from '../commands/MGET';
7373import * as MIGRATE from '../commands/MIGRATE' ;
7474import * as MSET from '../commands/MSET' ;
7575import * as MSETNX from '../commands/MSETNX' ;
76+ import * as OBJECT_ENCODING from '../commands/OBJECT_ENCODING' ;
77+ import * as OBJECT_FREQ from '../commands/OBJECT_FREQ' ;
78+ import * as OBJECT_IDLETIME from '../commands/OBJECT_IDLETIME' ;
79+ import * as OBJECT_REFCOUNT from '../commands/OBJECT_REFCOUNT' ;
7680import * as PERSIST from '../commands/PERSIST' ;
7781import * as PEXPIRE from '../commands/PEXPIRE' ;
7882import * as PEXPIREAT from '../commands/PEXPIREAT' ;
@@ -330,6 +334,14 @@ export default {
330334 mSet : MSET ,
331335 MSETNX ,
332336 mSetNX : MSETNX ,
337+ OBJECT_ENCODING ,
338+ objectEncoding : OBJECT_ENCODING ,
339+ OBJECT_FREQ ,
340+ objectFreq : OBJECT_FREQ ,
341+ OBJECT_IDLETIME ,
342+ objectIdleTime : OBJECT_IDLETIME ,
343+ OBJECT_REFCOUNT ,
344+ objectRefCount : OBJECT_REFCOUNT ,
333345 PERSIST ,
334346 persist : PERSIST ,
335347 PEXPIRE ,
Original file line number Diff line number Diff line change 1+ import { strict as assert } from 'assert' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
3+ import { transformArguments } from './OBJECT_ENCODING' ;
4+
5+ describe ( 'OBJECT ENCODING' , ( ) => {
6+ it ( 'transformArguments' , ( ) => {
7+ assert . deepEqual (
8+ transformArguments ( 'key' ) ,
9+ [ 'OBJECT' , 'ENCODING' , 'key' ]
10+ ) ;
11+ } ) ;
12+
13+ testUtils . testWithClient ( 'client.objectEncoding' , async client => {
14+ assert . equal (
15+ await client . objectEncoding ( 'key' ) ,
16+ null
17+ ) ;
18+ } , GLOBAL . SERVERS . OPEN ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ import { RedisCommandArgument , RedisCommandArguments } from '.' ;
2+
3+ export const FIRST_KEY_INDEX = 2 ;
4+
5+ export const IS_READ_ONLY = true ;
6+
7+ export function transformArguments ( key : RedisCommandArgument ) : RedisCommandArguments {
8+ return [ 'OBJECT' , 'ENCODING' , key ] ;
9+ }
10+
11+ export declare function transformReply ( ) : string | null ;
Original file line number Diff line number Diff line change 1+ import { strict as assert } from 'assert' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
3+ import { transformArguments } from './OBJECT_FREQ' ;
4+
5+ describe ( 'OBJECT FREQ' , ( ) => {
6+ it ( 'transformArguments' , ( ) => {
7+ assert . deepEqual (
8+ transformArguments ( 'key' ) ,
9+ [ 'OBJECT' , 'FREQ' , 'key' ]
10+ ) ;
11+ } ) ;
12+
13+ testUtils . testWithClient ( 'client.objectFreq' , async client => {
14+ assert . equal (
15+ await client . objectFreq ( 'key' ) ,
16+ null
17+ ) ;
18+ } , GLOBAL . SERVERS . OPEN ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ import { RedisCommandArgument , RedisCommandArguments } from '.' ;
2+
3+ export const FIRST_KEY_INDEX = 2 ;
4+
5+ export const IS_READ_ONLY = true ;
6+
7+ export function transformArguments ( key : RedisCommandArgument ) : RedisCommandArguments {
8+ return [ 'OBJECT' , 'FREQ' , key ] ;
9+ }
10+
11+ export declare function transformReply ( ) : number | null ;
Original file line number Diff line number Diff line change 1+ import { strict as assert } from 'assert' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
3+ import { transformArguments } from './OBJECT_IDLETIME' ;
4+
5+ describe ( 'OBJECT IDLETIME' , ( ) => {
6+ it ( 'transformArguments' , ( ) => {
7+ assert . deepEqual (
8+ transformArguments ( 'key' ) ,
9+ [ 'OBJECT' , 'IDLETIME' , 'key' ]
10+ ) ;
11+ } ) ;
12+
13+ testUtils . testWithClient ( 'client.objectIdleTime' , async client => {
14+ assert . equal (
15+ await client . objectIdleTime ( 'key' ) ,
16+ null
17+ ) ;
18+ } , GLOBAL . SERVERS . OPEN ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ import { RedisCommandArgument , RedisCommandArguments } from '.' ;
2+
3+ export const FIRST_KEY_INDEX = 2 ;
4+
5+ export const IS_READ_ONLY = true ;
6+
7+ export function transformArguments ( key : RedisCommandArgument ) : RedisCommandArguments {
8+ return [ 'OBJECT' , 'IDLETIME' , key ] ;
9+ }
10+
11+ export declare function transformReply ( ) : number | null ;
Original file line number Diff line number Diff line change 1+ import { strict as assert } from 'assert' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
3+ import { transformArguments } from './OBJECT_REFCOUNT' ;
4+
5+ describe ( 'OBJECT REFCOUNT' , ( ) => {
6+ it ( 'transformArguments' , ( ) => {
7+ assert . deepEqual (
8+ transformArguments ( 'key' ) ,
9+ [ 'OBJECT' , 'REFCOUNT' , 'key' ]
10+ ) ;
11+ } ) ;
12+
13+ testUtils . testWithClient ( 'client.objectRefCount' , async client => {
14+ assert . equal (
15+ await client . objectRefCount ( 'key' ) ,
16+ null
17+ ) ;
18+ } , GLOBAL . SERVERS . OPEN ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ import { RedisCommandArgument , RedisCommandArguments } from '.' ;
2+
3+ export const FIRST_KEY_INDEX = 2 ;
4+
5+ export const IS_READ_ONLY = true ;
6+
7+ export function transformArguments ( key : RedisCommandArgument ) : RedisCommandArguments {
8+ return [ 'OBJECT' , 'REFCOUNT' , key ] ;
9+ }
10+
11+ export declare function transformReply ( ) : number | null ;
You can’t perform that action at this time.
0 commit comments