Skip to content

Commit 1f334bb

Browse files
Merge pull request #165 from avadev/21.2.1
21.2.1
2 parents d0fdecb + 47bb24b commit 1f334bb

File tree

5 files changed

+428
-6
lines changed

5 files changed

+428
-6
lines changed

lib/AvaTaxClient.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
* @author Ted Spence <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 21.1.1
13+
* @version 21.2.1
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

1717
import fetch from 'isomorphic-fetch';
1818
import { createBasicAuthHeader } from './utils/basic_auth';
1919
import { withTimeout } from './utils/withTimeout';
20+
var JSONbig = require('json-bigint')({ useNativeBigInt: true });
2021

2122
export default class AvaTaxClient {
2223
/**
@@ -42,7 +43,7 @@ export default class AvaTaxClient {
4243
appName +
4344
'; ' +
4445
appVersion +
45-
'; JavascriptSdk; 21.1.1; ' +
46+
'; JavascriptSdk; 21.2.1; ' +
4647
machineName;
4748
}
4849

@@ -90,8 +91,9 @@ export default class AvaTaxClient {
9091
if (contentType === 'application/vnd.ms-excel' || contentType === 'text/csv') {
9192
return res;
9293
}
93-
return res.json();
94-
}).then(json => {
94+
return res.text();
95+
}).then(text => {
96+
var json = JSONbig.parse(text);
9597
// handle error
9698
if (json.error) {
9799
let ex = new Error(json.error.message);

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "avatax",
3-
"version": "21.1.1",
3+
"version": "21.2.1",
44
"description": "AvaTax v2 SDK for languages using JavaScript",
55
"main": "index.js",
66
"homepage": "https://github.com/avadev/AvaTax-REST-V2-JS-SDK",
@@ -10,6 +10,7 @@
1010
},
1111
"scripts": {
1212
"build": "rm -rf ./.build && babel lib -d .build/lib && babel index.js --out-file .build/index.js && cp package.json ./.build && cp README.md ./.build",
13+
"build-win": "babel lib -d .build/lib && babel index.js --out-file .build/index.js && copy package.json .build && copy README.md .build",
1314
"test": "jest",
1415
"lint": "eslint lib/**/*.js test/**/*.js --cache",
1516
"format": "prettier --single-quote --write ./test/**/*.js ./lib/*.js ./lib/**/*.js",
@@ -22,7 +23,8 @@
2223
"author": "Justin Soliz, Genevieve Conty",
2324
"license": "Apache-2.0",
2425
"dependencies": {
25-
"isomorphic-fetch": "^2.2.1"
26+
"isomorphic-fetch": "^2.2.1",
27+
"json-bigint": "^1.0.0"
2628
},
2729
"devDependencies": {
2830
"babel-cli": "^6.22.2",

0 commit comments

Comments
 (0)