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:
Kræn Hansen 2018-02-16 10:27:30 +01:00 committed by Kenneth Geisshirt
parent 1ad557b47f
commit fdf9497bdd

4
lib/index.d.ts vendored
View File

@ -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