aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Schema.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-06-29 17:00:41 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-06-29 17:00:41 +0530
commit9c0a250fd412c46861f72d8bb7cc5535b101c0fa (patch)
treeff24809b94f06b3fb12ce47dbd94e14cdc615baa /src/fields/Schema.ts
parent6ad7fac6342204bc489ef49cb3ba8f450bfa3824 (diff)
parent29f9cedd937697c56ce3b400931b26c82a23721d (diff)
merge conflicts resolved
Diffstat (limited to 'src/fields/Schema.ts')
-rw-r--r--src/fields/Schema.ts5
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);
}