diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-26 17:08:38 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-26 17:08:38 -0400 |
commit | f01b842a5d6ef6b9deb9807fa0c3a8cd2c81a25a (patch) | |
tree | c9e3b3c18dc35f4a3fa3083b69b985821041c879 /src/new_fields/Types.ts | |
parent | c318c6cb44b26b780e94e0f0854e5ec4c14634a9 (diff) |
TreeView and others
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 079c7b76d..649dfdc3e 100644 --- a/src/new_fields/Types.ts +++ b/src/new_fields/Types.ts @@ -67,6 +67,10 @@ export function StrCast(field: FieldResult, defaultVal: Opt<string> = "") { return Cast(field, "string", defaultVal); } +export function BoolCast(field: FieldResult, defaultVal: Opt<boolean> = undefined) { + return Cast(field, "boolean", defaultVal); +} + type WithoutList<T extends Field> = T extends List<infer R> ? R[] : T; export function FieldValue<T extends Field, U extends WithoutList<T>>(field: Opt<T> | Promise<Opt<T>>, defaultValue: U): WithoutList<T>; |