MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / assertProbeResponse

Function assertProbeResponse

packages/extension/scripts/check-worker-sandbox.ts:62–86  ·  view source on GitHub ↗
(entry: string, response: unknown)

Source from the content-addressed store, hash-verified

60function getProbeRequest(entry: string): unknown {
61 if (entry === 'codegen/worker.ts') {
62 return {
63 id: 1,
64 payload: {
65 pluginCode: 'export default { name: "worker-probe", code: {} }',
66 style: {},
67 options: { useRem: false, rootFontSize: 16, scale: 1 }
68 }
69 }
70 }
71
72 if (entry === 'mcp/transform-variables/worker.ts') {
73 return {
74 id: 1,
75 payload: {
76 pluginCode: 'export default { name: "worker-probe", code: {} }',
77 references: [],
78 options: { useRem: false, rootFontSize: 16, scale: 1 }
79 }
80 }
81 }
82
83 throw new Error(`[worker-check] Missing probe request for ${entry}`)
84}
85
86function assertProbeResponse(entry: string, response: unknown): void {
87 if (!isRecord(response)) {
88 throw new Error(`[worker-check] ${entry} probe returned a non-object response.`)
89 }

Callers 1

runBrowserCheckFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected