diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-04 21:41:34 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-04 21:41:34 +1100 |
| commit | a793205cc20c14709edebfd20ec9f3995f183874 (patch) | |
| tree | b436bec863329afdf8fa937f9ddd5924088293db /src/config/funcs.ts | |
| parent | feat: uwsm app -> app2unit (diff) | |
| download | caelestia-shell-a793205cc20c14709edebfd20ec9f3995f183874.tar.gz caelestia-shell-a793205cc20c14709edebfd20ec9f3995f183874.tar.bz2 caelestia-shell-a793205cc20c14709edebfd20ec9f3995f183874.zip | |
wallpapers: filter by size
Diffstat (limited to 'src/config/funcs.ts')
| -rw-r--r-- | src/config/funcs.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/config/funcs.ts b/src/config/funcs.ts index 5b9efa4..5d8ab44 100644 --- a/src/config/funcs.ts +++ b/src/config/funcs.ts @@ -29,12 +29,12 @@ const isCorrectType = (v: any, type: string | string[] | number[], path: string) v.splice(0, v.length, ...v.filter((item, i) => isCorrectType(item, type, `${path}[${i}]`))); } else { const valid = v.filter((item, i) => - Object.entries(type).some(([k, t]) => { - if (!item[k]) { + Object.entries(type).every(([k, t]) => { + if (!item.hasOwnProperty(k)) { console.warn(`Invalid shape for ${path}[${i}]: ${JSON.stringify(item)} != ${arrType}`); return false; } - return !isCorrectType(item[k], t as any, `${path}[${i}].${k}`); + return isCorrectType(item[k], t as any, `${path}[${i}].${k}`); }) ); v.splice(0, v.length, ...valid); // In-place filter |