From 3b471ca0673945c33be74970db223ea411cfa0ae Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Tue, 8 Oct 2019 22:49:16 -0400 Subject: sharing fixes and cleanup --- src/new_fields/Doc.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/new_fields') 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> { + return Cast(field, Doc); +} + export function DocListCast(field: FieldResult): Doc[] { return Cast(field, listSpec(Doc), []).filter(d => d instanceof Doc) as Doc[]; } -- cgit v1.2.3-70-g09d2