Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GTANAdam committed Jul 31, 2021
1 parent 596a654 commit 429feca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vue": "~2.6.12"
},
"devDependencies": {
"@adambh/vue-fontawesome-autogen": "^1.1.3",
"@adambh/vue-fontawesome-autogen": "^1.1.6",
"@vue/cli-service": "~4.5.8",
"before-build-webpack": "~0.2.9",
"vue-template-compiler": "~2.6.12"
Expand Down
2 changes: 1 addition & 1 deletion example/src/plugins/fontawesome-autogen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Auto generated @ Sat Jul 31 2021 07:27:58 GMT+0300 (Eastern European Summer Time)
// Auto generated @ Sat Jul 31 2021 08:08:48 GMT+0300 (Eastern European Summer Time)

//fas
import {
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const matches = [
///(?<=<fa\s+icon="+).*?(?=")/g // Get icons within components
// /icon=['"]([a-z-]+)['"]|:icon=\"\[['"](fa[a-z])['"],.*['"]([a-z-]+)['"]\]/g,
new RegExp(
`<(?:fa|${componentName})\s+icon=['"]([a-z-]+)['"]|<${componentName}\s+:icon=\"\[['"](fa[a-z])['"],[ ]{0,1}['"]([a-z-]+)['"]\]|<FontAwesomeIcon\s+icon=['"]([a-z-]+)['"]|<FontAwesomeIcon\s+icon={\[['"](fa[a-z])['"],[ ]{0,1}['"]([a-z-]+)['"]\]}`,
`<(?:fa|${componentName})\\s+icon=['"]([a-z-]+)['"]|<${componentName}\\s+:icon=\"\[['"](fa[a-z])['"],[ ]{0,1}['"]([a-z-]+)['"]\]|<FontAwesomeIcon\\s+icon=['"]([a-z-]+)['"]|<FontAwesomeIcon\\s+icon={\[['"](fa[a-z])['"],[ ]{0,1}['"]([a-z-]+)['"]\]}`,
"g"
),
];
Expand Down Expand Up @@ -132,9 +132,10 @@ function getIcons(files) {
const file = fs.readFileSync(f);

for (const r of matches) {
//console.log(r);
// console.log(r);

while (null != (icon = r.exec(file))) {
// console.log(icon);
icon = icon.filter((e) => e != null);
icon.shift();

Expand Down

0 comments on commit 429feca

Please sign in to comment.