cds-typer
cds-typer copied to clipboard
`Plural.drafts` could be `typeof Plural`
Currently, both the singular and the plural form of entities have a reference to .drafts
. This makes sense as they point to the same CSN entity during runtime and should be treated the same. So:
class Singular {
static drafts: typeof Singular
}
class Plural extends Array<Singular> {
static drafts: typeof Singular
}
This leads to confusion when the type should not actually matter:
SELECT.from(b ? Plural : Plural.drafts) // Singular | Plural -> no proper type support
Find out if there is a compelling argument against
class Plural extends Array<Singular> {
static drafts: typeof Plural
}
and if not implement this behaviour.