diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-08-20 20:41:41 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-08-20 20:41:41 -0400 |
commit | 3b99cb39a4a860258b93f6af5ff8f238cf78b2e8 (patch) | |
tree | b533ee5fd791da9be8064f3afaafdee317e877ac /src/new_fields/Types.ts | |
parent | dc587b0fb493d869e6cd38fa94b81105da4fbaab (diff) | |
parent | 700dfc5add1ecd9c2b1ecafcdc593ff821b7a6a6 (diff) |
merged with 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; |