stylesheets/flint/functions/lib/_map-fetch.scss in flint-gs-1.6.5 vs stylesheets/flint/functions/lib/_map-fetch.scss in flint-gs-1.7.0
- old
+ new
@@ -3,31 +3,28 @@
// @param $map [map] : map to fetch from
// @param $keys [string | list] : string of key, or list of strings
// -------------------------------------------------------------------------------
// @return fetched literal | false
-@function map-fetch($map, $keys) {
+@function flint-map-fetch($map, $keys) {
$key: nth($keys, 1);
$length: length($keys);
$value: map-get($map, $key);
- // check if the key was incorrect, meaning the map doesn't exist
- @if $value == null {
- @warn "Invalid arguments passed to function: map-fetch(#{$map}, #{$keys}). One or more of the keys do not exist.";
- @return false;
- }
-
- @else {
+ @if $value != null {
@if $length > 1 {
$rest: ();
@for $i from 2 through $length {
$rest: append($rest, nth($keys, $i))
}
- @return map-fetch($value, $rest);
+ @return flint-map-fetch($value, $rest);
} @else {
@return $value;
}
+ } @else {
+ @warn "Invalid arguments passed to function: flint-map-fetch(#{$map}, #{$keys}). One or more of the keys do not exist.";
+ @return false;
}
}