diff options
author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-12-03 01:21:46 -0800 |
---|---|---|
committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-12-03 01:21:46 -0800 |
commit | 644c3cb25c27cf3d4b8047f9223c4797a9a29ea0 (patch) | |
tree | 2b54b631d975ff1bcf4d6cee48c981302e8756c7 /src/fields/Doc.ts | |
parent | c352e3535636269243e26156c99d0438a3177c37 (diff) | |
parent | 3b045d03656383df81515485032bfda9e2b16409 (diff) |
pull
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 4c3c45d92..782c6c8b3 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -76,6 +76,7 @@ export function DocListCastAsync(field: FieldResult, defaultValue?: Doc[]) { export async function DocCastAsync(field: FieldResult): Promise<Opt<Doc>> { return Cast(field, Doc); } +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; } |