1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2025-11-23 21:34:49 +02:00

Resolve all possible TODO comments (#11119)

This commit is contained in:
Álvaro Mondéjar Rubio
2024-06-06 21:24:29 +02:00
committed by GitHub
parent 236f5fc715
commit 512e4cbf4a
4 changed files with 42 additions and 27 deletions

View File

@@ -98,19 +98,21 @@ const TESTS = {
const allUrlFields = [
...new Set(
data.icons
.flatMap((icon) => {
// TODO: `Omit` is not working smoothly here
const license =
// @ts-ignore
icon.license && icon.license.url
? // @ts-ignore
[icon.license.url]
: [];
return [icon.source, icon.guidelines, ...license];
})
.filter(Boolean),
data.icons.flatMap((icon) => {
/** @type {string[]} */
const license =
icon.license !== undefined && Object.hasOwn(icon.license, 'url')
? [
// TODO: `hasOwn` is not currently supported by TS.
// See https://github.com/microsoft/TypeScript/issues/44253
/** @type {string} */
// @ts-ignore
icon.license.url,
]
: [];
const guidelines = icon.guidelines ? [icon.guidelines] : [];
return [icon.source, ...guidelines, ...license];
}),
),
];