MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / parseResults

Function parseResults

src/compute-engine/oeis.ts:110–120  ·  view source on GitHub ↗
(data: unknown)

Source from the content-addressed store, hash-verified

108}
109
110function parseComments(value: unknown): string[] | undefined {
111 if (typeof value === 'string') return [value];
112 if (!Array.isArray(value)) return undefined;
113 const comments = value.filter(
114 (item): item is string => typeof item === 'string'
115 );
116 return comments.length > 0 ? comments : undefined;
117}
118
119function parseResults(data: unknown): OEISApiResult[] {
120 if (Array.isArray(data)) return data;
121
122 const payload = asRecord(data);
123 if (!payload) return [];

Callers 1

parseOEISResponseFunction · 0.85

Calls 1

asRecordFunction · 0.85

Tested by

no test coverage detected