We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc988e1 commit d994ac6Copy full SHA for d994ac6
generators/src/main/java/com/algolia/codegen/utils/Helpers.java
@@ -43,7 +43,12 @@ public static String camelize(String kebabStr) {
43
44
// convert camelCase77String to CAMEL_CASE_77_STRING
45
public static String toScreamingSnakeCase(String camelCase) {
46
- return camelCase.replaceAll("-", "_").replaceAll("(.+?)([A-Z]|[0-9])", "$1_$2").toUpperCase(Locale.ROOT);
+ return camelCase
47
+ .replaceAll("-", "_")
48
+ .replaceAll("/", "_")
49
+ .replaceAll("(?<=.)([A-Z]+|\\d+)", "_$1")
50
+ .replaceAll("__", "_")
51
+ .toUpperCase(Locale.ROOT);
52
}
53
54
/**
0 commit comments