Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8931bcf

Browse files
authoredJul 2, 2024··
Merge pull request #1677 from paulish/bigint_fix
fix: TypeError with BigInt param
2 parents e5205fb + b774084 commit 8931bcf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎lib/shared.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ const getTypeByValue = function (value) {
5757
return TYPES.NVarChar
5858

5959
case 'number':
60-
case 'bigint':
6160
if (value % 1 === 0) {
6261
if (value < -2147483648 || value > 2147483647) {
6362
return TYPES.BigInt
@@ -68,6 +67,13 @@ const getTypeByValue = function (value) {
6867
return TYPES.Float
6968
}
7069

70+
case 'bigint':
71+
if (value < -2147483648n || value > 2147483647n) {
72+
return TYPES.BigInt
73+
} else {
74+
return TYPES.Int
75+
}
76+
7177
case 'boolean':
7278
for (const item of Array.from(map)) {
7379
if (item.js === Boolean) {

0 commit comments

Comments
 (0)
Please sign in to comment.