Renamed 'quantity' argument in 'amount' in fields

This commit is contained in:
alexandercerutti
2018-09-09 16:00:17 +02:00
parent 4e1bc5c3fb
commit fba65ed639

View File

@@ -50,15 +50,15 @@ class FieldsContainer {
* @returns {Number} - the amount of removed elements
*/
pop(quantity = -1) {
pop(amount = -1) {
if (!this.fields.length) {
return undefined;
}
if (quantity > -1) {
let removedElements = this.fields.slice(quantity);
this.fields = this.fields.slice(0, this.fields.length - quantity);
this.uniqueKeys = this.uniqueKeys.slice(0, this.uniqueKeys - quantity);
if (amount > -1) {
let removedElements = this.fields.slice(amount);
this.fields = this.fields.slice(0, this.fields.length - amount);
this.uniqueKeys = this.uniqueKeys.slice(0, this.uniqueKeys - amount);
return removedElements;
}