Created
September 24, 2019 21:00
-
-
Save MattMcAdams/ff9300f2c209501bcb0bc66b369aa5db to your computer and use it in GitHub Desktop.
utility function to get value of a key in a deep map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Get value from a deep map | |
/// @group utility | |
/// @param {map} $map - source map to pull key from | |
/// @param {string...} $keys - key to extract value of | |
/// @return key value | |
@function map-deep-get($map, $keys...) { | |
@each $key in $keys { | |
$map: map-get($map, $key); | |
} | |
@return $map; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment