aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Schema.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-03-02 23:35:15 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-03-02 23:35:15 -0500
commit067377e138254c72ad4cf3609b05d5aab2b71a26 (patch)
tree9ce9b22e585a0e1472eb3216630c2404e8517144 /src/fields/Schema.ts
parent95451a2eb0871856b946fff8a14ca0c385af5f1b (diff)
parent1b481cd441cc8bb200906b246b43e4bc5dc53b4e (diff)
agh stop merging
Diffstat (limited to 'src/fields/Schema.ts')
-rw-r--r--src/fields/Schema.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fields/Schema.ts b/src/fields/Schema.ts
index e0fc5902b..78f8a6bfb 100644
--- a/src/fields/Schema.ts
+++ b/src/fields/Schema.ts
@@ -3,6 +3,7 @@ import { Doc, Field } from "./Doc";
import { ObjectField } from "./ObjectField";
import { RefField } from "./RefField";
import { SelfProxy } from "./FieldSymbols";
+import { List } from "./List";
type AllToInterface<T extends Interface[]> = {
1: ToInterface<Head<T>> & AllToInterface<Tail<T>>,
@@ -67,9 +68,9 @@ export function makeInterface<T extends Interface[]>(...schemas: T): InterfaceFu
return function (doc?: Doc | Doc[]) {
if (doc instanceof Doc || doc === undefined) {
return fn(doc || new Doc);
- } else {
- if (!doc instanceof Promise) return doc.map(fn);
- }
+ } else if (doc instanceof List) {
+ return doc.map(fn);
+ } else return {};
};
}