diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-06-27 02:21:24 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-06-27 02:21:24 -0400 |
commit | 99d2b19dba130353ac3b021bc7eab079bb125408 (patch) | |
tree | 26ab5fc79966758dd72f389842f4cadcdb9c43a5 /src/fields/Schema.ts | |
parent | 4a19a4ecc7f51532a30a7a31e4c95bfadce793da (diff) |
fixed icon button of document deoratins. cleaned up several compile errors and warnings
Diffstat (limited to 'src/fields/Schema.ts')
-rw-r--r-- | src/fields/Schema.ts | 5 |
1 files changed, 2 insertions, 3 deletions
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<T extends Interface[]>(...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); } |