Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mustBeCool: CustomRule = (value: string) => value.indexOf('cool') >= 0
const mustBeCool2: CustomRule = (value: string) => !helpers.req(value) || value.indexOf('cool') >= 0
const contains = (param: string): CustomRule =>
(value: string) => !helpers.req(value) || value.indexOf(param) >= 0
const mustBeCool3 = helpers.withParams(
{ type: 'mustBeCool3' },
(value: any) => !helpers.req(value) || value.indexOf('cool') >= 0
)
const mustBeCool3Result: boolean = mustBeCool3(50)
const mustBeCool4 = helpers.regex('mustBeCool4', /^.*cool.*$/)
const mustBeSame = (reference: string) => helpers.withParams(
{ type: 'mustBeSame' },
(value: any, parentVm?: Vue) =>
value === helpers.ref(reference, self, parentVm)
)
const mustHaveLength = (minLen: number) => helpers.withParams(
{ type: 'mustHaveLength' },
(value: any) =>
helpers.len(value) > minLen
)
@Component({
validations: {
password: {
import RegisterService from '../RegisterService.vue';
import LoginModalService from '../LoginModalService.vue';
import TranslationService from '../../../locale/TranslationService.vue';
import { required, minLength, maxLength, helpers, email } from 'vuelidate/lib/validators';
import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from '../../../constants';
const loginPattern = helpers.regex('alpha', /^[_.@A-Za-z0-9-]*$/);
const Register = {
name: 'Register',
mixins: [RegisterService, LoginModalService, TranslationService],
data() {
return {
confirmPassword: undefined,
doNotMatch: undefined,
error: undefined,
errorEmailExists: undefined,
errorUserExists: undefined,
registerAccount: {
login: undefined,
email: undefined,
password: undefined
},