@import './map/index';

$__config__: () !global;

@function lookup($keys...) {
  @if map-deep-has-keys($__config__, $keys...) {
    @return map-deep-get($__config__, $keys...);
  }

  @else {
    @return false;
  }
}

@function set($key, $obj) {
  $__config__: map-merge($__config__, ($key:$obj)) !global;
  @return $obj;
}

@function get($keys: false , $i: false) {
  @if not $keys { @return $__config__ }

  $val: lookup($keys...);
  @if $i {
    $val: nth($val, $i);
  }

  @return $val;
}
