Skip to content

Feature Request: Apply to a change to a String #176

Open
@PlainviewData

Description

@PlainviewData

Maybe I'm not seeing it in the docs, but I think it would be nice to apply a Change Object, or an array of them, to a string to be able to create a changed string.

Activity

subwaymatch

subwaymatch commented on May 13, 2017

@subwaymatch

+1 for this feature

ExplodingCabbage

ExplodingCabbage commented on Dec 27, 2023

@ExplodingCabbage
Collaborator

Makes sense, but figuring out how to adapt the logic in applyPatch is not entirely trivial. That logic assumes that the changes are a series of hunks with line numbers and local context (rather than literally the entire file content being included in the diff like it is with change objects) and that each change is to an entire line; these things aren't reliably true for change objects.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @subwaymatch@ExplodingCabbage@PlainviewData

        Issue actions

          Feature Request: Apply to a change to a String · Issue #176 · kpdecker/jsdiff