New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@idearium/fetch

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idearium/fetch - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # @idearium/fetch

### Fixed
- Fixed error when no content-type header is returned.
## v2.0.2
### Changed

@@ -7,0 +13,0 @@

6

index.js

@@ -6,3 +6,7 @@ 'use strict';

const parseBody = (response) => {
if (response.headers.get('Content-Type').includes('application/json')) {
if (
response.headers &&
response.headers.get('Content-Type') &&
response.headers.get('Content-Type').includes('application/json')
) {
return response.json();

@@ -9,0 +13,0 @@ }

2

package.json
{
"name": "@idearium/fetch",
"version": "2.0.2",
"version": "2.0.3",
"description": "A package to make fetching trivial.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -131,1 +131,13 @@ 'use strict';

});
it('does not fail if no content header is returned', async () => {
expect.assertions(1);
fetchMock.get(testUrl, { status: 400 });
await expect(fetchApi(testUrl)).resolves.toMatchObject({
ok: false,
result: {},
status: 400
});
});
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