UNPKG

cloud-ide-lms-model

Version:

Package for Model management of Cloud IDEsys LMS

33 lines (32 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MRegister = void 0; /* INTERFACE END */ /* MODEL START */ class MRegister { constructor(init) { Object.assign(this, init); } Validate() { var _a, _b; let errorLogger = []; if (!this.user_username) { errorLogger.push({ control: "user_username", message: "Username is Required" }); } /* if password is selected by user */ if (this.user_password) { /* Check wether length is in between 8 to 50 or not */ if (((_a = this.user_password) === null || _a === void 0 ? void 0 : _a.length) < 8 || ((_b = this.user_password) === null || _b === void 0 ? void 0 : _b.length) > 50) { errorLogger.push({ control: "user_password", message: "Password is Invalid!" }); } } return errorLogger; } } exports.MRegister = MRegister;