MCPcopy Create free account
hub / github.com/HelloCSV/HelloCSV / eachWithObject

Function eachWithObject

src/utils/functional.ts:8–17  ·  view source on GitHub ↗
(
  collection: T[],
  callback: (item: T, obj: Record<string, P>) => void
)

Source from the content-addressed store, hash-verified

6}
7
8export function eachWithObject<T, P>(
9 collection: T[],
10 callback: (item: T, obj: Record<string, P>) => void
11): Record<string, P> {
12 const obj: Record<string, P> = {};
13 collection.forEach((item) => {
14 callback(item, obj);
15 });
16 return obj;
17}
18
19export function hasData(row: Record<string, any>) {
20 const data = { ...row };

Callers 2

transformSheetFunction · 0.90
validateSheetFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected