Skip to content

Commit

Permalink
fix color name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
movch committed Jan 18, 2022
1 parent bdcad8b commit ad65577
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions FigmaAssetsFetch/Helpers/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ extension String {
}

var stripped: String {
let okayChars = Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLKMNOPQRSTUVWXYZ1234567890 ")
return filter { okayChars.contains($0) }
return replacingOccurrences(
of: "[^\\w]",
with: " ",
options: .regularExpression
)
}

var camelCased: String {
Expand Down

0 comments on commit ad65577

Please sign in to comment.