-
I'm using this library in an (arguably misguided) attempt to parse and generate Helm templates, which use Go's metadata:
name: foo-{{ .Release.Name }} but it quickly falls apart if you want to interpolate some non-string value like: spec:
replicas: {{ .Values.replicaCount }}
# warn: Keys with collection values will be stringified due to JS Object restrictions: ... Is it feasible to extend the parser to be able to deal with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, because that's valid YAML that has a non-scalar meaning, and it's parsed as an object with an object key already by the lexer. However, you could add a wrapper around the
|
Beta Was this translation helpful? Give feedback.
No, because that's valid YAML that has a non-scalar meaning, and it's parsed as an object with an object key already by the lexer.
However, you could add a wrapper around the
yaml
parser to make it work:{{ ... }}
sequences with some string that's a valid YAML plain scalar, like__TEMPLATE_VAR_#__
where#
is an identifier that you keep track of.parseDocument()
.__TEMPLATE_VAR_#__
strings with their original values.