Comparing version 1.19.10 to 1.19.11
@@ -361,5 +361,6 @@ "use strict"; | ||
} | ||
var result = (_a = beforeFn === null || beforeFn === void 0 ? void 0 : beforeFn.apply) === null || _a === void 0 ? void 0 : _a.call(beforeFn, this, opts); | ||
if (typeof result === "object" && typeof (result === null || result === void 0 ? void 0 : result.then) === "function") { | ||
var that_2 = this; | ||
var that = this; | ||
var currentResult = (_a = fn === null || fn === void 0 ? void 0 : fn.apply) === null || _a === void 0 ? void 0 : _a.call(fn, that, opts); | ||
if (typeof currentResult === "object" && | ||
typeof (currentResult === null || currentResult === void 0 ? void 0 : currentResult.then) === "function") { | ||
return (function runLifetimes() { | ||
@@ -370,6 +371,6 @@ var _a; | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, result]; | ||
case 0: return [4 /*yield*/, currentResult]; | ||
case 1: | ||
_b.sent(); | ||
return [4 /*yield*/, ((_a = fn === null || fn === void 0 ? void 0 : fn.apply) === null || _a === void 0 ? void 0 : _a.call(fn, that_2, opts))]; | ||
return [4 /*yield*/, ((_a = beforeFn === null || beforeFn === void 0 ? void 0 : beforeFn.apply) === null || _a === void 0 ? void 0 : _a.call(beforeFn, that, opts))]; | ||
case 2: return [2 /*return*/, _b.sent()]; | ||
@@ -381,5 +382,5 @@ } | ||
} | ||
return (_b = fn === null || fn === void 0 ? void 0 : fn.apply) === null || _b === void 0 ? void 0 : _b.call(fn, this, opts); | ||
return (_b = beforeFn === null || beforeFn === void 0 ? void 0 : beforeFn.apply) === null || _b === void 0 ? void 0 : _b.call(beforeFn, that, opts); | ||
}; | ||
} | ||
exports.extendLifetime = extendLifetime; |
{ | ||
"name": "mipp-ali", | ||
"version": "1.19.10", | ||
"version": "1.19.11", | ||
"description": "小程序ts", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -323,14 +323,18 @@ import rfdc from "rfdc"; | ||
UIInterface.lifetimes[methodName] = function newLifetime(...opts) { | ||
const result = beforeFn?.apply?.(this, opts); | ||
const that = this; | ||
if (typeof result === "object" && typeof result?.then === "function") { | ||
const that = this; | ||
const currentResult = fn?.apply?.(that, opts); | ||
if ( | ||
typeof currentResult === "object" && | ||
typeof currentResult?.then === "function" | ||
) { | ||
return (async function runLifetimes() { | ||
await result; | ||
return await fn?.apply?.(that, opts); | ||
await currentResult; | ||
return await beforeFn?.apply?.(that, opts); | ||
})(); | ||
} | ||
return fn?.apply?.(this, opts); | ||
return beforeFn?.apply?.(that, opts); | ||
}; | ||
} |
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
672782
23484