@unplugin-vue-ce/sub-style
Advanced tools
Comparing version 1.0.0-beta.15 to 1.0.0-beta.16
@@ -16,3 +16,3 @@ // ../packages/sub-style/index.ts | ||
function injectToComponent(mgcStr, node, parent) { | ||
if (node.type === "Identifier" && parent.type === "FunctionDeclaration" && node.name === "createComponentInstance") | ||
if (node.type === "Identifier" && parent && parent.type === "FunctionDeclaration" && node.name === "createComponentInstance") | ||
isCreateComponentInstance = true; | ||
@@ -36,3 +36,3 @@ if (isCreateComponentInstance && node.type === "Identifier" && node.name === "instance") | ||
isComponentUpdateFnIdentifier = true; | ||
if (isComponentUpdateFnIdentifier && parent.type === "VariableDeclarator" && node.type === "Identifier" && node.name === "subTree") { | ||
if (isComponentUpdateFnIdentifier && parent && parent.type === "VariableDeclarator" && node.type === "Identifier" && node.name === "subTree") { | ||
isComponentUpdateFnIdentifier = false; | ||
@@ -43,3 +43,3 @@ mgcStr.prependRight(parent.end + 1, injectToBaseCreateRendererContent); | ||
isUnmountIdentifier = true; | ||
if (isUnmountIdentifier && parent.type === "CallExpression" && node.type === "Identifier" && node.name === "unmountComponent") { | ||
if (isUnmountIdentifier && parent && parent.type === "CallExpression" && node.type === "Identifier" && node.name === "unmountComponent") { | ||
isUnmountIdentifier = false; | ||
@@ -60,3 +60,3 @@ mgcStr.prependLeft(parent.start - 1, injectToUnMountContent); | ||
function injectApiCustomElement(mgcStr, node, parent) { | ||
if (node.type === "Identifier" && node.name === "VueElement" && parent.type === "ClassDeclaration") | ||
if (node.type === "Identifier" && node.name === "VueElement" && parent && parent.type === "ClassDeclaration") | ||
isVueElementIdentifier = true; | ||
@@ -69,3 +69,3 @@ if (node.type === "Identifier" && node.name === "BaseClass" && isVueElementIdentifier) | ||
mgcStr.prependLeft(node.start, injectBindFnContent); | ||
if (node.type === "Identifier" && node.name === "_applyStyles" && parent.type === "ClassMethod" && isVueElementIdentifier && isBaseClassIdentifier) { | ||
if (node.type === "Identifier" && node.name === "_applyStyles" && parent && parent.type === "ClassMethod" && isVueElementIdentifier && isBaseClassIdentifier) { | ||
isApplyStylesIdentifier = true; | ||
@@ -72,0 +72,0 @@ mgcStr.prependLeft(parent.end + 1, injectAddAndRemoveStyle); |
10
index.js
@@ -16,3 +16,3 @@ // ../packages/sub-style/index.ts | ||
function injectToComponent(mgcStr, node, parent) { | ||
if (node.type === "Identifier" && parent.type === "FunctionDeclaration" && node.name === "createComponentInstance") | ||
if (node.type === "Identifier" && parent && parent.type === "FunctionDeclaration" && node.name === "createComponentInstance") | ||
isCreateComponentInstance = true; | ||
@@ -36,3 +36,3 @@ if (isCreateComponentInstance && node.type === "Identifier" && node.name === "instance") | ||
isComponentUpdateFnIdentifier = true; | ||
if (isComponentUpdateFnIdentifier && parent.type === "VariableDeclarator" && node.type === "Identifier" && node.name === "subTree") { | ||
if (isComponentUpdateFnIdentifier && parent && parent.type === "VariableDeclarator" && node.type === "Identifier" && node.name === "subTree") { | ||
isComponentUpdateFnIdentifier = false; | ||
@@ -43,3 +43,3 @@ mgcStr.prependRight(parent.end + 1, injectToBaseCreateRendererContent); | ||
isUnmountIdentifier = true; | ||
if (isUnmountIdentifier && parent.type === "CallExpression" && node.type === "Identifier" && node.name === "unmountComponent") { | ||
if (isUnmountIdentifier && parent && parent.type === "CallExpression" && node.type === "Identifier" && node.name === "unmountComponent") { | ||
isUnmountIdentifier = false; | ||
@@ -60,3 +60,3 @@ mgcStr.prependLeft(parent.start - 1, injectToUnMountContent); | ||
function injectApiCustomElement(mgcStr, node, parent) { | ||
if (node.type === "Identifier" && node.name === "VueElement" && parent.type === "ClassDeclaration") | ||
if (node.type === "Identifier" && node.name === "VueElement" && parent && parent.type === "ClassDeclaration") | ||
isVueElementIdentifier = true; | ||
@@ -69,3 +69,3 @@ if (node.type === "Identifier" && node.name === "BaseClass" && isVueElementIdentifier) | ||
mgcStr.prependLeft(node.start, injectBindFnContent); | ||
if (node.type === "Identifier" && node.name === "_applyStyles" && parent.type === "ClassMethod" && isVueElementIdentifier && isBaseClassIdentifier) { | ||
if (node.type === "Identifier" && node.name === "_applyStyles" && parent && parent.type === "ClassMethod" && isVueElementIdentifier && isBaseClassIdentifier) { | ||
isApplyStylesIdentifier = true; | ||
@@ -72,0 +72,0 @@ mgcStr.prependLeft(parent.end + 1, injectAddAndRemoveStyle); |
@@ -6,3 +6,3 @@ { | ||
"type": "module", | ||
"version": "1.0.0-beta.15", | ||
"version": "1.0.0-beta.16", | ||
"packageManager": "pnpm@8.6.12", | ||
@@ -63,3 +63,3 @@ "keywords": [ | ||
"@babel/types": "^7.22.10", | ||
"@unplugin-vue-ce/utils": "^1.0.0-beta.15", | ||
"@unplugin-vue-ce/utils": "^1.0.0-beta.16", | ||
"baiwusanyu-utils": "^1.0.15", | ||
@@ -66,0 +66,0 @@ "estree-walker-ts": "^1.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39333