Converts PascalCase names to SCREAMING_SNAKE_CASE: UserLoggedIn → USER_LOGGED_IN. Event classes, message types and TypeScript enum members are often PascalCase, while action type strings, Java enum constants and database enum values are traditionally upper-case with underscores.
Paste a union of event names, an enum or a list of class names to get the constant-style codes that go over the wire or into a constants file.
String.Result.type Action =
| { type: "UserLoggedIn" }
| { type: "CartItemAdded" }
| { type: "CheckoutFailed" };type Action =
| { type: "USER_LOGGED_IN" }
| { type: "CART_ITEM_ADDED" }
| { type: "CHECKOUT_FAILED" };The three action types become Redux-style constants. Action is a single word, so the type name itself is not changed.
CartItemAdded → CART_ITEM_ADDED.Oauth2TokenIssued → OAUTH2_TOKEN_ISSUED.Event names designed as CheckoutFailed can be turned into CHECKOUT_FAILED constants for reducers, analytics events or a message broker that expects upper-case codes.
When a PascalCase enum has to be stored in a PostgreSQL enum or a VARCHAR column with upper-case values, convert the members to get the stored values.
HTTPRequestFailed → HTTP_REQUEST_FAILED, APIKeyRevoked → API_KEY_REVOKED.Paid are not matched; upper-case those yourself.Paid?Recognition needs at least two capitals, so one-word members are skipped to avoid changing ordinary capitalized words.
Yes, with the SCREAMING_SNAKE_CASE → PascalCase page. Names without acronyms come back exactly; an acronym returns in title form, so HTTP_REQUEST_FAILED goes back as HttpRequestFailed.