Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snuffles

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snuffles - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3-0

26

dist/index.es.js

@@ -539,4 +539,9 @@ /**

var headers = _extends({
'Content-Type': 'application/json',
Accept: 'application/json'
}, defaultRequestOptions.headers);
this.baseUrl = baseUrl;
this.defaultRequestOptions = defaultRequestOptions;
this.defaultRequestOptions = _extends({}, defaultRequestOptions, { headers: headers });
this.metaOptions = new MetaOptions(_extends({}, defaultMetaOptions, metaOptions));

@@ -594,3 +599,3 @@ this.log = this.metaOptions.logger;

* @param {string} path the path of the request
* @param {Object} options optional options, sepcific for this single request
* @param {Object} options optional options, specific for this single request
* @return {Object} res camelCased response

@@ -636,8 +641,15 @@ */

}).then(function (res) {
var status = res.status;
var resultBase = { status: status, headers: res.headers, body: {} };
var contentLength = res.headers['map']['content-length'];
var contentType = res.headers['map']['content-type'];
if (contentLength <= 1 || contentType !== 'application/json') {
return resultBase;
}
return res.json().then(function (json) {
return {
status: res.status,
headers: res.headers,
body: json
};
return _extends({}, resultBase, { body: json });
});

@@ -644,0 +656,0 @@ }).then(function (parsedResponse) {

@@ -541,4 +541,9 @@ 'use strict';

var headers = _extends({
'Content-Type': 'application/json',
Accept: 'application/json'
}, defaultRequestOptions.headers);
this.baseUrl = baseUrl;
this.defaultRequestOptions = defaultRequestOptions;
this.defaultRequestOptions = _extends({}, defaultRequestOptions, { headers: headers });
this.metaOptions = new MetaOptions(_extends({}, defaultMetaOptions, metaOptions));

@@ -596,3 +601,3 @@ this.log = this.metaOptions.logger;

* @param {string} path the path of the request
* @param {Object} options optional options, sepcific for this single request
* @param {Object} options optional options, specific for this single request
* @return {Object} res camelCased response

@@ -638,8 +643,15 @@ */

}).then(function (res) {
var status = res.status;
var resultBase = { status: status, headers: res.headers, body: {} };
var contentLength = res.headers['map']['content-length'];
var contentType = res.headers['map']['content-type'];
if (contentLength <= 1 || contentType !== 'application/json') {
return resultBase;
}
return res.json().then(function (json) {
return {
status: res.status,
headers: res.headers,
body: json
};
return _extends({}, resultBase, { body: json });
});

@@ -646,0 +658,0 @@ }).then(function (parsedResponse) {

{
"name": "snuffles",
"version": "1.2.2",
"version": "1.2.3-0",
"description": "A wrapper around the native fetch function, returning the response body as a camelCased object",

@@ -5,0 +5,0 @@ "author": "railslove",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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