args.js 779 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.popNumber = exports.popScheduler = exports.popResultSelector = void 0;
  4. var isFunction_1 = require("./isFunction");
  5. var isScheduler_1 = require("./isScheduler");
  6. function last(arr) {
  7. return arr[arr.length - 1];
  8. }
  9. function popResultSelector(args) {
  10. return isFunction_1.isFunction(last(args)) ? args.pop() : undefined;
  11. }
  12. exports.popResultSelector = popResultSelector;
  13. function popScheduler(args) {
  14. return isScheduler_1.isScheduler(last(args)) ? args.pop() : undefined;
  15. }
  16. exports.popScheduler = popScheduler;
  17. function popNumber(args, defaultValue) {
  18. return typeof last(args) === 'number' ? args.pop() : defaultValue;
  19. }
  20. exports.popNumber = popNumber;
  21. //# sourceMappingURL=args.js.map