checkParams.js 530 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.checkWithinAccessParams = void 0;
  4. /**
  5. * @description Check if access is out of bounds.
  6. * @param pos The position want to access.
  7. * @param lower The lower bound.
  8. * @param upper The upper bound.
  9. * @return Boolean about if access is out of bounds.
  10. */
  11. function checkWithinAccessParams(pos, lower, upper) {
  12. if (pos < lower || pos > upper) {
  13. throw new RangeError();
  14. }
  15. }
  16. exports.checkWithinAccessParams = checkWithinAccessParams;