diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-06-29 17:00:41 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-06-29 17:00:41 +0530 |
commit | 9c0a250fd412c46861f72d8bb7cc5535b101c0fa (patch) | |
tree | ff24809b94f06b3fb12ce47dbd94e14cdc615baa /src/fields/Schema.ts | |
parent | 6ad7fac6342204bc489ef49cb3ba8f450bfa3824 (diff) | |
parent | 29f9cedd937697c56ce3b400931b26c82a23721d (diff) |
merge conflicts resolved
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); } |