aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Schema.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-06-25 09:09:28 -0400
committerbob <bcz@cs.brown.edu>2019-06-25 09:09:28 -0400
commit66acf0237f2e1fe74660e5c2a035757403f79f8b (patch)
treea4fa797203ee262072c53ba845e6bcce214f151e /src/new_fields/Schema.ts
parent038819c6f1490bfa3ef9a5a7404ea8688f2b9fd6 (diff)
parent45dee8324dc360953c584ba18f5b53220ecfdf61 (diff)
Merge branch 'templatesMac' of https://github.com/browngraphicslab/Dash-Web into templatesMac
Diffstat (limited to 'src/new_fields/Schema.ts')
-rw-r--r--src/new_fields/Schema.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/new_fields/Schema.ts b/src/new_fields/Schema.ts
index 40ffaecd5..2355304d5 100644
--- a/src/new_fields/Schema.ts
+++ b/src/new_fields/Schema.ts
@@ -2,6 +2,7 @@ import { Interface, ToInterface, Cast, ToConstructor, HasTail, Head, Tail, ListS
import { Doc, Field } from "./Doc";
import { ObjectField } from "./ObjectField";
import { RefField } from "./RefField";
+import { SelfProxy } from "./FieldSymbols";
type AllToInterface<T extends Interface[]> = {
1: ToInterface<Head<T>> & AllToInterface<Tail<T>>,
@@ -56,9 +57,10 @@ export function makeInterface<T extends Interface[]>(...schemas: T): InterfaceFu
}
});
const fn = (doc: Doc) => {
- if (!(doc instanceof Doc)) {
- throw new Error("Currently wrapping a schema in another schema isn't supported");
- }
+ doc = doc[SelfProxy];
+ // if (!(doc instanceof Doc)) {
+ // throw new Error("Currently wrapping a schema in another schema isn't supported");
+ // }
const obj = Object.create(proto, { doc: { value: doc, writable: false } });
return obj;
};