Skip to content

Instantly share code, notes, and snippets.

@adover
Last active February 7, 2019 23:50
Show Gist options
  • Save adover/da3e043011667d23dabfcbea8513f3dd to your computer and use it in GitHub Desktop.
Save adover/da3e043011667d23dabfcbea8513f3dd to your computer and use it in GitHub Desktop.
Map-Deep-Keys
/// @name map-deep-keys
/// @group functions
/// Find a list of keys buried deep in a nested map
@function map-deep-keys($map, $keys...) {
@for $i from 1 through length($keys) + 1 {
@if $i == length($keys) + 1 {
@return map-keys($map);
}
$key: nth($keys, $i);
$map: map-get($map, $key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment