Download web/src/lib/env-state.ts from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/web/src/lib/env-state.ts
- Command line
-
hf download hf://SaylorTwift/hermes-agent/web/src/lib/env-state.ts
-
curl -L -o env-state.ts https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/web/src/lib/env-state.ts
526 Bytes
| import type { EnvVarInfo } from "./api"; | |
| /** Reconcile a successful DELETE /api/env response with the Keys page state. */ | |
| export function removeDeletedEnvVarFromState( | |
| vars: Record<string, EnvVarInfo> | null, | |
| key: string, | |
| ): Record<string, EnvVarInfo> | null { | |
| const info = vars?.[key]; | |
| if (!vars || !info) return vars; | |
| if (info.custom) { | |
| const updated = { ...vars }; | |
| delete updated[key]; | |
| return updated; | |
| } | |
| return { | |
| ...vars, | |
| [key]: { ...info, is_set: false, redacted_value: null }, | |
| }; | |
| } | |