MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / toIndex

Function toIndex

lib/web/polyfill.js:310–313  ·  view source on GitHub ↗
(index, length)

Source from the content-addressed store, hash-verified

308 return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0;
309}
310function toIndex(index, length){
311 var index = toInteger(index);
312 return index < 0 ? max(index + length, 0) : min(index, length);
313}
314function lz(num){
315 return num > 9 ? num : '0' + num;
316}

Callers 2

createArrayContainsFunction · 0.85
polyfill.jsFile · 0.85

Calls 3

toIntegerFunction · 0.85
maxFunction · 0.85
minFunction · 0.85

Tested by

no test coverage detected