Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validateNumber: (value, requirement) => value === requirement,
messages: {
ja: '%sになるように入力してください',
},
});
Parsley.addValidator('ne', {
requirementType: 'integer',
validateNumber: (value, requirement) => value !== requirement,
messages: {
ja: '%s以外の数値を入力してください',
},
});
Parsley.addValidator('positiveInteger', {
requirementType: 'digits',
validateString: value => parseInteger(value).toString() === value && parseInteger(value) >= 0,
messages: {
ja: '不正な数値形式です',
},
});
}
static addCustomValidator() {
Parsley.addValidator('eq', {
requirementType: 'integer',
validateNumber: (value, requirement) => value === requirement,
messages: {
ja: '%sになるように入力してください',
},
});
Parsley.addValidator('ne', {
requirementType: 'integer',
validateNumber: (value, requirement) => value !== requirement,
messages: {
ja: '%s以外の数値を入力してください',
},
});
static addCustomValidator() {
Parsley.addValidator('eq', {
requirementType: 'integer',
validateNumber: (value, requirement) => value === requirement,
messages: {
ja: '%sになるように入力してください',
},
});
Parsley.addValidator('ne', {
requirementType: 'integer',
validateNumber: (value, requirement) => value !== requirement,
messages: {
ja: '%s以外の数値を入力してください',
},
});
Parsley.addValidator('positiveInteger', {
requirementType: 'digits',
validateString: value => parseInteger(value).toString() === value && parseInteger(value) >= 0,
messages: {
ja: '不正な数値形式です',
},
});
}