dictionary.pick()
The dictionary.pick()
function returns dictionaries from a global dictionary of the associated $keys
.
// Variables.
@use 'dictionary.variables' as variables;
// Modules.
@use '../../../map';
// The `translator.dictionary-pick()` or `dictionary.pick()` function.
@function pick($keys...) {
@return map.pick(variables.$dictionary, $keys...);
}
https://github.com/angular-package/sass/blob/main/translator/dictionary/_dictionary.pick.function.scss
Parameters
$keys...
$keys...
Keys to pick the dictionaries from a global dictionary.
Return
The return value is a dictionary consisting of dictionaries retrieved from a global dictionary of the associated $keys
.
Examples
// Use.
@use '@angular-package/sass/translator';
// Examples.
$-dictionary: (
general: (word: słowo, (wrapper, wrap): owijka, technology: (action: akcja)),
class: (prefix: spectre-prefix, suffix: spectre-suffix, calendars: (calendar: cal), labels: (label: lab)),
prefix: spectre,
suffix: end,
separator: '--',
var: (prefix: spectre, suffix: end)
);
$-test: translator.dictionary-merge(null, $-dictionary);
// Examples.
// Pick the key
@debug translator.dictionary-pick(general); // (general: (word: słowo, (wrapper, wrap): owijka, technology: (action: akcja)))
// Pick nested key
@debug translator.dictionary-pick((class, calendars)); // (calendars: (calendar: cal))
// Pick multiple keys
@debug translator.dictionary-pick(general, (class, calendars)); // (general: (word: słowo, (wrapper, wrap): owijka, technology: (action: akcja)), calendars: (calendar: cal))
Last updated
Was this helpful?