Linting
This commit is contained in:
parent
98963c1505
commit
f8da7a9f28
1 changed files with 8 additions and 10 deletions
|
@ -129,20 +129,18 @@ export function importToRows(
|
||||||
// the real schema of the table passed in, not the clone used for
|
// the real schema of the table passed in, not the clone used for
|
||||||
// incrementing auto IDs
|
// incrementing auto IDs
|
||||||
for (const [fieldName, schema] of Object.entries(originalTable.schema)) {
|
for (const [fieldName, schema] of Object.entries(originalTable.schema)) {
|
||||||
const rowVal = Array.isArray(row[fieldName]) ? row[fieldName] : [row[fieldName]]
|
const rowVal = Array.isArray(row[fieldName])
|
||||||
|
? row[fieldName]
|
||||||
|
: [row[fieldName]]
|
||||||
if (
|
if (
|
||||||
(schema.type === FieldTypes.OPTIONS ||
|
(schema.type === FieldTypes.OPTIONS ||
|
||||||
schema.type === FieldTypes.ARRAY) &&
|
schema.type === FieldTypes.ARRAY) &&
|
||||||
row[fieldName]
|
row[fieldName]
|
||||||
) {
|
) {
|
||||||
|
let merged = [...schema.constraints!.inclusion!, ...rowVal]
|
||||||
let merged = [
|
|
||||||
...schema.constraints!.inclusion!,
|
let superSet = new Set(merged)
|
||||||
...rowVal
|
schema.constraints!.inclusion = Array.from(superSet)
|
||||||
]
|
|
||||||
|
|
||||||
let superSet = new Set(merged);
|
|
||||||
schema.constraints!.inclusion = Array.from(superSet);
|
|
||||||
|
|
||||||
schema.constraints!.inclusion.sort()
|
schema.constraints!.inclusion.sort()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue