MCPcopy
hub / github.com/hashicorp/hcl / Deep

Function Deep

ext/transform/transform.go:27–32  ·  view source on GitHub ↗

Deep applies the given transform to the given body and then wraps the result such that any descendent blocks that are decoded will also have the transform applied to their bodies. This allows for language extensions that define a particular block type for a particular body and all nested blocks wit

(body hcl.Body, transformer Transformer)

Source from the content-addressed store, hash-verified

25// only the methods defined for interface hcl.Body, and may not type-assert
26// to access other methods.
27func Deep(body hcl.Body, transformer Transformer) hcl.Body {
28 return deepWrapper{
29 Transformed: transformer.TransformBody(body),
30 Transformer: transformer,
31 }
32}
33
34// deepWrapper is a hcl.Body implementation that ensures that a given
35// transformer is applied to another given body when content is extracted,

Callers 2

transformContentMethod · 0.85
TestDeepFunction · 0.85

Calls 1

TransformBodyMethod · 0.65

Tested by 1

TestDeepFunction · 0.68