(vars)
| 33 | |
| 34 | // Find variables with unique values, and create a mapping between them. |
| 35 | function getUniqueVars(vars) { |
| 36 | let unique = {}; |
| 37 | for (let key in vars) { |
| 38 | if (!unique[vars[key]]) { |
| 39 | unique[vars[key]] = [key]; |
| 40 | } else { |
| 41 | unique[vars[key]].push(key); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | let mappings = {}; |
| 46 | for (let val in unique) { |
| 47 | for (let key of unique[val]) { |
| 48 | mappings[key] = unique[val]; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | return mappings; |
| 53 | } |
| 54 | |
| 55 | // Get unique variables, static variables, and a mapping of original variable names. |
| 56 | function getVariableMappings(themes) { |
no test coverage detected