feat(common): Release v2.2.0 (#223)

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-11-10 21:31:03 +01:00 committed by GitHub
parent 8b21e9f6c7
commit 8bfc33eb8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 244 additions and 47 deletions

View file

@ -0,0 +1,17 @@
{{/*
Returns the items in a map that have a certain key
*/}}
{{- define "bjw-s.common.lib.getMapItemsWithKey" -}}
{{- $map := .map -}}
{{- $keyToFind := .key -}}
{{- $output := dict -}}
{{- if not (empty $keyToFind) -}}
{{- range $key, $item := $map -}}
{{- if not (empty (dig $keyToFind nil $item)) -}}
{{- $_ := set $output $key $item -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $output | toYaml -}}
{{- end }}