不用写了, 已经有人写了: GitHub - akicho8/string-inflection: underscore -> UPCASE -> CamelCase conversion of names