// ---------------------------------------------------------
// deep-map-check
// Check if nested map has a value by the keys
//
// Required arguments:
// `$map` Map
// `$keys` String(s)
//
// Example of use:
// deep-map-check($nested-map, 'key-1', 'key-2')
//
// @return Bool
// ---------------------------------------------------------
@function deep-map-check ($map, $keys...) {
  @if type-of($map) != 'map' {
    @error 'The argument $map: `#{$map}` is of incorrect type: `#{type-of($map)}`. Type of `Map` is required!';
  }

  @each $key in $keys {
    @if not map-has-key($map, $key) {
      @return false;
    }

    $map: map-get($map, $key);
  }

  @return true;
}
