Skip to content

Commit

Permalink
Rebased and resolved conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <guian.gumpac@improving.com>
  • Loading branch information
GumpacG committed Jul 25, 2024
1 parent 37008b1 commit a881ab2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
13 changes: 0 additions & 13 deletions node/src/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1699,19 +1699,6 @@ export function createFunctionLoad(
return createCommand(RequestType.FunctionLoad, args);
}

/**
* Enumeration specifying if index arguments are BYTE indexes or BIT indexes.
* Can be specified in {@link BitOffsetOptions}, which is an optional argument to the {@link BaseClient.bitcount|bitcount} command.
*
* since - Valkey version 7.0.0.
*/
export enum BitmapIndexType {
/** Specifies that indexes provided to {@link BitOffsetOptions} are byte indexes. */
BYTE = "BYTE",
/** Specifies that indexes provided to {@link BitOffsetOptions} are bit indexes. */
BIT = "BIT",
}

/**
* Represents offsets specifying a string interval to analyze in the {@link BaseClient.bitcount|bitcount} command. The offsets are
* zero-based indexes, with `0` being the first index of the string, `1` being the next index and so on.
Expand Down
21 changes: 9 additions & 12 deletions node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {
BitmapIndexType,
BitwiseOperation,
ClusterTransaction,
FlushMode,
GeoUnit,
GeospatialData,
GlideClient,
GlideClusterClient,
InsertPosition,
Expand All @@ -24,11 +26,6 @@ import {
ScoreFilter,
Transaction,
} from "..";
import {
BitmapIndexType,
FlushMode,
GeospatialData,
} from "../build-ts/src/Commands";

beforeAll(() => {
Logger.init("info");
Expand Down Expand Up @@ -527,18 +524,18 @@ export async function transactionTest(
field + "3",
]);
responseData.push(["rpush(key16, [1, 1, 2, 3, 3,])", 5]);
baseTransaction.lpos(key16, field + "1", new LPosOptions({ rank: 2 }));
baseTransaction.lpos(key16, field + "1", { rank: 2 });
responseData.push([
'lpos(key16, field + "1", new LPosOptions({ rank: 2 }))',
'lpos(key16, field + "1", { rank: 2 })',
1,
]);
baseTransaction.lpos(
key16,
field + "1",
new LPosOptions({ rank: 2, count: 0 }),
{ rank: 2, count: 0 },
);
responseData.push([
'lpos(key16, field + "1", new LPosOptions({ rank: 2, count: 0 }))',
'lpos(key16, field + "1", { rank: 2, count: 0 })',
[1],
]);
baseTransaction.sadd(key7, ["bar", "foo"]);
Expand Down Expand Up @@ -744,8 +741,8 @@ export async function transactionTest(
responseData.push(['set(key17, "foobar")', "OK"]);
baseTransaction.bitcount(key17);
responseData.push(["bitcount(key17)", 26]);
baseTransaction.bitcount(key17, new BitOffsetOptions(1, 1));
responseData.push(["bitcount(key17, new BitOffsetOptions(1, 1))", 6]);
baseTransaction.bitcount(key17, { start: 1, end: 1 });
responseData.push(["bitcount(key17, { start: 1, end: 1 })", 6]);
baseTransaction.bitpos(key17, 1);
responseData.push(["bitpos(key17, 1)", 1]);

Expand All @@ -762,7 +759,7 @@ export async function transactionTest(
if (gte("7.0.0", version)) {
baseTransaction.bitcount(
key17,
new BitOffsetOptions(5, 30, BitmapIndexType.BIT),
{ start: 5, end: 30, indexType: BitmapIndexType.BIT },
);
responseData.push([
"bitcount(key17, new BitOffsetOptions(5, 30, BitmapIndexType.BIT))",
Expand Down

0 comments on commit a881ab2

Please sign in to comment.