diff --git a/serializer.js b/serializer.js index 91d41cd..c3e93d7 100644 --- a/serializer.js +++ b/serializer.js @@ -111,6 +111,23 @@ class Serializer { } } + /** + * removeField + * + * @param {(HTMLElement|Serializer|SerializerField)} f Serializer child + */ + removeField(f){ + if(this._fields.has(f.name)){ + let fields = this._fields.get(f.name) + if(Array.isArray(fields)){ + let index = fields.indexOf(f); + this._fields.set(f.name, fields.splice(index, 1)) + } else { + this._fields.delete(); + } + } + } + /** * serialize *