MCPcopy Create free account
hub / github.com/apache/pouchdb / coerceInteger

Function coerceInteger

lib/index.js:8263–8273  ·  view source on GitHub ↗
(integerCandidate)

Source from the content-addressed store, hash-verified

8261 }
8262
8263 function coerceInteger(integerCandidate) {
8264 if (typeof integerCandidate !== 'undefined') {
8265 const asNumber = Number(integerCandidate);
8266 // prevents e.g. '1foo' or '1.1' being coerced to 1
8267 if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) {
8268 return asNumber;
8269 } else {
8270 return integerCandidate;
8271 }
8272 }
8273 }
8274
8275 function coerceOptions(opts) {
8276 opts.group_level = coerceInteger(opts.group_level);

Callers 1

coerceOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…