RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
718 stars 114 forks source link

Small improvement for snake case handling #179

Closed IljaKosynkin closed 1 year ago

IljaKosynkin commented 1 year ago

Good time of the day!

I created a small improvement to the way snake case is handled. Right now if you have (for instance) "Icon=WIFI 24" it will be translated into "icon_w_i_f_i_24". With this update it will be "icon_wifi_24", which, I think, is better.

I'm not sure about tests though, haven't found any for this function. Any pointers?

subdan commented 1 year ago

Thanks for the PR, @IljaKosynkin! I've added tests for StringCase. Please add a test for your case.

func testSnakeCase() throws {
...
    XCTAssertEqual("Icon=WIFI 24".snakeCased(), "icon_wifi_24")
...
}
subdan commented 1 year ago

When you add test I can merge your PR.

IljaKosynkin commented 1 year ago

Sorry, @subdan got caught up in work. Added tests