Comparing version 1.18.21 to 1.19.0
@@ -60,3 +60,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.lifetimes = exports.pageLifetime = exports.method = void 0; | ||
exports.lifetime = exports.lifetimes = exports.pageLifetime = exports.method = void 0; | ||
var rfdc_1 = __importDefault(require("rfdc")); | ||
@@ -237,3 +237,3 @@ var lifetimesMappings = { | ||
function method(UIInterface, methodName, descriptor) { | ||
if (!UIInterface.methods) { | ||
if (!UIInterface.hasOwnProperty("methods")) { | ||
UIInterface.methods = Object.create(null); | ||
@@ -253,29 +253,22 @@ } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var result; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
if (!(this === null || this === void 0 ? void 0 : this.$page)) { | ||
this.$page = Object.create(null); | ||
} | ||
if (!((_a = this === null || this === void 0 ? void 0 : this.$page) === null || _a === void 0 ? void 0 : _a.pageShow)) { | ||
this.$page.pageShow = []; | ||
} | ||
if (!((_b = this === null || this === void 0 ? void 0 : this.$page) === null || _b === void 0 ? void 0 : _b.pageHide)) { | ||
this.$page.pageHide = []; | ||
} | ||
if (methodName === "show") { | ||
this.$page.pageShow.push(descriptor.value.bind(this)); | ||
} | ||
if (methodName === "hide") { | ||
this.$page.pageHide.push(descriptor.value.bind(this)); | ||
} | ||
if (typeof onInit !== "function") { | ||
return [2 /*return*/]; | ||
} | ||
return [4 /*yield*/, onInit.apply(this, opts)]; | ||
case 1: | ||
result = _c.sent(); | ||
return [2 /*return*/, result]; | ||
if (!(this === null || this === void 0 ? void 0 : this.$page)) { | ||
this.$page = Object.create(null); | ||
} | ||
if (!((_a = this === null || this === void 0 ? void 0 : this.$page) === null || _a === void 0 ? void 0 : _a.pageShow)) { | ||
this.$page.pageShow = []; | ||
} | ||
if (!((_b = this === null || this === void 0 ? void 0 : this.$page) === null || _b === void 0 ? void 0 : _b.pageHide)) { | ||
this.$page.pageHide = []; | ||
} | ||
if (methodName === "show") { | ||
this.$page.pageShow.push(descriptor.value.bind(this)); | ||
} | ||
if (methodName === "hide") { | ||
this.$page.pageHide.push(descriptor.value.bind(this)); | ||
} | ||
if (typeof onInit !== "function") { | ||
return [2 /*return*/]; | ||
} | ||
return [2 /*return*/, onInit.apply(this, opts)]; | ||
}); | ||
@@ -287,3 +280,3 @@ }); | ||
function lifetimes(UIInterface, methodName, descriptor) { | ||
if (!UIInterface.lifetimes) { | ||
if (!UIInterface.hasOwnProperty("lifetimes")) { | ||
UIInterface.lifetimes = Object.create(null); | ||
@@ -317,1 +310,8 @@ } | ||
exports.lifetimes = lifetimes; | ||
function lifetime(UIInterface, methodName, descriptor) { | ||
if (!UIInterface.hasOwnProperty("lifetimes")) { | ||
UIInterface.lifetimes = Object.create(null); | ||
} | ||
UIInterface.lifetimes[methodName] = descriptor.value; | ||
} | ||
exports.lifetime = lifetime; |
{ | ||
"name": "mipp-ali", | ||
"version": "1.18.21", | ||
"version": "1.19.0", | ||
"description": "小程序ts", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -171,3 +171,3 @@ import clone from "rfdc"; | ||
) { | ||
if (!UIInterface.methods) { | ||
if (!UIInterface.hasOwnProperty("methods")) { | ||
UIInterface.methods = Object.create(null); | ||
@@ -209,5 +209,3 @@ } | ||
const result = await onInit.apply(this, opts); | ||
return result; | ||
return onInit.apply(this, opts); | ||
}; | ||
@@ -221,3 +219,3 @@ } | ||
) { | ||
if (!UIInterface.lifetimes) { | ||
if (!UIInterface.hasOwnProperty("lifetimes")) { | ||
UIInterface.lifetimes = Object.create(null); | ||
@@ -237,1 +235,13 @@ } | ||
} | ||
export function lifetime( | ||
UIInterface, | ||
methodName, | ||
descriptor: PropertyDescriptor | ||
) { | ||
if (!UIInterface.hasOwnProperty("lifetimes")) { | ||
UIInterface.lifetimes = Object.create(null); | ||
} | ||
UIInterface.lifetimes[methodName] = descriptor.value; | ||
} |
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
663032
23264