You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
516 B
22 lines
516 B
import { defaultIconDimensions } from '../icon/defaults.mjs';
|
|
|
|
function expandIconSet(data) {
|
|
const icons = Object.keys(data.icons);
|
|
Object.keys(
|
|
defaultIconDimensions
|
|
).forEach((prop) => {
|
|
if (typeof data[prop] !== typeof defaultIconDimensions[prop]) {
|
|
return;
|
|
}
|
|
const value = data[prop];
|
|
icons.forEach((name) => {
|
|
const item = data.icons[name];
|
|
if (!(prop in item)) {
|
|
item[prop] = value;
|
|
}
|
|
});
|
|
delete data[prop];
|
|
});
|
|
}
|
|
|
|
export { expandIconSet };
|
|
|