diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-08 22:49:16 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-08 22:49:16 -0400 |
commit | 3b471ca0673945c33be74970db223ea411cfa0ae (patch) | |
tree | c2cb0771122697dfc162d24747fd715b9589c6ca /src/new_fields/Doc.ts | |
parent | 9c1fb2ba13280a60181cf40e5ec4eb907b7a7c27 (diff) |
sharing fixes and cleanup
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 7e37eba84..418863bcc 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -63,6 +63,10 @@ export function DocListCastAsync(field: FieldResult, defaultValue?: Doc[]) { return list ? Promise.all(list).then(() => list) : Promise.resolve(defaultValue); } +export async function DocCastAsync(field: FieldResult): Promise<Opt<Doc>> { + return Cast(field, Doc); +} + export function DocListCast(field: FieldResult): Doc[] { return Cast(field, listSpec(Doc), []).filter(d => d instanceof Doc) as Doc[]; } |