args.js 500 B

123456789101112131415
  1. import { isFunction } from './isFunction';
  2. import { isScheduler } from './isScheduler';
  3. function last(arr) {
  4. return arr[arr.length - 1];
  5. }
  6. export function popResultSelector(args) {
  7. return isFunction(last(args)) ? args.pop() : undefined;
  8. }
  9. export function popScheduler(args) {
  10. return isScheduler(last(args)) ? args.pop() : undefined;
  11. }
  12. export function popNumber(args, defaultValue) {
  13. return typeof last(args) === 'number' ? args.pop() : defaultValue;
  14. }
  15. //# sourceMappingURL=args.js.map