aboutsummaryrefslogtreecommitdiff
path: root/src/util.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/util.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 'src/util.ts')
-rw-r--r--src/util.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util.ts b/src/util.ts
index a486294..b7d4efe 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -7,9 +7,10 @@ export const match = <K extends string, R>(
) => (k && pattern[k] ? pattern[k]() : pattern._())
export const evalList = async (ctx: Ctx, effectTyps: Type[]) => {
- const effectResults: string[] = []
+ const effectResults: (string | undefined)[] = []
for (const item of effectTyps ?? []) {
- effectResults.push(...(await ctx.evaluateType(ctx, item)))
+ const [resultKey] = await ctx.evaluateType(ctx, item)
+ effectResults.push(resultKey ? resultKey : undefined)
}
return effectResults
}
@@ -69,8 +70,6 @@ export const applyFunc = (
return undefined
})()
- // TODO: Cleanup unwanted result node values
-
if (!resultType) {
throw new Error('Couldnt get result for function application')
}