fix: elsif is not supported for unless, fixes #268

This commit is contained in:
harttle
2020-12-08 00:16:36 +08:00
parent a492d8e23d
commit 2bbf50171b
5 changed files with 47 additions and 8 deletions
+2 -3
View File
@@ -5,10 +5,9 @@ export function isTruthy (val: any, ctx: Context): boolean {
}
export function isFalsy (val: any, ctx: Context): boolean {
if(ctx.opts.jsTruthy) {
if (ctx.opts.jsTruthy) {
return !val
}
else {
} else {
return val === false || undefined === val || val === null
}
}