Use string concatenation instead

This commit is contained in:
Lars Strojny 2022-11-24 19:59:03 +01:00
parent d25207923c
commit e5b3a90fae
No known key found for this signature in database
GPG key ID: 887416A2AD3B0CA9

View file

@ -80,7 +80,7 @@ export function formatName(serviceName: string, description: string, unit: strin
.filter(isType('string')) .filter(isType('string'))
.map((v) => camelCaseToSnakeCase(v)) .map((v) => camelCaseToSnakeCase(v))
// Remove duplicate prefix // Remove duplicate prefix
.reduce((carry, value) => (value.startsWith(carry) ? value : carry + '_' + value)) .reduce((carry, value) => (value.startsWith(carry) ? value : `${carry}_${value}`))
) )
} }