is-positive-int
Version:
Validate if a value is a positive integer between 0 & Number.MAX_SAFE_INTEGER
1 lines • 548 B
Source Map (JSON)
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export default function isPositiveInt(n: number): boolean {\n\tconst MAX_SAFE_INTEGER: number = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\treturn Number.isInteger(n) && n >= 0 && n <= MAX_SAFE_INTEGER;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAe,SAARE,EAA+BE,EAAoB,CACzD,IAAMC,EAA2B,OAAO,kBAAoB,iBAC5D,OAAO,OAAO,UAAUD,CAAC,GAAKA,GAAK,GAAKA,GAAKC,CAC9C","names":["index_exports","__export","isPositiveInt","__toCommonJS","n","MAX_SAFE_INTEGER"]}