Download src/agents/auth-profiles/clone.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 657 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/auth-profiles/clone.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/auth-profiles/clone.ts
-
curl -L -o clone.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/auth-profiles/clone.ts
657 Bytes
| /** | |
| * Auth profile store cloning helpers. | |
| * Keeps store snapshots JSON-serializable before callers mutate or persist | |
| * profile state. | |
| */ | |
| import type { AuthProfileStore } from "./types.js"; | |
| /** Deep-clones an auth profile store and rejects non-JSON values. */ | |
| export function cloneAuthProfileStore<T extends AuthProfileStore>(store: T): T { | |
| return JSON.parse( | |
| JSON.stringify(store, (_key, value: unknown) => { | |
| if (typeof value === "bigint" || typeof value === "function" || typeof value === "symbol") { | |
| throw new TypeError(`AuthProfileStore contains non-JSON value: ${typeof value}`); | |
| } | |
| return value; | |
| }), | |
| ) as T; | |
| } | |