Skip to content

Commit fae1bf0

Browse files
committed
Removed unneeded use of _.isArray with _.isObjectLike
1 parent cc49b11 commit fae1bf0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/v1/providers/database.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export class DataSnapshot {
476476
// Null value
477477
return false;
478478
}
479-
if ((_.isObjectLike(val) || _.isArray(val)) && _.isEmpty(val)) {
479+
if (_.isObjectLike(val) && _.isEmpty(val)) {
480480
// Empty object/array
481481
return false;
482482
}
@@ -521,7 +521,7 @@ export class DataSnapshot {
521521
*/
522522
forEach(action: (a: DataSnapshot) => boolean | void): boolean {
523523
const val = this.val();
524-
if (_.isObjectLike(val) || _.isArray(val)) {
524+
if (_.isObjectLike(val)) {
525525
return _.some(
526526
val,
527527
(value, key: string) => action(this.child(key)) === true
@@ -555,7 +555,7 @@ export class DataSnapshot {
555555
*/
556556
hasChildren(): boolean {
557557
const val = this.val();
558-
return (_.isObjectLike(val) || _.isArray(val)) && !_.isEmpty(val);
558+
return _.isObjectLike(val) && !_.isEmpty(val);
559559
}
560560

561561
/**
@@ -565,7 +565,7 @@ export class DataSnapshot {
565565
*/
566566
numChildren(): number {
567567
const val = this.val();
568-
return _.isObjectLike(val) || _.isArray(val) ? _.keys(val).length : 0;
568+
return _.isObjectLike(val) ? _.keys(val).length : 0;
569569
}
570570

571571
/**

0 commit comments

Comments
 (0)