Skip to content

Commit ad28ffa

Browse files
authored
Undo changed order of parameters for DeltaSnapshot constructor (#139)
1 parent ea4b0e5 commit ad28ffa

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spec/providers/database.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ describe('DeltaSnapshot', () => {
185185
subject = new database.DeltaSnapshot(
186186
apps.admin,
187187
apps.admin,
188-
instance,
189188
old,
190189
change,
191-
path
190+
path,
191+
instance
192192
);
193193
};
194194

@@ -424,10 +424,10 @@ describe('DeltaSnapshot', () => {
424424
const snapshot = new database.DeltaSnapshot(
425425
apps.admin,
426426
apps.admin,
427-
instance,
428427
null,
429428
null,
430-
path
429+
path,
430+
instance
431431
);
432432
expect(snapshot.key).to.be.null;
433433
});
@@ -437,10 +437,10 @@ describe('DeltaSnapshot', () => {
437437
expect(new database.DeltaSnapshot(
438438
apps.admin,
439439
apps.admin,
440-
instance,
441440
null,
442441
{},
443-
path
442+
path,
443+
instance
444444
).key).to.be.null;
445445
});
446446

src/providers/database.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ export class RefBuilder {
125125
return new DeltaSnapshot(
126126
this.apps.forMode(raw.auth),
127127
this.apps.admin,
128-
dbInstance,
129128
raw.data.data,
130129
raw.data.delta,
131130
path,
131+
dbInstance
132132
);
133133
};
134134
return makeCloudFunction({
@@ -173,10 +173,10 @@ export class DeltaSnapshot {
173173
constructor(
174174
private app: firebase.app.App,
175175
private adminApp: firebase.app.App,
176-
private instance: string,
177176
data: any,
178177
delta: any,
179-
path?: string // path will be undefined for the database root
178+
path?: string, // path will be undefined for the database root
179+
public instance?: string,
180180
) {
181181
if (delta !== undefined) {
182182
this._path = path;
@@ -311,7 +311,7 @@ export class DeltaSnapshot {
311311
}
312312

313313
private _dup(previous: boolean, childPath?: string): DeltaSnapshot {
314-
let dup = new DeltaSnapshot(this.app, this.adminApp, this.instance, undefined, undefined);
314+
let dup = new DeltaSnapshot(this.app, this.adminApp, undefined, undefined, undefined, this.instance);
315315
[dup._path, dup._data, dup._delta, dup._childPath, dup._newData] =
316316
[this._path, this._data, this._delta, this._childPath, this._newData];
317317

0 commit comments

Comments
 (0)