Skip to content

Commit

Permalink
fix: TypeError with BigInt param
Browse files Browse the repository at this point in the history
  • Loading branch information
paulish committed Jul 2, 2024
1 parent e5205fb commit 3a91d2a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const getTypeByValue = function (value) {
return TYPES.NVarChar

case 'number':
case 'bigint':
if (value % 1 === 0) {
if (value < -2147483648 || value > 2147483647) {
return TYPES.BigInt
Expand All @@ -67,6 +66,13 @@ const getTypeByValue = function (value) {
} else {
return TYPES.Float
}

case 'bigint':
if (value < -2147483648n || value > 2147483647n) {
return TYPES.BigInt
} else {
return TYPES.Int
}

case 'boolean':
for (const item of Array.from(map)) {
Expand Down

0 comments on commit 3a91d2a

Please sign in to comment.