mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
refactor: remove dead code (parseJsonRaw, stale re-exports) (#2246)
- Remove parseJsonRaw from packages/shared — exported but never imported - Remove dead re-exports from agent-setup.ts (AgentConfig type, generateEnvConfig) that no consumer imports (all callers use the original modules directly) Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
This commit is contained in:
parent
4ac19a375a
commit
8b99fe0a37
3 changed files with 1 additions and 19 deletions
|
|
@ -32,11 +32,6 @@ export async function wrapSshCall(op: Promise<void>): Promise<Result<void>> {
|
|||
}
|
||||
}
|
||||
|
||||
// Re-export so cloud modules can re-export from here
|
||||
export type { AgentConfig };
|
||||
|
||||
export { generateEnvConfig } from "./agents";
|
||||
|
||||
// ─── CloudRunner interface ──────────────────────────────────────────────────
|
||||
|
||||
export interface CloudRunner {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
export { parseJsonObj, parseJsonRaw, parseJsonWith } from "./parse";
|
||||
export { parseJsonObj, parseJsonWith } from "./parse";
|
||||
export { Err, Ok, type Result } from "./result";
|
||||
export { hasMessage, hasStatus, isNumber, isString, toObjectArray, toRecord } from "./type-guards";
|
||||
|
|
|
|||
|
|
@ -17,19 +17,6 @@ export function parseJsonWith<T extends v.BaseSchema<unknown, unknown, v.BaseIss
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape hatch: parse JSON to `unknown` without schema validation.
|
||||
* Use for dynamic response formats where a fixed schema isn't practical
|
||||
* (e.g., cloud APIs with 5+ response shapes).
|
||||
*/
|
||||
export function parseJsonRaw(text: string): unknown {
|
||||
try {
|
||||
return JSON.parse(text);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a JSON string and return it as a Record<string, unknown> or null.
|
||||
* Rejects non-object results (arrays, primitives).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue