From 6adc0a2adc76617f14326c05b88455ea813c7d4d Mon Sep 17 00:00:00 2001 From: prateek-kumar-improving Date: Tue, 3 Sep 2024 10:12:21 -0700 Subject: [PATCH] hvals decoder options updated (#2216) Signed-off-by: Prateek Kumar --- node/src/BaseClient.ts | 7 +++---- node/tests/SharedTests.ts | 13 ++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/node/src/BaseClient.ts b/node/src/BaseClient.ts index 2f1be67495..1d46ff1fb9 100644 --- a/node/src/BaseClient.ts +++ b/node/src/BaseClient.ts @@ -1941,8 +1941,7 @@ export class BaseClient { * @see {@link https://valkey.io/commands/hvals/|valkey.io} for more details. * * @param key - The key of the hash. - * @param decoder - (Optional) {@link Decoder} type which defines how to handle the response. - * If not set, the {@link BaseClientConfiguration.defaultDecoder|default decoder} will be used. + * @param options - (Optional) See {@link DecoderOption}. * @returns a list of values in the hash, or an empty list when the key does not exist. * * @example @@ -1954,9 +1953,9 @@ export class BaseClient { */ public async hvals( key: GlideString, - decoder?: Decoder, + options?: DecoderOption, ): Promise { - return this.createWritePromise(createHVals(key), { decoder: decoder }); + return this.createWritePromise(createHVals(key), options); } /** diff --git a/node/tests/SharedTests.ts b/node/tests/SharedTests.ts index 25a44b5f92..34a2ca2953 100644 --- a/node/tests/SharedTests.ts +++ b/node/tests/SharedTests.ts @@ -1922,14 +1922,13 @@ export function runBaseTests(config: { //hvals with binary buffers expect(await client.hset(key2, fieldValueMap)).toEqual(2); - expect(await client.hvals(key2, Decoder.Bytes)).toEqual([ - value1Encoded, - value2Encoded, - ]); + expect( + await client.hvals(key2, { decoder: Decoder.Bytes }), + ).toEqual([value1Encoded, value2Encoded]); expect(await client.hdel(key2, [field1])).toEqual(1); - expect(await client.hvals(key2, Decoder.Bytes)).toEqual([ - value2Encoded, - ]); + expect( + await client.hvals(key2, { decoder: Decoder.Bytes }), + ).toEqual([value2Encoded]); }, protocol); }, config.timeout,