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

karl-common-util

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karl-common-util - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

32

dist/http/index.js

@@ -234,4 +234,6 @@ "use strict";

withMd5Sign = _ref2.withMd5Sign,
mode = _ref2.mode;
var jwt, response;
mode = _ref2.mode,
_ref2$retryInterval = _ref2.retryInterval,
retryInterval = _ref2$retryInterval === undefined ? 0 : _ref2$retryInterval;
var jwt, response, intervalPromise;
return regeneratorRuntime.async(function _callee3$(_context3) {

@@ -249,3 +251,3 @@ while (1) {

if (!(times > 0)) {
_context3.next = 19;
_context3.next = 23;
break;

@@ -279,7 +281,21 @@ }

if (!(times > 0)) {
_context3.next = 18;
_context3.next = 22;
break;
}
_context3.next = 15;
if (!(retryInterval > 0)) {
_context3.next = 17;
break;
}
intervalPromise = new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, retryInterval);
});
_context3.next = 17;
return regeneratorRuntime.awrap(intervalPromise);
case 17:
_context3.next = 19;
return regeneratorRuntime.awrap(request({

@@ -299,9 +315,9 @@ url: url,

case 15:
case 19:
return _context3.abrupt("return", _context3.sent);
case 18:
case 22:
throw _context3.t0;
case 19:
case 23:
case "end":

@@ -308,0 +324,0 @@ return _context3.stop();

{
"name": "karl-common-util",
"version": "1.7.0",
"version": "1.7.1",
"description": "karl common lib for client and server",

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

@@ -34,3 +34,6 @@ import "isomorphic-fetch"

let doFetch = async ({url, data = {}, method, timeout = 10000, headers = {}, contentType = "application/json; charset=utf-8", isBrowser = true, withMd5Sign = false, mode}) => {
let doFetch = async ({
url, data = {}, method, timeout = 10000, headers = {}, contentType = "application/json; charset=utf-8", isBrowser = true, withMd5Sign = false,
mode
}) => {

@@ -146,3 +149,3 @@ //如果是浏览器,则自动识别跨域模式

let request = async ({url, jwtLocalStorageName, data, timeout, headers, contentType, method, isBrowser, times = 1, withMd5Sign, mode}) => {
let request = async ({url, jwtLocalStorageName, data, timeout, headers, contentType, method, isBrowser, times = 1, withMd5Sign, mode, retryInterval = 0}) => {
if (jwtLocalStorageName !== undefined) {

@@ -171,2 +174,11 @@ //附加jwt到http header

if (times > 0) {
if (retryInterval > 0) {
let intervalPromise = new Promise(resolve => {
setTimeout(() => {
resolve()
}, retryInterval)
})
await intervalPromise
}
return await request({

@@ -173,0 +185,0 @@ url: url,

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