mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 20:25:26 +00:00
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:
18
fields.js
18
fields.js
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user