translate.map()
// Sass.
@use 'sass:map';
@use 'sass:meta';
// Modules.
@use '../dictionary';
// Functions.
@use 'translate.list.function' as *;
@use 'translate.string.function' as *;
// The `translator.translate-map()` or `translate.map()` function.
@function map($map, $key: null, $dictionary: (), $global: null) {
@if type-of($map) == map {
@each $map-key, $value in $map {
$map: if(
meta.type-of($value) == string,
map.set($map, $map-key, string($value, $key, $dictionary, $global)),
if(
meta.type-of($value) == list,
map.set($map, $map-key, list($value, $key, $dictionary, $global)),
$map
)
);
}
}
@return $map;
}https://github.com/angular-package/sass/blob/main/translator/translate/_translate.map.function.scss
Parameters
$map
$map$n
$n$key: null
$key: null$dictionary: ()
$dictionary: ()$global: null
$global: nullReturn
Examples
Last updated