aboutsummaryrefslogtreecommitdiff
path: root/src/context.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-14 17:38:24 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-14 17:39:24 +0530
commitf31caa5baad20553cac0330ae9ff279b8f88f340 (patch)
tree52c7e6e0b2acdece8f013b64e3dbb2b70f5b14f5 /src/context.ts
parentaee5d90a2397e68a753ab05e20566d0a23604931 (diff)
downloadts-types-lang-f31caa5baad20553cac0330ae9ff279b8f88f340.tar.gz
ts-types-lang-f31caa5baad20553cac0330ae9ff279b8f88f340.zip
feat: adds test cases for do and seq + fixes behavior with empty results
Diffstat (limited to '')
-rw-r--r--src/context.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/context.ts b/src/context.ts
index fab6653..f70a17d 100644
--- a/src/context.ts
+++ b/src/context.ts
@@ -39,7 +39,9 @@ export const createContext = (options: CtxOptions): Ctx => {
)
const getResultExpr = (resultKey?: string) =>
- `(${RESULT_TYPE_NAME}[${JSON.stringify(resultKey)})`
+ resultKey
+ ? `((${RESULT_TYPE_NAME}[${JSON.stringify(resultKey)})['output'])`
+ : 'undefined'
const addResult = (name: string, ty: string): Node | undefined =>
resultTypeNode