mirror of
https://github.com/iconify/iconify.git
synced 2024-12-13 14:13:06 +00:00
Fix validating empty icon sets
This commit is contained in:
parent
2e838b5ff4
commit
44a36fdf30
@ -173,8 +173,17 @@ export function validateIconSet(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Check not_found
|
||||||
|
if (data.not_found !== void 0 && !(data.not_found instanceof Array)) {
|
||||||
|
if (fix) {
|
||||||
|
delete data.not_found;
|
||||||
|
} else {
|
||||||
|
throw new Error('Invalid not_found list');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure icons list is not empty
|
// Make sure icons list is not empty
|
||||||
if (!Object.keys(data.icons).length) {
|
if (!Object.keys(data.icons).length && !data.not_found?.length) {
|
||||||
throw new Error('Icon set is empty');
|
throw new Error('Icon set is empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user