🔨 Refactor type guard for readability

This commit is contained in:
Iván Ovejero 2021-04-15 14:04:15 +02:00
parent bd1b81eefc
commit 12379c1d90

View file

@ -18,7 +18,7 @@ const TAG_NAME_LENGTH_LIMIT = 24;
* Type guard for string array.
*/
function isStringArray(tags: unknown[]): tags is string[] {
return Array.isArray(tags) && !tags.some((value) => typeof value !== 'string');
return Array.isArray(tags) && tags.every((value) => typeof value === 'string');
}
/**