fields.flat code example
Example 1: fields.flat is not a function
static normalizeFields(...fields) {
return fields
.reduce((acc, val) => acc.concat(val), [])
.map(field =>
this.normalizeField(
field && field.name,
field && field.value,
field && typeof field.inline === 'boolean' ? field.inline : false,
),
);
}
Example 2: fields.flat is not a function
static normalizeFields(...fields) {
return fields
.reduce((acc, val) => acc.concat(val), [])
.map(field =>
this.normalizeField(
field && field.name,
field && field.value,
field && typeof field.inline === 'boolean' ? field.inline : false,
),
);
}