@hylid/call
Advanced tools
Comparing version 2.12.0-alpha.41 to 3.0.0-alpha.1
@@ -29,9 +29,7 @@ var loadAppxBridge = function loadAppxBridge(cb) { | ||
complete = _a.complete; | ||
// @ts-ignore | ||
if ((res === null || res === void 0 ? void 0 : res.error) || (res === null || res === void 0 ? void 0 : res.errorCode) || (res === null || res === void 0 ? void 0 : res.errorMessage)) { | ||
fail === null || fail === void 0 ? void 0 : fail(res); | ||
} else { | ||
success === null || success === void 0 ? void 0 : success(res); | ||
} | ||
complete === null || complete === void 0 ? void 0 : complete(res); | ||
var data = res.data, | ||
type = res.type; | ||
if (type === 'success') success === null || success === void 0 ? void 0 : success(data); | ||
if (type === 'fail') fail === null || fail === void 0 ? void 0 : fail(data); | ||
if (type === 'complete') complete === null || complete === void 0 ? void 0 : complete(data); | ||
}; | ||
@@ -38,0 +36,0 @@ export var mpWebCall = function () { |
@@ -182,13 +182,20 @@ var __assign = this && this.__assign || function () { | ||
var options = __assign(__assign({}, _options), { | ||
success: resolve, | ||
success: function success(res) { | ||
resolve({ | ||
type: 'success', | ||
data: res | ||
}); | ||
}, | ||
fail: function fail(res) { | ||
if (!res || !res.error) { | ||
resolve(__assign({ | ||
error: "".concat(api, " error") | ||
}, res)); | ||
} else { | ||
resolve(res); | ||
} | ||
resolve({ | ||
type: 'fail', | ||
data: res | ||
}); | ||
}, | ||
complete: resolve | ||
complete: function complete(res) { | ||
resolve({ | ||
type: 'complete', | ||
data: res | ||
}); | ||
} | ||
}); | ||
@@ -198,3 +205,7 @@ // @ts-ignore | ||
if (type === 'sync') { | ||
resolve(mpApi(options)); | ||
var data_1 = mpApi(_options); | ||
resolve({ | ||
type: 'success', | ||
data: data_1 | ||
}); | ||
} | ||
@@ -201,0 +212,0 @@ if (type === 'async') { |
{ | ||
"name": "@hylid/call", | ||
"version": "2.12.0-alpha.41", | ||
"version": "3.0.0-alpha.1", | ||
"main": "lib/index.js", | ||
@@ -9,4 +9,4 @@ "files": [ | ||
"dependencies": { | ||
"@hylid/env": "^2.12.0-alpha.41", | ||
"@hylid/types": "^2.12.0-alpha.41" | ||
"@hylid/env": "^3.0.0-alpha.1", | ||
"@hylid/types": "^3.0.0-alpha.1" | ||
}, | ||
@@ -13,0 +13,0 @@ "publishConfig": { |
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
14635
461
+ Added@hylid/env@3.2.6(transitive)
+ Added@hylid/types@3.2.6(transitive)
- Removed@hylid/env@2.12.0-alpha.41(transitive)
- Removed@hylid/types@2.12.0-alpha.41(transitive)
Updated@hylid/env@^3.0.0-alpha.1
Updated@hylid/types@^3.0.0-alpha.1