Skip to content

Commit

Permalink
fix: issue vue tsc (#3225)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget authored Sep 23, 2024
1 parent de76cdb commit 3ffa7d6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions output/vue/scripts/fix-any-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ const replaceAnyTypes = (input: string, component: string) => {
const propLines = roLine.match(/(.*);/g);
if (propLines) {
propLines.forEach((propLine) => {
const prop = propLine
.replace('?: any;', '')
.replace(': any;', '')
.trim();
// @ts-ignore
fileContent = fileContent.replaceAll(
propLine,
propLine.replace('any', `${propModel}["${prop}"]`)
);
// Check if prop(contains ": any") or function
if (propLine.includes(': any;')) {
const prop = propLine
.replace('?: any;', '')
.replace(': any;', '')
.trim();
// @ts-ignore
fileContent = fileContent.replaceAll(
propLine,
propLine.replace('any', `${propModel}["${prop}"]`)
);
}
});
}
}
Expand Down

0 comments on commit 3ffa7d6

Please sign in to comment.