Made minimum variable name 2 characters long

This commit is contained in:
Thaum Rystra
2020-05-28 21:26:31 +02:00
parent 36c23e1eb5
commit d4804e5292
3 changed files with 5 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ let AttributeSchema = new SimpleSchema({
variableName: { variableName: {
type: String, type: String,
regEx: VARIABLE_NAME_REGEX, regEx: VARIABLE_NAME_REGEX,
min: 3, min: 2,
defaultValue: 'newAttribute', defaultValue: 'newAttribute',
}, },
// How it is displayed and computed is determined by type // How it is displayed and computed is determined by type

View File

@@ -9,6 +9,7 @@ let ClassLevelSchema = new SimpleSchema({
// The name of this class level's variable // The name of this class level's variable
variableName: { variableName: {
type: String, type: String,
min: 2,
regEx: VARIABLE_NAME_REGEX, regEx: VARIABLE_NAME_REGEX,
}, },
level: { level: {

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema'; import SimpleSchema from 'simpl-schema';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
/* /*
* Skills are anything that results in a modifier to be added to a D20 * Skills are anything that results in a modifier to be added to a D20
@@ -13,7 +14,8 @@ let SkillSchema = new SimpleSchema({
// Ignored for skilltype = save // Ignored for skilltype = save
variableName: { variableName: {
type: String, type: String,
regEx: /^\w*[a-z]\w*$/i, regEx: VARIABLE_NAME_REGEX,
min: 2,
}, },
// The variable name of the ability this skill relies on // The variable name of the ability this skill relies on
ability: { ability: {