Skip to content

Commit

Permalink
Revert "Updated type of action parameter for DataSnapshot#forEach" (#…
Browse files Browse the repository at this point in the history
…6536)

* Revert "Updated type of action parameter for DataSnapshot#forEach (#6374)"

This reverts commit 6583808.
  • Loading branch information
maneesht committed Aug 17, 2022
1 parent b6c231a commit 9f1e3c6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .changeset/orange-doors-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@firebase/database-compat": patch
"@firebase/database-types": patch
"@firebase/database": patch
---

Revert "Updated type of action parameter for DataSnapshot#forEach"
4 changes: 1 addition & 3 deletions common/api-review/database.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export class DataSnapshot {
child(path: string): DataSnapshot;
exists(): boolean;
exportVal(): any;
forEach(action: (child: DataSnapshot & {
key: string;
}) => boolean | void): boolean;
forEach(action: (child: DataSnapshot) => boolean | void): boolean;
hasChild(path: string): boolean;
hasChildren(): boolean;
get key(): string | null;
Expand Down
4 changes: 1 addition & 3 deletions packages/database-compat/src/api/Reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ export class DataSnapshot implements Compat<ModularDataSnapshot> {
* @returns True if forEach was canceled by action returning true for
* one of the child nodes.
*/
forEach(
action: (snapshot: DataSnapshot & { key: string }) => boolean | void
): boolean {
forEach(action: (snapshot: DataSnapshot) => boolean | void): boolean {
validateArgCount('DataSnapshot.forEach', 1, 1, arguments.length);
validateCallback('DataSnapshot.forEach', 'action', action, false);
return this._delegate.forEach(expDataSnapshot =>
Expand Down
4 changes: 1 addition & 3 deletions packages/database-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export interface DataSnapshot {
child(path: string): DataSnapshot;
exists(): boolean;
exportVal(): any;
forEach(
action: (a: DataSnapshot & { key: string }) => boolean | void
): boolean;
forEach(action: (a: DataSnapshot) => boolean | void): boolean;
getPriority(): string | number | null;
hasChild(path: string): boolean;
hasChildren(): boolean;
Expand Down
4 changes: 1 addition & 3 deletions packages/database/src/api/Reference_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ export class DataSnapshot {
* @returns true if enumeration was canceled due to your callback returning
* true.
*/
forEach(
action: (child: DataSnapshot & { key: string }) => boolean | void
): boolean {
forEach(action: (child: DataSnapshot) => boolean | void): boolean {
if (this._node.isLeafNode()) {
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions packages/firebase/compat/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5819,9 +5819,7 @@ declare namespace firebase.database {
* returning true.
*/
forEach(
action: (
a: firebase.database.DataSnapshot & { key: string }
) => boolean | void
action: (a: firebase.database.DataSnapshot) => boolean | void
): boolean;
/**
* Gets the priority value of the data in this `DataSnapshot`.
Expand Down

0 comments on commit 9f1e3c6

Please sign in to comment.