This regex pattern does not properly handle key names like procedureModifier1 which I would expect to formats to/from procedure_modifier_1. It currently translates formats to/from procedure_modifier1.
Changing the regex to /(.)(?=[A-Z0-9])/u corrects the formatting.
This is purely a matter of preference. In fact, using a custom formatter in a project created another bug where it was not expected to have the underscore before a number. 🤦🏼♂️
The default key formatter uses the regex pattern
/(.)(?=[A-Z])/u
.This regex pattern does not properly handle key names like
procedureModifier1
which I would expect to formats to/fromprocedure_modifier_1
. It currently translates formats to/fromprocedure_modifier1
.Changing the regex to
/(.)(?=[A-Z0-9])/u
corrects the formatting.