From 9b942166ca6b09ce4f310928c3daf8503a63ee5c Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Thu, 7 Feb 2019 23:33:44 -0500 Subject: Restored Opt and made a new FieldValue type to replace old Opt --- src/fields/DocumentReference.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/fields/DocumentReference.ts') diff --git a/src/fields/DocumentReference.ts b/src/fields/DocumentReference.ts index 10dac9f92..983b162a3 100644 --- a/src/fields/DocumentReference.ts +++ b/src/fields/DocumentReference.ts @@ -1,4 +1,4 @@ -import { Field, Opt } from "./Field"; +import { Field, Opt, FieldValue } from "./Field"; import { Document } from "./Document"; import { Key } from "./Key"; @@ -15,12 +15,12 @@ export class DocumentReference extends Field { super(); } - Dereference(): Opt { + Dereference(): FieldValue { return this.document.Get(this.key); } - DereferenceToRoot(): Opt { - let field: Opt = this; + DereferenceToRoot(): FieldValue { + let field: FieldValue = this; while (field instanceof DocumentReference) { field = field.Dereference(); } @@ -37,5 +37,8 @@ export class DocumentReference extends Field { throw new Error("Method not implemented."); } + ToScriptString(): string { + return ""; + } } \ No newline at end of file -- cgit v1.2.3-70-g09d2