feat(macos): configuration window + curl-backed macOS updater (#71)

This commit is contained in:
2026-05-17 02:23:44 -07:00
committed by GitHub
parent 6ca5cede3e
commit e84674e3b5
100 changed files with 13890 additions and 235 deletions
+30
View File
@@ -0,0 +1,30 @@
import type { ConfigSettingsField, ConfigSettingsPatch } from '../../types/settings';
export function isConfigSettingsPatch(
value: unknown,
fields: readonly ConfigSettingsField[],
): value is ConfigSettingsPatch {
if (!value || typeof value !== 'object') {
return false;
}
const operations = (value as { operations?: unknown }).operations;
return (
Array.isArray(operations) &&
operations.every((operation) => {
if (!operation || typeof operation !== 'object') {
return false;
}
const candidate = operation as { op?: unknown; path?: unknown; value?: unknown };
const knownPath =
typeof candidate.path === 'string' &&
fields.some((field) => field.configPath === candidate.path);
if (!knownPath) {
return false;
}
if (candidate.op === 'set') {
return 'value' in candidate;
}
return candidate.op === 'reset';
})
);
}