Added StringField class for transitType field;

Added parsing specific for transit inside _patch method that throws
Renamed fields.area in fieldsName
This commit is contained in:
alexandercerutti
2018-08-26 12:05:15 +02:00
parent 6b4ec893d8
commit 04b5058f3a
3 changed files with 28 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ const schema = require("./schema");
* @see https://apple.co/2wkUBd
*/
class FieldsArea {
class FieldsContainer {
constructor() {
this.fields = [];
}
@@ -57,7 +57,21 @@ class FieldsArea {
}
}
class StringField {
set transitType(v) {
if (schema.isValid(v, schema.constants.transitType, true)) {
this.fields = v;
} else {
this.fields = this.fields && this.fields !== "" ? this.fields : "";
}
}
get transitType() {
return this.fields;
}
}
module.exports = {
areas: ["primaryFields", "secondaryFields", "auxiliaryFields", "backFields", "headerFields"],
FieldsArea
FieldsContainer,
StringField
};