github.com/thanos-io/thanos@v0.32.5/mixin/lib/utils.libsonnet (about) 1 { 2 mapRuleGroups(f): { 3 groups: [ 4 group { 5 rules: [ 6 f(rule) 7 for rule in super.rules 8 ], 9 } 10 for group in super.groups 11 ], 12 }, 13 14 joinLabels(labels): std.join(', ', std.filter(function(x) std.length(std.stripChars(x, ' ')) > 0, labels)), 15 16 firstCharUppercase(parts): std.join( 17 '', 18 [ 19 std.join( 20 '', 21 [std.asciiUpper(std.stringChars(part)[0]), std.substr(part, 1, std.length(part) - 1)] 22 ) 23 for part in parts[1:std.length(parts)] 24 ] 25 ), 26 27 toCamelCase(parts): std.join('', [parts[0], self.firstCharUppercase(parts)]), 28 29 componentParts(name): std.split(name, '-'), 30 31 sanitizeComponentName(name): if std.length(self.componentParts(name)) > 1 then self.toCamelCase(self.componentParts(name)) else name, 32 }