aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Schema.ts
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-06-24 13:57:02 -0400
committerGitHub <noreply@github.com>2019-06-24 13:57:02 -0400
commitaddf0e443f64951a437701f0d5a087c1d5968faf (patch)
treea97d85738f3173896aeffa04a22368b70b9dcdc3 /src/new_fields/Schema.ts
parentc9f77d5aab98e6e7865cdcad957d5c937631775d (diff)
parentd01039b10f0ebd328224c0b1a190b0f884a7c727 (diff)
Merge pull request #167 from browngraphicslab/schema_fixes
Schema and scripting fixes
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;
};