MCPcopy Index your code
hub / github.com/phaserjs/phaser / SafeRange

Function SafeRange

src/utils/array/SafeRange.js:23–43  ·  view source on GitHub ↗
(array, startIndex, endIndex, throwError)

Source from the content-addressed store, hash-verified

21 * @return {boolean} True if the range is safe, otherwise false.
22 */
23var SafeRange = function (array, startIndex, endIndex, throwError)
24{
25 var len = array.length;
26
27 if (startIndex < 0 ||
28 startIndex >= len ||
29 startIndex >= endIndex ||
30 endIndex > len)
31 {
32 if (throwError)
33 {
34 throw new Error('Range Error: Values outside acceptable range');
35 }
36
37 return false;
38 }
39 else
40 {
41 return true;
42 }
43};
44
45module.exports = SafeRange;

Callers 7

GetAllFunction · 0.85
SetAllFunction · 0.85
GetFirstFunction · 0.85
EachInRangeFunction · 0.85
CountAllMatchingFunction · 0.85
RemoveBetweenFunction · 0.85
SafeRange.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…