workers-firebase
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -57,3 +57,3 @@ var _a; | ||
this.transactionOptions = transactionOptions; | ||
const segments = typeof path === 'string' ? trim(path).split('/') : path; | ||
const segments = typeof path === 'string' ? trim(path).split('/').filter(Boolean) : path; | ||
if (segments.length % 2 !== 0) | ||
@@ -60,0 +60,0 @@ throw new Error('A document reference must have an even number of segments, received ' + segments.join('/')); |
{ | ||
"name": "workers-firebase", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "start": "tsc --watch", |
@@ -66,3 +66,3 @@ import type { | ||
constructor(readonly firestore: Firestore, path: string | string[], readonly transactionOptions?: ReadTransactionOptions) { | ||
const segments = typeof path === 'string' ? trim(path).split('/') : path; | ||
const segments = typeof path === 'string' ? trim(path).split('/').filter(Boolean) : path; | ||
if (segments.length % 2 !== 0) throw new Error('A document reference must have an even number of segments, received ' + segments.join('/')); | ||
@@ -69,0 +69,0 @@ this.segments = segments; |
135385