Skip to contents

Checks if a given brand object has a specific nested element accessible via the additional arguments provided as key paths.

Usage

brand_has(brand, ...)

Arguments

brand

A brand object created by read_brand_yml() or as_brand_yml().

...

One or more character strings or symbols representing the path to the nested element to check.

Value

TRUE if the nested element exists in the brand object, FALSE otherwise.

See also

Other brand.yml helpers: brand_color_pluck(), brand_pluck()

Examples

brand <- as_brand_yml(list(
  meta = list(name = "Example Brand"),
  color = list(primary = "#FF5733")
))

# Check if brand has a primary color
brand_has(brand, "color", "primary") # TRUE
#> [1] TRUE

# Check if brand has a secondary color
brand_has(brand, "color", "secondary") # FALSE
#> [1] FALSE