Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ionic/angular-standalone-codemods

Package Overview
Dependencies
Maintainers
26
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/angular-standalone-codemods - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

80

dist/index.js

@@ -682,47 +682,49 @@ #!/usr/bin/env node

if (node.name === "ion-icon") {
const staticNameAttribute = node.attributes.find(
(a) => a.name === "name" || a.name === "icon"
);
if (staticNameAttribute) {
const iconName = staticNameAttribute.value;
if (!ionIcons.includes(iconName)) {
ionIcons.push(iconName);
}
} else {
const boundNameAttribute = node.inputs.find(
(a) => a.name === "name" || a.name === "icon"
for (const attribute of ["name", "icon", "ios", "md"]) {
const staticNameAttribute = node.attributes.find(
(a) => a.name === attribute
);
if (boundNameAttribute) {
const skippedIcon = node.sourceSpan.toString();
const iconNameRegex = /{{\s*'([^']+)'\s*}}/;
const iconNameMatch = skippedIcon.match(iconNameRegex);
const deepGetIconConditional = (ast2, icons) => {
if (ast2.trueExp.type === "LiteralPrimitive") {
if (!ionIcons.includes(ast2.trueExp.value)) {
ionIcons.push(ast2.trueExp.value);
if (staticNameAttribute) {
const iconName = staticNameAttribute.value;
if (!ionIcons.includes(iconName)) {
ionIcons.push(iconName);
}
} else {
const boundNameAttribute = node.inputs.find(
(a) => a.name === attribute
);
if (boundNameAttribute) {
const skippedIcon = node.sourceSpan.toString();
const iconNameRegex = /{{\s*'([^']+)'\s*}}/;
const iconNameMatch = skippedIcon.match(iconNameRegex);
const deepGetIconConditional = (ast2, icons) => {
if (ast2.trueExp.type === "LiteralPrimitive") {
if (!ionIcons.includes(ast2.trueExp.value)) {
ionIcons.push(ast2.trueExp.value);
}
} else if (ast2.trueExp.type === "Conditional") {
deepGetIconConditional(ast2.trueExp, icons);
} else {
skippedIconsHtml.push(skippedIcon);
}
} else if (ast2.trueExp.type === "Conditional") {
deepGetIconConditional(ast2.trueExp, icons);
} else {
skippedIconsHtml.push(skippedIcon);
}
if (ast2.falseExp.type === "LiteralPrimitive") {
if (!ionIcons.includes(ast2.falseExp.value)) {
ionIcons.push(ast2.falseExp.value);
if (ast2.falseExp.type === "LiteralPrimitive") {
if (!ionIcons.includes(ast2.falseExp.value)) {
ionIcons.push(ast2.falseExp.value);
}
} else if (ast2.falseExp.type === "Conditional") {
deepGetIconConditional(ast2.falseExp, icons);
} else {
skippedIconsHtml.push(skippedIcon);
}
} else if (ast2.falseExp.type === "Conditional") {
deepGetIconConditional(ast2.falseExp, icons);
return icons;
};
if (iconNameMatch) {
if (!ionIcons.includes(iconNameMatch[1])) {
ionIcons.push(iconNameMatch[1]);
}
} else if (boundNameAttribute.value.ast.type === "Conditional") {
deepGetIconConditional(boundNameAttribute.value.ast, ionIcons);
} else {
skippedIconsHtml.push(skippedIcon);
}
return icons;
};
if (iconNameMatch) {
if (!ionIcons.includes(iconNameMatch[1])) {
ionIcons.push(iconNameMatch[1]);
}
} else if (boundNameAttribute.value.ast.type === "Conditional") {
deepGetIconConditional(boundNameAttribute.value.ast, ionIcons);
} else {
skippedIconsHtml.push(skippedIcon);
}

@@ -729,0 +731,0 @@ }

{
"name": "@ionic/angular-standalone-codemods",
"version": "0.2.0",
"version": "0.3.0",
"dependencies": {

@@ -5,0 +5,0 @@ "@angular-eslint/template-parser": "^17.1.0",

Sorry, the diff of this file is not supported yet

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