Files
airllm-fork-nodejs/node_modules/env-var/lib/accessors/int.js
2026-02-05 15:27:49 +08:00

12 lines
202 B
JavaScript

'use strict'
module.exports = function asInt (value) {
const n = parseInt(value, 10)
if (isNaN(n) || n.toString(10) !== value) {
throw new Error('should be a valid integer')
}
return n
}