From 99ffc8ec1508f05dfb126318b1215a3ee597738f Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Fri, 7 Jun 2019 18:30:48 -0400 Subject: Fixed some schema stuff? Tests aren't running --- src/new_fields/Schema.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/new_fields/Schema.ts') 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 = { 1: ToInterface> & AllToInterface>, @@ -56,9 +57,10 @@ export function makeInterface(...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; }; -- cgit v1.2.3-70-g09d2