mirror of https://github.com/dmarkham/enumer.git
Add prefix after transform
This commit is contained in:
parent
ea11b04142
commit
5511caae23
|
@ -158,8 +158,7 @@ The default value for `transform` flag is `noop` which means no transformation w
|
||||||
If a prefix is provided via the `trimprefix` flag, it will be trimmed from the start of each name (before
|
If a prefix is provided via the `trimprefix` flag, it will be trimmed from the start of each name (before
|
||||||
it is transformed). If a name doesn't have the prefix it will be passed unchanged.
|
it is transformed). If a name doesn't have the prefix it will be passed unchanged.
|
||||||
|
|
||||||
If a prefix is provided via the `addprefix` flag, it will be added to the start of each name (before
|
If a prefix is provided via the `addprefix` flag, it will be added to the start of each name (after trimming and after transforming).
|
||||||
it is transformed and after trimming).
|
|
||||||
|
|
||||||
## Inspiring projects
|
## Inspiring projects
|
||||||
|
|
||||||
|
|
|
@ -330,10 +330,10 @@ func (g *Generator) generate(typeName string, includeJSON, includeYAML, includeS
|
||||||
|
|
||||||
g.trimValueNames(values, trimPrefix)
|
g.trimValueNames(values, trimPrefix)
|
||||||
|
|
||||||
g.prefixValueNames(values, addPrefix)
|
|
||||||
|
|
||||||
g.transformValueNames(values, transformMethod)
|
g.transformValueNames(values, transformMethod)
|
||||||
|
|
||||||
|
g.prefixValueNames(values, addPrefix)
|
||||||
|
|
||||||
runs := splitIntoRuns(values)
|
runs := splitIntoRuns(values)
|
||||||
// The decision of which pattern to use depends on the number of
|
// The decision of which pattern to use depends on the number of
|
||||||
// runs in the numbers. If there's only one, it's easy. For more than
|
// runs in the numbers. If there's only one, it's easy. For more than
|
||||||
|
|
Loading…
Reference in New Issue