Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 4f6afea

Browse files
docs(database): explain utility methods
1 parent 3c0df75 commit 4f6afea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/database.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,17 @@ export class AngularFireOfflineDatabase {
294294
});
295295
}
296296
}
297-
297+
/**
298+
* Utility function used to check if an value exists.
299+
*/
298300
export function isNil(obj: any): boolean {
299301
return obj === undefined || obj === null;
300302
}
301-
303+
/**
304+
* The AngularFire2 unwrap function.
305+
*
306+
* Adds the properies of `$key`, `$value`, `$exists` as required by AngularFire2
307+
*/
302308
export function unwrap(key: string, value: any, exists) {
303309
let unwrapped = !isNil(value) ? value : { $value: null };
304310
if ((/string|number|boolean/).test(typeof value)) {

0 commit comments

Comments
 (0)