mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-27 18:52:38 +01:00
Fix better
This commit is contained in:
1 parent
20e1b5c00e
commit
8b851d4685
2 files changed
+5
-3
No files matched your search
@@ -92,11 +92,12 @@ function templateTags(
|
||||
let option = options.find(
|
||||
(o) => o.name === name || (o.type === 'function' && o.aliases?.includes(name)),
|
||||
);
|
||||
|
||||
if (option == null) {
|
||||
const from = node.from; // Cache here so the reference doesn't change
|
||||
option = {
|
||||
invalid: true,
|
||||
type: 'variable',
|
||||
invalid: true,
|
||||
name: inner,
|
||||
value: null,
|
||||
label: inner,
|
||||
@@ -112,7 +113,8 @@ function templateTags(
|
||||
for (const arg of option.args) {
|
||||
if (!('optional' in arg)) continue;
|
||||
if (!arg.optional && values[arg.name] == null) {
|
||||
option.invalid = true;
|
||||
// Clone so we don't mutate the original
|
||||
option = { ...option, invalid: true };
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user