diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-07-10 21:18:44 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-07-10 21:18:44 -0400 |
commit | a56eb6c5dde8a7015932faec094cbe83bf0a825b (patch) | |
tree | bb9537d1abf22c65816505dc95b9195b5a6b1732 /src/new_fields/Types.ts | |
parent | 1864c73573cd7129c8e6994842ad4d442d959c46 (diff) |
added lastmodified time to text data extension doc. now need to figure out how to get at it.
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 39d384d64..f8a4a30b4 100644 --- a/src/new_fields/Types.ts +++ b/src/new_fields/Types.ts @@ -1,6 +1,7 @@ import { Field, Opt, FieldResult, Doc } from "./Doc"; import { List } from "./List"; import { RefField } from "./RefField"; +import { DateField } from "./DateField"; export type ToType<T extends InterfaceValue> = T extends "string" ? string : @@ -80,6 +81,9 @@ export function StrCast(field: FieldResult, defaultVal: string | null = "") { export function BoolCast(field: FieldResult, defaultVal: boolean | null = null) { return Cast(field, "boolean", defaultVal); } +export function DateCast(field: FieldResult) { + return Cast(field, DateField, null); +} type WithoutList<T extends Field> = T extends List<infer R> ? (R extends RefField ? (R | Promise<R>)[] : R[]) : T; |