Skip to content

Commit 2cfdb9f

Browse files
authored
🤖 Merge PR #72107 [@types/diff] patched() callback can return false by @k-yle
1 parent 8d857d5 commit 2cfdb9f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎types/diff/diff-tests.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ function verifyApplyMethods(oldStr: string, newStr: string, uniDiffStr: string)
115115
},
116116
patched(index, content) {
117117
index; // $ExpectType ParsedDiff
118-
verifyApply.push(content);
118+
if (content !== false) {
119+
verifyApply.push(content);
120+
}
119121
},
120122
complete(err) {
121123
if (err) {

‎types/diff/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export interface ApplyPatchOptions {
127127

128128
export interface ApplyPatchesOptions extends ApplyPatchOptions {
129129
loadFile(index: ParsedDiff, callback: (err: any, data: string) => void): void;
130-
patched(index: ParsedDiff, content: string, callback: (err: any) => void): void;
130+
patched(index: ParsedDiff, content: string | false, callback: (err: any) => void): void;
131131
complete(err: any): void;
132132
}
133133

0 commit comments

Comments
 (0)