Skip to content

Commit 95dcf15

Browse files
Bugs
1 parent 0b6212d commit 95dcf15

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/database/src/core/WriteTree.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
pathChild,
2525
pathContains,
2626
pathGetFront,
27+
pathIsEmpty,
2728
pathPopFront
2829
} from './util/Path';
2930
import {
@@ -570,7 +571,7 @@ export class WriteTree {
570571
// b) not be relevant to a transaction (separate branch), so again will not affect the data for that transaction
571572
if (filter(write)) {
572573
const writePath = write.path;
573-
let relativePath;
574+
let relativePath: Path;
574575
if (write.snap) {
575576
if (pathContains(treeRoot, writePath)) {
576577
relativePath = newRelativePath(treeRoot, writePath);
@@ -599,7 +600,7 @@ export class WriteTree {
599600
);
600601
} else if (pathContains(writePath, treeRoot)) {
601602
relativePath = newRelativePath(writePath, treeRoot);
602-
if (relativePath.isEmpty()) {
603+
if (pathIsEmpty(relativePath)) {
603604
compoundWrite = compoundWriteAddWrites(
604605
compoundWrite,
605606
newEmptyPath(),

packages/database/src/core/util/validation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
pathContains,
2323
pathGetBack,
2424
pathGetFront,
25+
pathSlice,
2526
ValidationPath
2627
} from './Path';
2728
import {
@@ -199,10 +200,10 @@ export const validateFirebaseMergePaths = function (
199200
errorPrefix: string,
200201
mergePaths: Path[]
201202
) {
202-
let i, curPath;
203+
let i, curPath: Path;
203204
for (i = 0; i < mergePaths.length; i++) {
204205
curPath = mergePaths[i];
205-
const keys = curPath.slice();
206+
const keys = pathSlice(curPath);
206207
for (let j = 0; j < keys.length; j++) {
207208
if (keys[j] === '.priority' && j === keys.length - 1) {
208209
// .priority is OK

0 commit comments

Comments
 (0)