You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed a potential issue with the toJSON method's return type in the RealmObject class. According to the current TypeScript definition, the toJSON method is expected to return a DefaultObject. However, considering the generic type T used throughout the RealmObject<T> class, it seems more appropriate for toJSON to return a type T instead, especially since the method processes and returns a plain object representation of the instance.
It might be more accurate for the toJSON method to return a type T to reflect the actual data structure of the RealmObject instance. This change would align the method's return type with the generic type used in the class definition.
Could you please review this and consider updating the TypeScript definition if appropriate? Thank you for looking into this matter.
The text was updated successfully, but these errors were encountered:
I've noticed a potential issue with the
toJSON
method's return type in theRealmObject
class. According to the current TypeScript definition, thetoJSON
method is expected to return aDefaultObject
. However, considering the generic typeT
used throughout theRealmObject<T>
class, it seems more appropriate fortoJSON
to return a typeT
instead, especially since the method processes and returns a plain object representation of the instance.Current Implementation:
Source:
Object.ts#L383-L410
Documentation Reference:
RealmObject.toJSON
Suggested Change:
It might be more accurate for the
toJSON
method to return a typeT
to reflect the actual data structure of theRealmObject
instance. This change would align the method's return type with the generic type used in the class definition.Could you please review this and consider updating the TypeScript definition if appropriate? Thank you for looking into this matter.
The text was updated successfully, but these errors were encountered: