@ygkit/request
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -67,15 +67,3 @@ import { getProp } from '@ygkit/object'; | ||
function waitResponse(_a) { | ||
var callback = _a.callback, targetProp = _a.targetProp, | ||
// wait status | ||
targetResponse = _a.targetResponse, | ||
// timeout mini seconds | ||
timeout = _a.timeout, _b = _a.loopGap, loopGap = _b === void 0 ? 1000 : _b, | ||
// start mini seconds | ||
_c = _a.start, | ||
// start mini seconds | ||
start = _c === void 0 ? Date.now() : _c, | ||
// promise resolve | ||
resolve = _a.resolve, | ||
// promise reject | ||
reject = _a.reject; | ||
var callback = _a.callback, targetProp = _a.targetProp, targetResponse = _a.targetResponse, timeout = _a.timeout, _b = _a.loopGap, loopGap = _b === void 0 ? 1000 : _b, _c = _a.start, start = _c === void 0 ? Date.now() : _c, resolve = _a.resolve, reject = _a.reject; | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -87,3 +75,3 @@ var now; | ||
return [2 /*return*/, new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () { | ||
var response, prop, e_1; | ||
var response, propVal, e_1; | ||
return __generator(this, function (_a) { | ||
@@ -102,8 +90,5 @@ switch (_a.label) { | ||
response = _a.sent(); | ||
if (!targetResponse) return [3 /*break*/, 5]; | ||
if (!targetProp) { | ||
reject(new Error('Unknow target response property')); | ||
} | ||
prop = getProp(response, targetProp); | ||
if (!(response && prop === targetResponse)) return [3 /*break*/, 2]; | ||
if (!targetProp) return [3 /*break*/, 5]; | ||
propVal = getProp(response, targetProp); | ||
if (!(response && propVal === targetResponse)) return [3 /*break*/, 2]; | ||
resolve(response); | ||
@@ -110,0 +95,0 @@ return [3 /*break*/, 4]; |
@@ -71,15 +71,3 @@ (function (global, factory) { | ||
function waitResponse(_a) { | ||
var callback = _a.callback, targetProp = _a.targetProp, | ||
// wait status | ||
targetResponse = _a.targetResponse, | ||
// timeout mini seconds | ||
timeout = _a.timeout, _b = _a.loopGap, loopGap = _b === void 0 ? 1000 : _b, | ||
// start mini seconds | ||
_c = _a.start, | ||
// start mini seconds | ||
start = _c === void 0 ? Date.now() : _c, | ||
// promise resolve | ||
resolve = _a.resolve, | ||
// promise reject | ||
reject = _a.reject; | ||
var callback = _a.callback, targetProp = _a.targetProp, targetResponse = _a.targetResponse, timeout = _a.timeout, _b = _a.loopGap, loopGap = _b === void 0 ? 1000 : _b, _c = _a.start, start = _c === void 0 ? Date.now() : _c, resolve = _a.resolve, reject = _a.reject; | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -91,3 +79,3 @@ var now; | ||
return [2 /*return*/, new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () { | ||
var response, prop, e_1; | ||
var response, propVal, e_1; | ||
return __generator(this, function (_a) { | ||
@@ -106,8 +94,5 @@ switch (_a.label) { | ||
response = _a.sent(); | ||
if (!targetResponse) return [3 /*break*/, 5]; | ||
if (!targetProp) { | ||
reject(new Error('Unknow target response property')); | ||
} | ||
prop = object.getProp(response, targetProp); | ||
if (!(response && prop === targetResponse)) return [3 /*break*/, 2]; | ||
if (!targetProp) return [3 /*break*/, 5]; | ||
propVal = object.getProp(response, targetProp); | ||
if (!(response && propVal === targetResponse)) return [3 /*break*/, 2]; | ||
resolve(response); | ||
@@ -114,0 +99,0 @@ return [3 /*break*/, 4]; |
{ | ||
"name": "@ygkit/request", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Node request utils", | ||
@@ -34,5 +34,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@ygkit/object": "0.0.2" | ||
"@ygkit/object": "0.0.3" | ||
}, | ||
"gitHead": "f33075892761e7c864fefaebf237e040b055435f" | ||
"gitHead": "2f1033422a89856cd4535c2b92c6d0247d4310a9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63981
547
+ Added@ygkit/object@0.0.3(transitive)
- Removed@ygkit/object@0.0.2(transitive)
Updated@ygkit/object@0.0.3