Skip to content

[Lex] .$isTypeOf is true when $type is undefined #5316

Description

@mozzius

The generated .$isTypeOf utility returns true when $type is missing/undefined. This makes the check looser than implied. social-app's legacy type utility dangerouslyIsType requires $type to be present. We'd like this behaviour in Lex codegen output too

Relevant code

isTypeOf<TValue extends Record<string, unknown>>(
value: TValue,
): value is MaybeTypedObject<TType, TValue> {
return value.$type === undefined || value.$type === this.$type
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions