Only identify Struct as empty when it has no keys. (#6092)
* Fix isEmpty on Struct * Improve code
This commit is contained in:
@@ -154,16 +154,10 @@ export class Struct<
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the value is an empty value
|
||||
* @description Checks if the value is an empty value '{}'
|
||||
*/
|
||||
public get isEmpty (): boolean {
|
||||
for (const v of this.values()) {
|
||||
if (!v.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return [...this.keys()].length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user