MCPcopy Create free account
hub / github.com/Starcounter-Jack/JSON-Patch / isInteger

Function isInteger

commonjs/helpers.js:64–77  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

62exports._deepClone = _deepClone;
63//3x faster than cached /^\d+$/.test(str)
64function isInteger(str) {
65 var i = 0;
66 var len = str.length;
67 var charCode;
68 while (i < len) {
69 charCode = str.charCodeAt(i);
70 if (charCode >= 48 && charCode <= 57) {
71 i++;
72 continue;
73 }
74 return false;
75 }
76 return true;
77}
78exports.isInteger = isInteger;
79/**
80* Escapes a json pointer path

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected