mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-12 07:14:23 +00:00
Fixing objectForPrimaryKey return type (#1664)
According to https://github.com/realm/realm-js/blob/master/docs/realm.js#L171 and runtime behaviour it returns `undefined` not `null` if the object doesn't exist.
This commit is contained in:
parent
1ad557b47f
commit
fdf9497bdd
4
lib/index.d.ts
vendored
4
lib/index.d.ts
vendored
@ -545,9 +545,9 @@ declare class Realm {
|
||||
/**
|
||||
* @param {string|Realm.ObjectSchema|Function} type
|
||||
* @param {number|string} key
|
||||
* @returns T
|
||||
* @returns {T | undefined}
|
||||
*/
|
||||
objectForPrimaryKey<T>(type: string | Realm.ObjectSchema | Function, key: number | string): T | null;
|
||||
objectForPrimaryKey<T>(type: string | Realm.ObjectSchema | Function, key: number | string): T | undefined;
|
||||
|
||||
/**
|
||||
* @param {string|Realm.ObjectType|Function} type
|
||||
|
Loading…
x
Reference in New Issue
Block a user