Skip to content

Commit

Permalink
post rebase clean up
Browse files Browse the repository at this point in the history
Signed-off-by: James Xin <james.xin@improving.com>
  • Loading branch information
jamesx-improving committed Sep 26, 2024
1 parent a6febfa commit 30d8c7b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions node/src/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2502,23 +2502,21 @@ export interface BitOffsetOptions {
* If no index type is provided, the indexes will be assumed to be byte indexes.
*/
indexType?: BitmapIndexType;
};
}

/**
* @internal
*/
function joinBitOptions(options: BitOffsetOptions): GlideString[] {
function convertBitOptionsToArgs(options?: BitOffsetOptions): GlideString[] {
const args: GlideString[] = [];
if (!options) return args;

if (options.start !== undefined) {
args.push(options.start.toString());
args.push(options.start.toString());

if (options.end !== undefined) {
args.push(options.end.toString());
if (options.end !== undefined) {
args.push(options.end.toString());

if (options.indexType) args.push(options.indexType);
}
if (options.indexType) args.push(options.indexType);
}

return args;
Expand All @@ -2534,7 +2532,7 @@ export function createBitCount(
let args: GlideString[] = [key];

if (options) {
const optionResults: GlideString[] = joinBitOptions(options);
const optionResults: GlideString[] = convertBitOptionsToArgs(options);
args = args.concat(optionResults);
}

Expand Down

0 comments on commit 30d8c7b

Please sign in to comment.