// Sass.
@use 'sass:list';
@use 'sass:map';
// The `map.values()` function.
@function values($map, $keys...) {
@if list.length($keys) > 0 {
@for $i from 1 through list.length($keys) {
$keys: if(
map.has-key($map, list.nth($keys, $i)),
list.set-nth($keys, $i, map.get($map, list.nth($keys, $i))),
$keys
);
}
} @else {
$keys: map.values($map);
}
@return $keys;
}
// Use.
@use '@angular-package/sass/map';
// Examples.
// key string
@debug map.values((a: 1, b: 2, c: 3), 'a', 'b', 'c'); // (1, 2, 3)
// different map order
@debug map.values((b: 2, a: 1, c: 3), 'a', 'b', 'c'); // (1, 2, 3)
// different map order + keys
@debug map.values((b: 2, a: 1, c: 3), 'c', 'b', 'a'); // (3, 2, 1)
@debug map.values((a: 1, b: 2, c: 3), 'b', 'c'); // (2, 3)
// key list
@debug map.values(((a, b): 1, b: 2, c: 3), 'a', (a, b), 'c'); // ("a", 1, 3)
// key map
@debug map.values((b: 2, (a: b): 1, c: 3), 'a', (a: b), 'c'); // ("a", 1, 3)
// default functionality
@debug map.values((a: 1, b: 2, c: 3)); // (1, 2, 3)