Skip to content

feat: unified diff (patch) output for line mode — discussion #18

Description

@krkarma777

Problem

Line mode produces entries/ranges but no standard interchange format. Tooling (code review, CLI, git-adjacent workflows) speaks unified diff.

Proposal (needs scoping discussion first)

  • `formatPatch(a, b, options)` → unified diff string with configurable context lines.
  • Possibly `applyPatch` later — that doubles the API surface and test burden, so decide deliberately whether it belongs here or stays jsdiff territory.

Constraints

  • Keep the core zero-dependency and tree-shakeable (separate export path, e.g. `@krkarma777/string-diff/patch`).
  • If we ship it, fuzz round-trip: applyPatch(a, formatPatch(a, b)) === b.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions