MCPcopy Index your code
hub / github.com/commitizen/cz-cli / isNormalNonZeroInteger

Function isNormalNonZeroInteger

test/tools/clean.js:95–103  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

93}
94
95function isNormalNonZeroInteger (str) {
96
97 if (Number.isInteger(str) && str > 0) { // Check for integers above 0
98 return str;
99 } else { // Check for strings that cast to ints that are above 0
100 var n = ~~Number(str);
101 return String(n) === str && n > 0;
102 }
103}
104
105/**
106 * Given a reverse chronological array of paths

Callers 1

cleanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected