MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseBoundaryLine

Function parseBoundaryLine

src/utils/sessionStoragePortable.ts:493–511  ·  view source on GitHub ↗

* Confirm a byte-matched line is a real compact_boundary (marker can appear * inside user content) and check for preservedSegment.

(
  line: string,
)

Source from the content-addressed store, hash-verified

491 * inside user content) and check for preservedSegment.
492 */
493function parseBoundaryLine(
494 line: string,
495): { hasPreservedSegment: boolean } | null {
496 try {
497 const parsed = JSON.parse(line) as {
498 type?: string
499 subtype?: string
500 compactMetadata?: { preservedSegment?: unknown }
501 }
502 if (parsed.type !== 'system' || parsed.subtype !== 'compact_boundary') {
503 return null
504 }
505 return {
506 hasPreservedSegment: Boolean(parsed.compactMetadata?.preservedSegment),
507 }
508 } catch {
509 return null
510 }
511}
512
513/**
514 * Single forward chunked read for the --resume load path. Attr-snap lines

Callers 2

processStraddleFunction · 0.85
scanChunkLinesFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected