fix: simplify

elliott/add-variadic-snippets
S. Elliott Johnson 1 year ago
parent 5d73c6b6c4
commit e8153dcbbc

@ -1127,23 +1127,19 @@ const template_visitors = {
const snippet_function = state.options.dev
? b.call('$.validate_snippet', node.expression)
: node.expression;
if (node.arguments.length > 0) {
state.template.push(
t_statement(
b.stmt(
b.call(
snippet_function,
b.id('$$payload'),
...node.arguments.map(
(arg) => /** @type {import('estree').Expression} */ (context.visit(arg))
)
state.template.push(
t_statement(
b.stmt(
b.call(
snippet_function,
b.id('$$payload'),
...node.arguments.map(
(arg) => /** @type {import('estree').Expression} */ (context.visit(arg))
)
)
)
);
} else {
state.template.push(t_statement(b.stmt(b.call(snippet_function, b.id('$$payload')))));
}
)
);
state.template.push(t_expression(anchor_id));
},

Loading…
Cancel
Save