wx2tg-puppet 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/axiosInstance.js +17 -1
- package/package.json +3 -1
|
@@ -6,7 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.axiosInstance = void 0;
|
|
7
7
|
exports.setBaseUrl = setBaseUrl;
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
|
|
9
|
+
const json_bigint_1 = __importDefault(require("json-bigint"));
|
|
10
|
+
const JSONbigString = (0, json_bigint_1.default)({
|
|
11
|
+
storeAsString: true,
|
|
12
|
+
alwaysParseAsBig: false,
|
|
13
|
+
useNativeBigInt: false
|
|
14
|
+
});
|
|
15
|
+
exports.axiosInstance = axios_1.default.create({
|
|
16
|
+
transformResponse: data => {
|
|
17
|
+
try {
|
|
18
|
+
return JSONbigString.parse(data + '');
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
console.log(err);
|
|
22
|
+
return JSON.parse(data + '');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
10
26
|
function setBaseUrl(baseUrl) {
|
|
11
27
|
exports.axiosInstance.defaults.baseURL = baseUrl;
|
|
12
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wx2tg-puppet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"description": "微信机器人核心库,可作为依赖被其他项目引入。",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/axios": "^0.9.36",
|
|
27
|
+
"@types/json-bigint": "^1.0.4",
|
|
27
28
|
"@types/qrcode-terminal": "^0.12.2",
|
|
28
29
|
"ts-node": "^10.9.2",
|
|
29
30
|
"typescript": "^5.8.3"
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
"axios": "^1.9.0",
|
|
33
34
|
"fast-xml-parser": "^5.2.3",
|
|
34
35
|
"file-box": "^1.4.15",
|
|
36
|
+
"json-bigint": "^1.0.0",
|
|
35
37
|
"qrcode-terminal": "^0.12.0",
|
|
36
38
|
"reflect-metadata": "^0.2.2",
|
|
37
39
|
"sqlite3": "^5.1.7",
|