2020// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121// SOFTWARE.
2222
23- import { join } from 'path' ;
23+ import { posix } from 'path' ;
2424import * as _ from 'lodash' ;
2525import * as firebase from 'firebase-admin' ;
2626import { apps } from '../apps' ;
@@ -35,7 +35,7 @@ export const defaultDatabase = '(default)';
3535let firestoreInstance ;
3636
3737export function database ( database : string = defaultDatabase ) {
38- return new DatabaseBuilder ( join ( 'projects' , process . env . GCLOUD_PROJECT , 'databases' , database ) ) ;
38+ return new DatabaseBuilder ( posix . join ( 'projects' , process . env . GCLOUD_PROJECT , 'databases' , database ) ) ;
3939}
4040
4141export function namespace ( namespace : string ) {
@@ -51,11 +51,11 @@ export class DatabaseBuilder {
5151 constructor ( private resource : string ) { }
5252
5353 namespace ( namespace : string ) {
54- return new NamespaceBuilder ( `${ join ( this . resource , 'documents' ) } @${ namespace } ` ) ;
54+ return new NamespaceBuilder ( `${ posix . join ( this . resource , 'documents' ) } @${ namespace } ` ) ;
5555 }
5656
5757 document ( path : string ) {
58- return ( new NamespaceBuilder ( join ( this . resource , 'documents' ) ) ) . document ( path ) ;
58+ return ( new NamespaceBuilder ( posix . join ( this . resource , 'documents' ) ) ) . document ( path ) ;
5959 }
6060}
6161
@@ -64,7 +64,7 @@ export class NamespaceBuilder {
6464 constructor ( private resource : string ) { }
6565
6666 document ( path : string ) {
67- return new DocumentBuilder ( join ( this . resource , path ) ) ;
67+ return new DocumentBuilder ( posix . join ( this . resource , path ) ) ;
6868 }
6969}
7070
0 commit comments