SysProM
    Preparing search index...

    Function detectChanges

    • Detect whether JSON and/or Markdown have changed. Strategy:

      1. Parse both JSON and Markdown to document objects.
      2. If documents are identical, no change.
      3. If documents differ, use file modification times to determine which was edited more recently. The newer file is considered the "changed" one. If modification times are very close (< 100ms), treat as conflict.

      Parameters

      • jsonPath: string

        Path to JSON file

      • mdPath: string

        Path to Markdown file (single or multi-doc)

      Returns DetectionResult

      Detection result with jsonChanged, mdChanged, and conflict flags

      const result = detectChanges("doc.spm.json", "doc.spm.md");
      if (result.conflict) throw new Error("Both files changed");