diff options
author | andrewdkim <adkim414@gmail.com> | 2019-08-14 11:55:16 -0400 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-08-14 11:55:16 -0400 |
commit | 46f4945d38ca9423f1114fb4c4b4f4a72389a89e (patch) | |
tree | 49de0599cc94f504e4bb5e46f889cb01bbc1b641 /src/new_fields/Types.ts | |
parent | f43509c132b5302b9983667aaf99251051b38b59 (diff) | |
parent | 7a71c9005189e111e9c9d197d02cc9a6a1bce389 (diff) |
merge from master
Diffstat (limited to 'src/new_fields/Types.ts')
-rw-r--r-- | src/new_fields/Types.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/new_fields/Types.ts b/src/new_fields/Types.ts index 09cbff25e..0ca35fab2 100644 --- a/src/new_fields/Types.ts +++ b/src/new_fields/Types.ts @@ -2,6 +2,7 @@ import { Field, Opt, FieldResult, Doc } from "./Doc"; import { List } from "./List"; import { RefField } from "./RefField"; import { DateField } from "./DateField"; +import { ScriptField } from "./ScriptField"; export type ToType<T extends InterfaceValue> = T extends "string" ? string : @@ -86,6 +87,9 @@ export function BoolCast(field: FieldResult, defaultVal: boolean | null = false) export function DateCast(field: FieldResult) { return Cast(field, DateField, null); } +export function ScriptCast(field: FieldResult) { + return Cast(field, ScriptField, null); +} type WithoutList<T extends Field> = T extends List<infer R> ? (R extends RefField ? (R | Promise<R>)[] : R[]) : T; |