Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 1.43 KB

File metadata and controls

14 lines (9 loc) · 1.43 KB

SnakeCase hard #template-literal #string

by Gabriel Vergnaud @gvergnaud

Take the Challenge

Create a SnakeCase<T> generic that turns a string formatted in camelCase into a string formatted in snake_case.

A few examples:

type res1 = SnakeCase<"hello">; // => "hello"
type res2 = SnakeCase<"userName">; // => "user_name"
type res3 = SnakeCase<"getElementById">; // => "get_element_by_id"

Back Share your Solutions Check out Solutions