New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vue-macros/volar

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue-macros/volar - npm Package Compare versions

Comparing version 0.14.2 to 0.14.3

43

dist/jsx-directive.js

@@ -129,2 +129,9 @@ // src/jsx-directive.ts

}) {
if (nodes.length === 0)
return;
codes.push(`type __VLS_getSlots<T> = T extends new (...args: any) => any
? InstanceType<T>['$slots']
: T extends (props: any, ctx: infer Ctx) => any
? Ctx['slots']
: any`);
nodes.forEach((node) => {

@@ -217,3 +224,3 @@ if (!ts.isIdentifier(node.openingElement.tagName))

),
`} as InstanceType<typeof ${node.openingElement.tagName.escapedText}>['$slots'] }`
`} as __VLS_getSlots<typeof ${node.openingElement.tagName.escapedText}> }`
];

@@ -233,2 +240,20 @@ if (attribute) {

}
function transformVModel({
nodes,
codes,
ts,
sfc,
source
}) {
nodes.forEach(({ attribute }) => {
const start = attribute.getStart(sfc[`${source}Ast`]);
let end = start + 7;
let name = "modelValue";
if (ts.isJsxNamespacedName(attribute.name)) {
name = attribute.name.name.getText(sfc[`${source}Ast`]);
end += 1 + name.length;
}
(0, import_language_core2.replaceSourceRange)(codes, source, start, end, `onUpdate:${name} `, name);
});
}
function transformJsxDirective({ codes, sfc, ts, source }) {

@@ -238,2 +263,3 @@ const vIfAttributeMap = /* @__PURE__ */ new Map();

const vSlotNodeSet = /* @__PURE__ */ new Set();
const vModelAttributes = [];
function walkJsxDirective(node, parent) {

@@ -243,2 +269,3 @@ const properties = ts.isJsxElement(node) ? node.openingElement.attributes.properties : ts.isJsxSelfClosingElement(node) ? node.attributes.properties : [];

let vForAttribute;
let vModelAttribute;
for (const attribute of properties) {

@@ -258,2 +285,7 @@ if (!ts.isJsxAttribute(attribute))

}
if (/^v-model(_.*)?$/.test(
(ts.isJsxNamespacedName(attribute.name) ? attribute.name.namespace : attribute.name).getText(sfc[`${source}Ast`])
)) {
vModelAttribute = attribute;
}
}

@@ -276,2 +308,8 @@ if (vIfAttribute) {

}
if (vModelAttribute) {
vModelAttributes.push({
node,
attribute: vModelAttribute
});
}
node.forEachChild((child) => {

@@ -290,2 +328,3 @@ walkJsxDirective(

);
transformVModel({ nodes: vModelAttributes, codes, sfc, ts, source });
}

@@ -300,3 +339,3 @@ var plugin = ({ modules: { typescript: ts } }) => {

for (const source of ["script", "scriptSetup"]) {
if (!/\sv-(if|for|slot)/.test(`${sfc[source]?.content}`))
if (!/\sv-(if|for|slot|model)/.test(`${sfc[source]?.content}`))
continue;

@@ -303,0 +342,0 @@ transformJsxDirective({

14

package.json
{
"name": "@vue-macros/volar",
"version": "0.14.2",
"packageManager": "pnpm@8.6.12",
"version": "0.14.3",
"packageManager": "pnpm@8.7.4",
"description": "Volar plugin for Vue Macros.",

@@ -47,12 +47,12 @@ "keywords": [

"dependencies": {
"@rollup/pluginutils": "^5.0.3",
"@rollup/pluginutils": "^5.0.4",
"@volar/language-core": "1.10.1",
"@vue/language-core": "1.8.8",
"@vue-macros/common": "1.7.2",
"@vue-macros/define-props": "1.0.20",
"@vue-macros/short-vmodel": "1.2.17"
"@vue-macros/common": "1.8.0",
"@vue-macros/define-props": "1.0.21",
"@vue-macros/short-vmodel": "1.3.0"
},
"devDependencies": {
"@vue/compiler-dom": "^3.3.4",
"typescript": "~5.1.6",
"typescript": "~5.2.2",
"vue-tsc": "1.8.8"

@@ -59,0 +59,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc