From 09497968d0d73833bbee68cdbc9e5a90aaea2f97 Mon Sep 17 00:00:00 2001 From: frankledo Date: Wed, 22 Nov 2023 17:07:31 -0800 Subject: [PATCH 1/3] Removed @extra-number/significant-digits package that is no longer supported and replaced call with local code. --- lib/dynamodb.js | 4 +--- package.json | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/dynamodb.js b/lib/dynamodb.js index d949ae8..718e2f1 100644 --- a/lib/dynamodb.js +++ b/lib/dynamodb.js @@ -2,8 +2,6 @@ const RecordEventMock = require( './record' ); -const significantDigits = require( '@extra-number/significant-digits' ); - const constants = require( './constants' ); @@ -14,7 +12,7 @@ function calculateLength( type, value ) { switch( type ) { case 'N': - length = significantDigits( Number( value ) ); + length = value.toExponential().replace(/e[+\-0-9]*$/, '').replace(/^0\.?0*|\./, '').length; break; case 'BOOL': diff --git a/package.json b/package.json index c28e786..7dc4105 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "author": "Vandium Software Inc.", "license": "BSD-3-Clause", "dependencies": { - "@extra-number/significant-digits": "^1.1.1", "clone-deep": "^4.0.1", "uuid": "^3.3.3", "vandium-utils": "^1.2.0" From 73e68ac9d6300422e9004a090caa22f2ed8a1162 Mon Sep 17 00:00:00 2001 From: frankledo Date: Wed, 22 Nov 2023 17:19:29 -0800 Subject: [PATCH 2/3] Wrapping value in Number --- lib/dynamodb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamodb.js b/lib/dynamodb.js index 718e2f1..9e91359 100644 --- a/lib/dynamodb.js +++ b/lib/dynamodb.js @@ -12,7 +12,7 @@ function calculateLength( type, value ) { switch( type ) { case 'N': - length = value.toExponential().replace(/e[+\-0-9]*$/, '').replace(/^0\.?0*|\./, '').length; + length = Number(value).toExponential().replace(/e[+\-0-9]*$/, '').replace(/^0\.?0*|\./, '').length; break; case 'BOOL': From 7536b0a59464c5842a8e2a4fcde4d7ea5a53fa81 Mon Sep 17 00:00:00 2001 From: frankledo Date: Wed, 22 Nov 2023 17:48:09 -0800 Subject: [PATCH 3/3] Updated uuid, mocha, nyc, and sinon --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7dc4105..400df22 100644 --- a/package.json +++ b/package.json @@ -36,15 +36,15 @@ "license": "BSD-3-Clause", "dependencies": { "clone-deep": "^4.0.1", - "uuid": "^3.3.3", + "uuid": "^8.3.2", "vandium-utils": "^1.2.0" }, "devDependencies": { "@vandium/event-identifier": "^3.0.0", "chai": "^4.1.2", - "mocha": "^6.2.2", - "nyc": "^14.1.1", + "mocha": "^10.2.0", + "nyc": "^15.1.0", "proxyquire": "^2.1.3", - "sinon": "^7.5.0" + "sinon": "^17.0.1" } }