phase-7: code restructure
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Split an array into smaller chunks of specified size.
|
||||
* @param array The array to split
|
||||
* @param size The size of each chunk
|
||||
* @returns Array of chunks
|
||||
* @example chunkArray([1,2,3,4,5], 2) → [[1,2], [3,4], [5]]
|
||||
*/
|
||||
export const chunkArray = <T>(array: T[], size: number): T[][] => {
|
||||
const chunkCount = Math.ceil(array.length / size);
|
||||
return Array.from({ length: chunkCount }, (_, index) => {
|
||||
const start = index * size;
|
||||
const end = start + size;
|
||||
return array.slice(start, end);
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { Logger } from '../types';
|
||||
|
||||
/**
|
||||
* Shared server-side logger utilities.
|
||||
*
|
||||
* noopLogger — silent logger for use in API server context where stdout
|
||||
* output from screener/analyst classes would pollute the request log.
|
||||
* Pass as { logger: noopLogger } to ScreenerEngine, BenchmarkProvider,
|
||||
* CatalystAnalyst, SimpleFINClient, LLMAnalyst.
|
||||
*/
|
||||
export const noopLogger: Logger = {
|
||||
write: () => {},
|
||||
log: () => {},
|
||||
warn: () => {},
|
||||
};
|
||||
Reference in New Issue
Block a user