in src/builder.ts [593:615]
public and(
key: string | Buffer,
column: keyof typeof RPC.CompareTarget,
cmp: keyof typeof comparator,
value: string | Buffer | number,
): this {
assertWithin(compareTarget, column, 'comparison target in client.and(...)');
assertWithin(comparator, cmp, 'comparator in client.and(...)');
if (column === 'Value') {
value = toBuffer(value as string | Buffer);
}
this.request.compare.push(
Promise.resolve({
key: this.namespace.applyKey(toBuffer(key)),
result: comparator[cmp],
target: RPC.CompareTarget[column],
[compareTarget[column]]: value,
}),
);
return this;
}