Socket
Socket
Sign inDemoInstall

@parameter1/micro

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parameter1/micro - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

4

package.json
{
"name": "@parameter1/micro",
"version": "2.3.1",
"version": "2.3.2",
"type": "module",

@@ -36,3 +36,3 @@ "description": "A wrapper for running JSON-based microservices.",

},
"gitHead": "841391bb5d6feb967be2e33f06cd4d9bb5411a1a"
"gitHead": "21805b741fbed33792a6021d263f13860a7aecb2"
}

@@ -6,3 +6,8 @@ import fetch from 'node-fetch';

export default ({ url, headers: globalHeaders, stringify = JSON.stringify } = {}) => {
export default ({
url,
headers: globalHeaders,
parse = JSON.parse,
stringify = JSON.stringify,
} = {}) => {
if (!url) throw createError(500, 'No service URL was provided.');

@@ -30,7 +35,8 @@

});
const json = await res.json();
if (!res.ok) throw createError(res.status, json.message);
return json.data;
const text = await res.text();
const parsed = parse(text);
if (!res.ok) throw createError(res.status, parsed.message);
return parsed.data;
},
});
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc