diff options
author | bobzel <zzzman@gmail.com> | 2021-10-07 09:46:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 09:46:37 -0400 |
commit | 34f99c8a4d4ff14eb9814ebc865cf5ed29d2226a (patch) | |
tree | a2f9722abc1132a7af8428c8a7992794c9417719 /src/fields/Doc.ts | |
parent | 37528f87e89e2072080fac7eefe022d8989faabc (diff) | |
parent | 8f1a6266cf0a728ab2b7df11d45a023de266fae4 (diff) |
Merge pull request #46 from brown-dash/linking-anh
Revert "Revert "Merge pull request #34 from brown-dash/linking-anh""
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 9490edc2c..a89bdf57a 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -79,6 +79,7 @@ export function DocListCastAsync(field: FieldResult, defaultValue?: Doc[]) { export async function DocCastAsync(field: FieldResult): Promise<Opt<Doc>> { return Cast(field, Doc); } +export function NumListCast(field: FieldResult) { return Cast(field, listSpec("number"), []); } export function StrListCast(field: FieldResult) { return Cast(field, listSpec("string"), []); } export function DocListCast(field: FieldResult) { 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; } |