From 2d6a9ae0b3095f009f97d7b0888bf4d14a67651a Mon Sep 17 00:00:00 2001 From: mblakley Date: Mon, 25 Sep 2023 10:10:15 -0400 Subject: [PATCH 1/5] Update bignumber.js version in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47bdc107f..2c7a64de7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "asn1.js-rfc5280": "^3.0.0", "axios": "^1.5.1", "big-integer": "^1.6.43", - "bignumber.js": "^2.4.0", + "bignumber.js": "^6.0.0", "binascii": "0.0.2", "bn.js": "^5.2.1", "browser-request": "^0.3.3", From 6593fb406ac687f5094e1032b543a6d23f367605 Mon Sep 17 00:00:00 2001 From: mblakley Date: Mon, 25 Sep 2023 10:12:57 -0400 Subject: [PATCH 2/5] Replace deprecated bignumber floor function with integerValue calls --- lib/connection/result/column.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/connection/result/column.js b/lib/connection/result/column.js index 9eafd3837..0cc155972 100644 --- a/lib/connection/result/column.js +++ b/lib/connection/result/column.js @@ -456,7 +456,7 @@ function convertRawTimestampTz(rawColumnValue, column, context) // extract everything but the lowest 14 bits to get the fractional seconds valFracSecsBig = - valFracSecsWithTzBig.dividedBy(16384).floor(); + valFracSecsWithTzBig.dividedBy(16384).integerValue(BigNumber.ROUND_FLOOR); // extract the lowest 14 bits to get the timezone if (valFracSecsWithTzBig.greaterThanOrEqualTo(0)) @@ -521,7 +521,7 @@ function convertRawTimestampHelper( // split the value into epoch seconds + nanoseconds; for example, // 1365148923.123456789 will be split into 1365148923 (epoch seconds) // and 123456789 (nano seconds) - var valSecBig = epochFracSecsBig.dividedBy(scaleFactor).floor(); + var valSecBig = epochFracSecsBig.dividedBy(scaleFactor).integerValue(BigNumber.ROUND_FLOOR); var fractionsBig = epochFracSecsBig.minus(valSecBig.times(scaleFactor)); var valSecNanoBig = fractionsBig.times(Math.pow(10, 9 - scale)); From 7d517e4b1e5f8ce0ebafbe99a8e0e262a5a36e57 Mon Sep 17 00:00:00 2001 From: mblakley Date: Fri, 29 Sep 2023 11:56:29 -0400 Subject: [PATCH 3/5] Use updated isGreaterThanOrEqualTo function from bignumber.js --- lib/connection/result/column.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection/result/column.js b/lib/connection/result/column.js index 0cc155972..42671cbb8 100644 --- a/lib/connection/result/column.js +++ b/lib/connection/result/column.js @@ -459,7 +459,7 @@ function convertRawTimestampTz(rawColumnValue, column, context) valFracSecsWithTzBig.dividedBy(16384).integerValue(BigNumber.ROUND_FLOOR); // extract the lowest 14 bits to get the timezone - if (valFracSecsWithTzBig.greaterThanOrEqualTo(0)) + if (valFracSecsWithTzBig.isGreaterThanOrEqualTo(0)) { timezoneBig = valFracSecsWithTzBig.modulo(16384); } From 08193002453926a46c9ebaf311a45bcf49453ef9 Mon Sep 17 00:00:00 2001 From: mblakley Date: Wed, 11 Oct 2023 16:57:28 -0400 Subject: [PATCH 4/5] Allow bignumber.js package major versions >= 6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c7a64de7..870761829 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "asn1.js-rfc5280": "^3.0.0", "axios": "^1.5.1", "big-integer": "^1.6.43", - "bignumber.js": "^6.0.0", + "bignumber.js": ">=6.0.0", "binascii": "0.0.2", "bn.js": "^5.2.1", "browser-request": "^0.3.3", From 06a7d4045ae1a672403129428a76d0f6a68a2066 Mon Sep 17 00:00:00 2001 From: mblakley Date: Thu, 12 Oct 2023 09:56:22 -0400 Subject: [PATCH 5/5] Update bignumber.js dependency to require v9.1.2 and up No need to support multiple major versions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 870761829..4477d752e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "asn1.js-rfc5280": "^3.0.0", "axios": "^1.5.1", "big-integer": "^1.6.43", - "bignumber.js": ">=6.0.0", + "bignumber.js": "^9.1.2", "binascii": "0.0.2", "bn.js": "^5.2.1", "browser-request": "^0.3.3",