Skip to content

Commit

Permalink
Fix name calculation for FontAwesome
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Dec 22, 2022
1 parent 633024b commit 22cd38d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"babel-loader": "^9.1.0",
"core-js": "^3.26.1",
"dotenv": "^16.0.3",
"fast-case": "^1.7.0",
"prettier": "^2.8.1",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/fa-brands/source.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const fontawesome = require('@fortawesome/fontawesome-svg-core')
const brands = require('@fortawesome/free-brands-svg-icons').fab
const fastCase = require('fast-case')

module.exports = async () =>
Object.keys(brands).map((iconKey) => {
const icon = fontawesome.icon(brands[iconKey])
const originalName = fastCase.decamelize(iconKey).replace('fa_', '').replace(/_/g, '-')
return {
originalName: icon.iconName,
originalName: originalName,
source: icon.html[0],
pack: 'fa-brands',
verticalAlign: '-.125em',
Expand Down
4 changes: 3 additions & 1 deletion packages/fa-regular/source.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const fontawesome = require('@fortawesome/fontawesome-svg-core')
const regular = require('@fortawesome/free-regular-svg-icons').far
const fastCase = require('fast-case')

module.exports = async () =>
Object.keys(regular).map((iconKey) => {
const icon = fontawesome.icon(regular[iconKey])
const originalName = fastCase.decamelize(iconKey).replace('fa_', '').replace(/_/g, '-')
return {
originalName: icon.iconName,
originalName: originalName,
source: icon.html[0],
pack: 'fa-regular',
verticalAlign: '-.125em',
Expand Down
4 changes: 3 additions & 1 deletion packages/fa-solid/source.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const fontawesome = require('@fortawesome/fontawesome-svg-core')
const solid = require('@fortawesome/free-solid-svg-icons').fas
const fastCase = require('fast-case')

module.exports = async () =>
Object.keys(solid).map((iconKey) => {
const icon = fontawesome.icon(solid[iconKey])
const originalName = fastCase.decamelize(iconKey).replace('fa_', '').replace(/_/g, '-')
return {
originalName: icon.iconName,
originalName: originalName,
source: icon.html[0],
pack: 'fa-solid',
verticalAlign: '-.125em',
Expand Down
19 changes: 7 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 22cd38d

Please sign in to comment.