Jacob Schmidt 0465b05845 feat: add shutdown command, auth/entries backend, and editor panel
- Add Rust shutdown command that kills sidecar and exits app cleanly
- Frontend calls invoke('shutdown') after vault flush on close
- Add auth.ts, entries.ts, and normalize.ts backend modules
- Add EditorPanel.svelte component
- Expand entries store with full CRUD support
- Add JournalEntryDtos and JournalEntryDtoMapper in Journal.Core
- Update entry search, fragments, and sidecar CLI

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-02-26 15:34:28 -06:00

19 lines
467 B
TypeScript

type UnknownObject = Record<string, unknown>;
function asObject(value: unknown): UnknownObject | undefined {
return value && typeof value === "object" ? (value as UnknownObject) : undefined;
}
export function pickCase<T>(
source: unknown,
camelKey: string,
pascalKey: string,
fallback: T
): T {
const obj = asObject(source);
if (!obj) return fallback;
const value = obj[camelKey] ?? obj[pascalKey];
return (value as T | undefined) ?? fallback;
}