@balena/sbvr-types
Advanced tools
Comparing version 9.0.0-build-joshbwlng-bigint-string-127ae3170d17104c6079567167eba3f36cb8c058-1 to 9.0.0-build-joshbwlng-bigint-string-45d3cd6262f094a0c43ffe308dccab4968c074be-1
@@ -8,3 +8,3 @@ # Change Log | ||
# v9.0.0 | ||
## (2024-06-25) | ||
## (2024-07-05) | ||
@@ -11,0 +11,0 @@ * Update BigInteger and BigSerial TsTypes [Josh Bowling] |
@@ -18,7 +18,7 @@ "use strict"; | ||
let value; | ||
if (typeof data === 'bigint') { | ||
if (typeof data === 'string') { | ||
value = data; | ||
} | ||
else if (typeof data === 'string' || typeof data === 'number') { | ||
value = BigInt(data); | ||
else if (typeof data === 'bigint' || typeof data === 'number') { | ||
value = data.toString(); | ||
} | ||
@@ -28,3 +28,3 @@ else { | ||
} | ||
return value.toString(); | ||
return value; | ||
}; | ||
@@ -31,0 +31,0 @@ exports.fetchProcessing = fetchProcessing; |
{ | ||
"name": "@balena/sbvr-types", | ||
"version": "9.0.0-build-joshbwlng-bigint-string-127ae3170d17104c6079567167eba3f36cb8c058-1", | ||
"version": "9.0.0-build-joshbwlng-bigint-string-45d3cd6262f094a0c43ffe308dccab4968c074be-1", | ||
"description": "SBVR type definitions.", | ||
@@ -54,4 +54,4 @@ "main": "out", | ||
"versionist": { | ||
"publishedAt": "2024-06-25T00:39:34.881Z" | ||
"publishedAt": "2024-07-05T00:50:33.150Z" | ||
} | ||
} |
@@ -21,11 +21,11 @@ import * as TypeUtils from '../type-utils'; | ||
} | ||
let value: bigint; | ||
if (typeof data === 'bigint') { | ||
let value: string; | ||
if (typeof data === 'string') { | ||
value = data; | ||
} else if (typeof data === 'string' || typeof data === 'number') { | ||
value = BigInt(data); | ||
} else if (typeof data === 'bigint' || typeof data === 'number') { | ||
value = data.toString(); | ||
} else { | ||
throw new Error('Fetched bigint is not valid: ' + typeof data); | ||
} | ||
return value.toString(); | ||
return value; | ||
}; | ||
@@ -32,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151387