From 10a2942287038d8278efd6f64b6e6d75f154d0e5 Mon Sep 17 00:00:00 2001 From: SVC Developer Date: Tue, 23 Mar 2021 00:39:17 +0000 Subject: [PATCH] 21.3.0 update --- lib/AvaTaxClient.js | 10 ++++++---- package.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/AvaTaxClient.js b/lib/AvaTaxClient.js index 3f6b1b53..556ea85c 100644 --- a/lib/AvaTaxClient.js +++ b/lib/AvaTaxClient.js @@ -10,13 +10,14 @@ * @author Ted Spence * @copyright 2004-2018 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 21.1.1 + * @version 21.3.0 * @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK */ import fetch from 'isomorphic-fetch'; import { createBasicAuthHeader } from './utils/basic_auth'; import { withTimeout } from './utils/withTimeout'; +var JSONbig = require('json-bigint')({ useNativeBigInt: true }); export default class AvaTaxClient { /** @@ -42,7 +43,7 @@ export default class AvaTaxClient { appName + '; ' + appVersion + - '; JavascriptSdk; 21.1.1; ' + + '; JavascriptSdk; 21.3.0; ' + machineName; } @@ -90,8 +91,9 @@ export default class AvaTaxClient { if (contentType === 'application/vnd.ms-excel' || contentType === 'text/csv') { return res; } - return res.json(); - }).then(json => { + return res.text(); + }).then(text => { + var json = JSONbig.parse(text); // handle error if (json.error) { let ex = new Error(json.error.message); diff --git a/package.json b/package.json index e6a01ba3..c8449b6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "avatax", - "version": "21.1.1", + "version": "21.3.0", "description": "AvaTax v2 SDK for languages using JavaScript", "main": "index.js", "homepage": "https://github.com/avadev/AvaTax-REST-V2-JS-SDK",