Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@vue/language-core

Package Overview
Dependencies
Maintainers
2
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/language-core - npm Package Compare versions

Comparing version
3.3.0
to
3.3.1
+10
-7
lib/template/transforms/transformElement.js

@@ -49,3 +49,2 @@ "use strict";

if (isComponent) {
let hasTemplateSlots = false;
let hasNamedDefaultSlot = false;

@@ -55,3 +54,11 @@ const implicitDefaultChildren = [];

const onComponentSlot = (0, compiler_dom_1.findDir)(node, 'slot', true);
for (const child of node.children) {
for (let child of node.children) {
// <template v-for> -> for > template
if (child.type === compiler_dom_1.NodeTypes.FOR) {
child = child.children[0];
}
// <template v-if> -> if > branch > template
else if (child.type === compiler_dom_1.NodeTypes.IF) {
child = child.branches[0].children[0];
}
let slotDir;

@@ -68,6 +75,2 @@ if (!(0, compiler_dom_1.isTemplateNode)(child) || !(slotDir = (0, compiler_dom_1.findDir)(child, 'slot', true))) {

}
if ((0, compiler_dom_1.findDir)(child, /^(?:if|else-if|else|for)$/, true)) {
continue;
}
hasTemplateSlots = true;
const staticSlotName = slotDir.arg

@@ -89,3 +92,3 @@ ? (0, compiler_dom_1.isStaticExp)(slotDir.arg)

}
if (hasTemplateSlots && hasNamedDefaultSlot
if (hasNamedDefaultSlot
&& implicitDefaultChildren.some(node => node.type !== compiler_dom_1.NodeTypes.TEXT || !!node.content.trim())) {

@@ -92,0 +95,0 @@ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN, implicitDefaultChildren[0].loc));

{
"name": "@vue/language-core",
"version": "3.3.0",
"version": "3.3.1",
"license": "MIT",

@@ -37,3 +37,3 @@ "files": [

},
"gitHead": "1088dce8ae6b937f7525fae4982e3b3ea99d3c64"
"gitHead": "9109bf31282c3d92ca0dd1825b0872a59b572b84"
}