setDefaultForm function infrastructure exported ✓ 100.0%
Last updated: 2026-03-01T23:25:47.133Z
Metrics
LOC: 11
Complexity: 2
Params: 1
Coverage: 100.0% (2/2 lines, 1x executed)
Signature
setDefaultForm(formId: string): : Promise<void>
Summary
Sets one form as the default, clearing isDefault from all others.
Tags
#@param formId - The form to mark as default
Source Code
export async function setDefaultForm(formId: string): Promise<void> {
await updateStorageAtomically(
STORAGE_KEYS.SAVED_FORMS,
[] as SavedForm[],
(forms) =>
forms.map((f) => ({
...f,
isDefault: f.id === formId ? true : undefined,
})),
);
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| updateStorageAtomically | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| handle | uses |