Safely extracts a nested element from a brand
object using the provided key
path. Returns NULL
if the element doesn't exist.
Arguments
- brand
A brand object created by
read_brand_yml()
oras_brand_yml()
.- ...
One or more character strings or symbols representing the path to the nested element to extract.
See also
Other brand.yml helpers:
brand_color_pluck()
,
brand_has()
Examples
brand <- as_brand_yml(list(
meta = list(name = "Example Brand"),
color = list(primary = "#FF5733")
))
# Extract the primary color
brand_pluck(brand, "color", "primary") # "#FF5733"
#> [1] "#FF5733"
# Try to extract a non-existent element
brand_pluck(brand, "color", "secondary") # NULL
#> NULL