Back out "Back out D16434402, D16434634"

Summary: Reverting the revert and fixing the snapshot tests

Reviewed By: JoshuaGross

Differential Revision: D16467242

fbshipit-source-id: 23ed4122da226ea815d3766098da4400e7ad9442
This commit is contained in:
Eli White
2019-07-24 16:50:13 -07:00
committed by Facebook Github Bot
parent 76ff31616e
commit a24a9b9946
7 changed files with 145 additions and 19 deletions
@@ -16,11 +16,17 @@ function upperCaseFirst(inString: string): string {
return inString[0].toUpperCase() + inString.slice(1);
}
function toSafeJavaString(input: string): string {
return input
.split('-')
.map(upperCaseFirst)
.join('');
function toSafeJavaString(
input: string,
shouldUpperCaseFirst?: boolean,
): string {
const parts = input.split('-');
if (shouldUpperCaseFirst === false) {
return parts.join('');
}
return parts.map(upperCaseFirst).join('');
}
function getImports(component: ComponentShape): Set<string> {