INCRBY.js 597 B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
  4. exports.FIRST_KEY_INDEX = 1;
  5. function transformArguments(key, items) {
  6. const args = ['CMS.INCRBY', key];
  7. if (Array.isArray(items)) {
  8. for (const item of items) {
  9. pushIncrByItem(args, item);
  10. }
  11. }
  12. else {
  13. pushIncrByItem(args, items);
  14. }
  15. return args;
  16. }
  17. exports.transformArguments = transformArguments;
  18. function pushIncrByItem(args, { item, incrementBy }) {
  19. args.push(item, incrementBy.toString());
  20. }