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

@highpoint/js-fetch

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@highpoint/js-fetch - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# v1.0.1
* Throw exception on authorization errors
# v1.0.0

@@ -2,0 +5,0 @@ * Add function to post raw, non-JSON content.

30

dist/js-fetch.js

@@ -31,3 +31,3 @@ 'use strict';

var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(response) {
var isOK;
var isOK, responseText, authFailed;
return regeneratorRuntime.wrap(function _callee$(_context) {

@@ -59,17 +59,29 @@ while (1) {

case 7:
_context.next = 9;
return response.text();
case 9:
responseText = _context.sent;
if (!(response.ok && isOK)) {
_context.next = 9;
_context.next = 15;
break;
}
return _context.abrupt('return', response.text());
authFailed = responseText.indexOf('Authorization Error') > -1;
case 9:
_context.next = 11;
return response.text();
if (!authFailed) {
_context.next = 14;
break;
}
case 11:
throw _context.sent;
throw new Error('Authorization Error');
case 12:
case 14:
return _context.abrupt('return', responseText);
case 15:
throw responseText;
case 16:
case 'end':

@@ -76,0 +88,0 @@ return _context.stop();

{
"name": "@highpoint/js-fetch",
"version": "1.0.0",
"version": "1.0.1",
"description": "HighPoint Fetch Library",

@@ -5,0 +5,0 @@ "main": "dist/js-fetch.js",

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