Expected result n2_icon_arrow_back_24
Actual result n_2_icon_arrow_back_24
When RegExp replace operation finishes, icon name becomes "n2_icon_arrow back_24". Next step is converting the string to snake case. This operation doesn't execute if name already in snake case. Because icon name contains space « » symbol, converting to snake case operation initiated. How converting to snake case works:
split string to substring. Every number becomes substring.
["n", "2", "icon", "arrow", "back", "24"]
lowercase each substring
Join using "_" separator
The result is n_2_icon_arrow_back_24
Need to update convert to snake case algorithm to not to split n2 to two substrings.
Figma's icon name
icons / 24 / arrow back
Expected result
n2_icon_arrow_back_24
Actual resultn_2_icon_arrow_back_24
When RegExp replace operation finishes, icon name becomes
"n2_icon_arrow back_24"
. Next step is converting the string to snake case. This operation doesn't execute if name already in snake case. Because icon name contains space « » symbol, converting to snake case operation initiated. How converting to snake case works:["n", "2", "icon", "arrow", "back", "24"]
The result is
n_2_icon_arrow_back_24
Need to update convert to snake case algorithm to not to split
n2
to two substrings.