Patch
One file-level patch operation.
Patch values are returned by diff and yielded by
decode.
Fields
sourceSource path of the patch as a
Path.Present for delete, modify, move, and copy operations.
Example
targetTarget path of the patch as a
Path.Present for create, modify, move, and copy operations.
Example
typeOperation kind as a symbol.
One of
:CREATE:,:DELETE:,:MODIFY:,:MOVE:, or:COPY:.Example
Methods
apply base -> (Str | Bin)
Applies the patch to base.
Parameters
| Name | Type | Description |
|---|---|---|
base |
(Str | Bin) |
Content to patch. Text content must still be valid UTF-8 once patched. |
Returns
The same type as base.
Errors
| Exception | Condition |
|---|---|
ApplyError |
The patch does not apply cleanly |
ApplyError |
A text result is not valid UTF-8 |
TypeError |
base is not Str or Bin |