@nodescript/protocomm
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -21,6 +21,8 @@ import { Exception } from 'typesafe-exception'; | ||
return async (params) => { | ||
const payload = JSON.stringify(params || {}); | ||
const url = new URL(`${domainName}/${methodName}`, config.baseUrl); | ||
if (method === 'GET') { | ||
for (const [k, v] of Object.entries(params ?? {})) { | ||
if (v === undefined) { | ||
continue; | ||
} | ||
url.searchParams.append(k, v); | ||
@@ -38,3 +40,3 @@ } | ||
credentials: 'include', | ||
body: method === 'POST' ? payload : undefined, | ||
body: method === 'POST' ? JSON.stringify(params ?? {}) : undefined, | ||
}); | ||
@@ -41,0 +43,0 @@ const json = await res.json().catch(() => ({})); |
{ | ||
"name": "@nodescript/protocomm", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"type": "module", | ||
@@ -31,3 +31,2 @@ "description": "Bi-directional transport-agnostic JSON-based messaging", | ||
], | ||
"author": "UBIO", | ||
"dependencies": { | ||
@@ -46,3 +45,13 @@ "airtight": "^4.2.0", | ||
"typescript": "^4.7.3" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/NodeScriptLang/protocomm.git" | ||
}, | ||
"keywords": [ | ||
"protocol" | ||
], | ||
"author": "UBIO", | ||
"license": "ISC", | ||
"homepage": "https://github.com/NodeScriptLang/protocomm#readme" | ||
} |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
35652
531
1
0