diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-06-24 15:59:22 -0400 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-06-24 15:59:22 -0400 |
| commit | a99639e9073ea154728ff9676c41af646791f4cd (patch) | |
| tree | 027ef2ae68f00432c99cf1caf6ad4d9c9547b5d8 /src/new_fields/Schema.ts | |
| parent | 65288e33b49404d21012323fcb53fefb3f646fbf (diff) | |
| parent | d475b19e9ba7bc8870ec7bc1e10b5cc88decea0b (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into pdf_snippet
Diffstat (limited to 'src/new_fields/Schema.ts')
| -rw-r--r-- | src/new_fields/Schema.ts | 8 |
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; }; |
