Small refactoring

This commit is contained in:
barsdeveloper
2024-09-08 22:28:42 +02:00
parent 2114abef5c
commit 19ef3bd10e
43 changed files with 542 additions and 504 deletions

View File

@@ -29,8 +29,11 @@ export default class ArrayEntity extends IEntity {
P.reg(/\s*(,\s*)?\)/, 1),
).map(([_0, values, trailing]) => {
values = values instanceof Array ? values : []
const result = new this(values)
result.trailing = trailing !== undefined
let Self = this
if (trailing !== undefined != Self.trailing) {
Self = Self.flagTrailing()
}
const result = new Self(values)
return result
}).label(`ArrayEntity of ${this.type?.className() ?? "unknown values"}`)
}