TransFlow/node_modules/js-sdsl/dist/esm/utils/checkParams.js

13 lines
359 B
JavaScript

/**
* @description Check if access is out of bounds.
* @param pos The position want to access.
* @param lower The lower bound.
* @param upper The upper bound.
* @return Boolean about if access is out of bounds.
*/
export function checkWithinAccessParams(pos, lower, upper) {
if (pos < lower || pos > upper) {
throw new RangeError();
}
}