chore(utils): blank character detection

This commit is contained in:
Lewis Wynne 2026-03-23 17:42:42 +00:00
parent a97396ef01
commit e30777f0e3
2 changed files with 75 additions and 0 deletions

16
src/lib/utils/blank.ts Normal file
View file

@ -0,0 +1,16 @@
import type { Character } from '../types';
const DEFAULT_LANGUAGES = ['Tau Ceti Basic'];
export function isBlankCharacter(char: Character): boolean {
for (const value of Object.values(char.data)) {
if (value === '' || value === undefined || value === null || value === 0) continue;
if (Array.isArray(value)) {
if (value.length === 0) continue;
if (value.length === 1 && DEFAULT_LANGUAGES.includes(value[0])) continue;
return false;
}
return false;
}
return true;
}