diff options
author | bobzel <zzzman@gmail.com> | 2020-08-22 00:49:22 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-22 00:49:22 -0400 |
commit | cbedd8e1e651843e50f8f27163bf8e2a1a574009 (patch) | |
tree | 78ca5544166097d3ee9e937e7a05fcdee0b33102 /src/fields/Doc.ts | |
parent | 9f048fee0c44264f8eac8326b9e0945d1426c1f5 (diff) |
fixed key value for empty lists to show [], fixed tree view to allow 'data' field .to display for empty lists. Gave untitled Tabs a default height
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index c4a49962b..c78b01def 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -91,6 +91,9 @@ export async function DocCastAsync(field: FieldResult): Promise<Opt<Doc>> { export function DocListCast(field: FieldResult): Doc[] { return Cast(field, listSpec(Doc), []).filter(d => d instanceof Doc) as Doc[]; } +export function DocListCastOrNull(field: FieldResult) { + return Cast(field, listSpec(Doc), null)?.filter(d => d instanceof Doc) as Doc[] | undefined; +} export const WidthSym = Symbol("Width"); export const HeightSym = Symbol("Height"); |