/// Convert to list
/// @param {*} $value - value to cast
/// @param {String} $keep ("both") - whether to keep `keys`, `values` or `both` when casting a map
/// @return {List}
@function _sc-to-list($value, $keep: "both") {
  $keep: if(index("keys" "values" "both", $keep), $keep, "both");

  @if type-of($value) == "map" {
    $keys: ();
    $values: ();
    @each $key, $val in $value {
      $keys: append($keys, $key);
      $values: append($values, $val);
    }

    @if $keep == "keys" {
      @return $keys;
    }
    @else if $keep == "values" {
      @return $values;
    }
    @else {
      @return zip($keys, $values);
    }
  }

  @return if(type-of($value) != list, ($value,), $value);
}
