Comparing version 1.12.2 to 1.12.3
@@ -38,3 +38,3 @@ "use strict"; | ||
method: this.METHOD_POST, | ||
body: JSON.stringify(body), | ||
body: typeof body !== "string" ? JSON.stringify(body) : body, | ||
headers, | ||
@@ -47,3 +47,3 @@ }); | ||
if (endpoint.startsWith("/")) { | ||
endpoint = endpoint.replace("/", ""); | ||
endpoint = endpoint.slice(1); | ||
} | ||
@@ -50,0 +50,0 @@ if (this.config.network) { |
@@ -50,7 +50,2 @@ "use strict"; | ||
function bufferToString(buffer) { | ||
// TextEncoder will be available in browsers, but not in node | ||
if (typeof TextDecoder == "undefined") { | ||
const TextDecoder = require("util").TextDecoder; | ||
return new TextDecoder("utf-8", { fatal: true }).decode(buffer); | ||
} | ||
return new TextDecoder("utf-8", { fatal: true }).decode(buffer); | ||
@@ -60,7 +55,2 @@ } | ||
function stringToBuffer(string) { | ||
// TextEncoder will be available in browsers, but not in node | ||
if (typeof TextEncoder == "undefined") { | ||
const TextEncoder = require("util").TextEncoder; | ||
return new TextEncoder().encode(string); | ||
} | ||
return new TextEncoder().encode(string); | ||
@@ -67,0 +57,0 @@ } |
{ | ||
"name": "arweave", | ||
"version": "1.12.2", | ||
"version": "1.12.3", | ||
"description": "Arweave JS client library", | ||
@@ -11,11 +11,10 @@ "main": "./node/index.js", | ||
"web", | ||
"bundles", | ||
".npmrc" | ||
"bundles" | ||
], | ||
"scripts": { | ||
"compile:node": "cross-env NODE_OPTIONS='--experimental-fetch' tsc --declaration -project tsconfig.node.json && resolve-tspaths -p tsconfig.node.json", | ||
"compile:node": "tsc --declaration -project tsconfig.node.json && resolve-tspaths -p tsconfig.node.json", | ||
"compile:web": "tsc --declaration -project tsconfig.web.json && resolve-tspaths -p tsconfig.web.json", | ||
"bundle:web": "npx webpack --config-name web", | ||
"bundle:web-prod": "npx webpack --config-name web-prod", | ||
"profile:web": "npx webpack --config-name web --json > ./web.profile.json && npx webpack-bundle-analyzer ./web.profile.json", | ||
"bundle:web": "webpack --config-name web", | ||
"bundle:web-prod": "webpack --config-name web-prod", | ||
"profile:web": "webpack --config-name web --json > ./web.profile.json && webpack-bundle-analyzer ./web.profile.json", | ||
"package": "mkdirp node web && ncp dist/node/common/ dist/node/node/ && ncp dist/node/node/ node && ncp dist/web/common/ dist/web/web/ && ncp dist/web/web/ web && npm run clean:dist", | ||
@@ -28,4 +27,4 @@ "build": "npm run clean && npm run compile:node && npm run compile:web && npm run package && npm run bundle:web && npm run bundle:web-prod", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"test": "cross-env NODE_OPTIONS='--experimental-fetch' mocha -r ts-node/register -r tsconfig-paths/register test/*.ts && echo \"NOW RUN => 'npm run test:web' <= \" ", | ||
"test:web": "npm run bundle:web && npx webpack --config-name web-tests && opener test/web/web.html", | ||
"test": "mocha -r ts-node/register -r tsconfig-paths/register test/*.ts && echo \"NOW RUN => 'npm run test:web' <= \" ", | ||
"test:web": "npm run bundle:web && webpack --config-name web-tests && opener test/web/web.html", | ||
"prettier:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"", | ||
@@ -65,7 +64,6 @@ "prettier:write": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"@types/chai": "^4.3.1", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^17.0.38", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.11.18", | ||
"buffer": "^6.0.3", | ||
"chai": "^4.3.6", | ||
"cross-env": "^7.0.3", | ||
"crypto-browserify": "^3.12.0", | ||
@@ -76,3 +74,3 @@ "mkdirp": "^1.0.4", | ||
"opener": "^1.5.2", | ||
"prettier": "2.6.2", | ||
"prettier": "^2.8.1", | ||
"process": "^0.11.10", | ||
@@ -93,3 +91,3 @@ "resolve-tspaths": "^0.6.0", | ||
"chrome": "70", | ||
"node": "12" | ||
"node": "16" | ||
}, | ||
@@ -102,7 +100,5 @@ "engines": { | ||
"asn1.js": "^5.4.1", | ||
"axios": "^0.27.2", | ||
"base64-js": "^1.5.1", | ||
"bignumber.js": "^9.0.2", | ||
"util": "^0.12.4" | ||
"bignumber.js": "^9.0.2" | ||
} | ||
} |
@@ -35,3 +35,3 @@ "use strict"; | ||
headers.append("accept", "application/json, text/plain, */*"); | ||
return await this.request(endpoint, Object.assign(Object.assign({}, config), { method: this.METHOD_POST, body: JSON.stringify(body), headers })); | ||
return await this.request(endpoint, Object.assign(Object.assign({}, config), { method: this.METHOD_POST, body: typeof body !== "string" ? JSON.stringify(body) : body, headers })); | ||
} | ||
@@ -42,3 +42,3 @@ async request(endpoint, init) { | ||
if (endpoint.startsWith("/")) { | ||
endpoint = endpoint.replace("/", ""); | ||
endpoint = endpoint.slice(1); | ||
} | ||
@@ -45,0 +45,0 @@ if (this.config.network) { |
@@ -27,7 +27,2 @@ "use strict"; | ||
function bufferToString(buffer) { | ||
// TextEncoder will be available in browsers, but not in node | ||
if (typeof TextDecoder == "undefined") { | ||
const TextDecoder = require("util").TextDecoder; | ||
return new TextDecoder("utf-8", { fatal: true }).decode(buffer); | ||
} | ||
return new TextDecoder("utf-8", { fatal: true }).decode(buffer); | ||
@@ -37,7 +32,2 @@ } | ||
function stringToBuffer(string) { | ||
// TextEncoder will be available in browsers, but not in node | ||
if (typeof TextEncoder == "undefined") { | ||
const TextEncoder = require("util").TextEncoder; | ||
return new TextEncoder().encode(string); | ||
} | ||
return new TextEncoder().encode(string); | ||
@@ -44,0 +34,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
24
878468
131
10313
- Removedaxios@^0.27.2
- Removedutil@^0.12.4
- Removedasynckit@0.4.0(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedaxios@0.27.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedform-data@4.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedutil@0.12.5(transitive)
- Removedwhich-typed-array@1.1.15(transitive)