src/helpers.js
function assertRange(begin, end, min, cap) {
    if (typeof begin !== 'number' || begin % 1 !== 0)
        throw TypeError("Illegal begin: "+begin+" (not a number)");
    begin = begin | 0;
    if (typeof end !== 'number' || end % 1 !== 0)
        throw TypeError("Illegal end: "+range[1]+" (not a number)");
    end = end | 0;
    if (begin < min || begin > end || end > cap)
        throw RangeError("Illegal range: "+min+" <= "+begin+" <= "+end+" <= "+cap);
    rangeVal[0] = begin; rangeVal[1] = end;
}
function assertRange(begin, end, min, cap) {
    if (typeof begin !== 'number' || begin % 1 !== 0)
        throw TypeError("Illegal begin: "+begin+" (not a number)");
    begin = begin | 0;
    if (typeof end !== 'number' || end % 1 !== 0)
        throw TypeError("Illegal end: "+range[1]+" (not a number)");
    end = end | 0;
    if (begin < min || begin > end || end > cap)
        throw RangeError("Illegal range: "+min+" <= "+begin+" <= "+end+" <= "+cap);
    rangeVal[0] = begin; rangeVal[1] = end;
}
function assertRange ( begin , end , min , cap ) { if ( typeof begin !== 'number' || begin % 1 !== 0 ) throw TypeError ( "Illegal begin: " + begin + " (not a number)" ) ; begin = begin | 0 ; if ( typeof end !== 'number' || end % 1 !== 0 ) throw TypeError ( "Illegal end: " + range [ 1 ] + " (not a number)" ) ; end = end | 0 ; if ( begin < min || begin > end || end > cap ) throw RangeError ( "Illegal range: " + min + " <= " + begin + " <= " + end + " <= " + cap ) ; rangeVal [ 0 ] = begin ; rangeVal [ 1 ] = end ; }
Asserts that `min <= begin <= end <= cap`. Updates `rangeVal` with the type-safe range.
@param {number} begin Begin offset
@param {number} end End offset
@param {number} min Minimum offset
@param {number} cap Cap offset
@throws {TypeError} If `begin` or `end` is not an integer
@throws {RangeError} If `begin < min || begin > end || end > cap`
@inner
Asserts that min < = begin < = end < = cap . Updates rangeVal with the type - safe range .