MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / newlines

Function newlines

__tests__/objcpp-cpp-items.test.ts:527–527  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

525 const parts = splitObjcpp(source)!;
526 expect(parts).not.toBeNull();
527 const newlines = (text: string): number[] => [...text].flatMap((ch, k) => (ch === '\n' ? [k] : []));
528 for (const part of [parts.cpp, withoutObjcppItems(source, parts.items), parts.sends ?? source]) {
529 expect(part.length).toBe(source.length);
530 expect(newlines(part)).toEqual(newlines(source));

Callers 1

expectSameShapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected