From 99d2b19dba130353ac3b021bc7eab079bb125408 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sat, 27 Jun 2020 02:21:24 -0400 Subject: fixed icon button of document deoratins. cleaned up several compile errors and warnings --- src/fields/Schema.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/fields/Schema.ts') diff --git a/src/fields/Schema.ts b/src/fields/Schema.ts index 72bce283d..98ef3e087 100644 --- a/src/fields/Schema.ts +++ b/src/fields/Schema.ts @@ -65,9 +65,8 @@ export function makeInterface(...schemas: T): InterfaceFu return obj; }; return function (doc?: Doc | Doc[]) { - doc = doc || new Doc; - if (doc instanceof Doc) { - return fn(doc); + if (doc instanceof Doc || doc === undefined) { + return fn(doc || new Doc); } else { return doc.map(fn); } -- cgit v1.2.3-70-g09d2