diff options
author | bobzel <zzzman@gmail.com> | 2021-03-02 19:52:59 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-03-02 19:52:59 -0500 |
commit | 1b481cd441cc8bb200906b246b43e4bc5dc53b4e (patch) | |
tree | 10fe0b4cbbfa7a0c25cf84090aef0f12bbf0be4c /src/fields/Schema.ts | |
parent | faf9dc5ca6a7380f3b040dc2ddbe07c29689e014 (diff) |
added a fitwidth toggle for lightbox. fixed _showCaption/setting _fields to undefined. updated documentView to use not having fitWidth set as a trigger for whether to treat a doc without nativeWidth/Height as if its width/height is that.
Diffstat (limited to 'src/fields/Schema.ts')
-rw-r--r-- | src/fields/Schema.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fields/Schema.ts b/src/fields/Schema.ts index 4607e0fd5..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 { + } else if (doc instanceof List) { return doc.map(fn); - } + } else return {}; }; } |