"Fossies" - the Fresh Open Source Software Archive 
Member "jitsi-meet-7315/react/features/base/ui/utils.ts" (2 Jun 2023, 607 Bytes) of package /linux/misc/jitsi-meet-7315.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /**
2 * Creates the color tokens based on the color theme and the association map.
3 * If a key is not found in the association map it defaults to the current value.
4 *
5 * @param {Object} colorMap - A map between the token name and the actual color value.
6 * @param {Object} colors - An object containing all the theme colors.
7 * @returns {Object}
8 */
9 export function createColorTokens(colorMap: Object, colors: Object): any {
10 return Object.entries(colorMap)
11 .reduce((result, [ token, value ]: [any, keyof Object]) =>
12 Object.assign(result, { [token]: colors[value] || value }), {});
13 }