artdaq_node_server  v1_00_07
 All Classes Namespaces Files Variables Pages
_isIndex.js
1 
2 var MAX_SAFE_INTEGER = 9007199254740991;
3 
5 var reIsUint = /^(?:0|[1-9]\d*)$/;
6 
15 function isIndex(value, length) {
16  length = length == null ? MAX_SAFE_INTEGER : length;
17  return !!length &&
18  (typeof value == 'number' || reIsUint.test(value)) &&
19  (value > -1 && value % 1 == 0 && value < length);
20 }
21 
22 module.exports = isIndex;