import type { CommandOptions } from "./command"; import { Command } from "./command"; /** * @see https://redis.io/commands/lpos * @see node_modules/@upstash/redis/docs/commands/list/lpos.mdx */ export class LPosCommand extends Command { constructor( cmd: [key: string, element: unknown, opts?: { rank?: number; count?: number; maxLen?: number }], opts?: CommandOptions ) { const args = ["lpos", cmd[0], cmd[1]]; if (typeof cmd[2]?.rank === "number") { args.push("rank", cmd[2].rank); } if (typeof cmd[2]?.count === "number") { args.push("count", cmd[2].count); } if (typeof cmd[2]?.maxLen === "number") { args.push("maxLen", cmd[2].maxLen); } super(args, opts); } }