Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Discriminated union diff
Created
3 years ago
Diff never expires
Clear
Export
Share
Explain
18 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
29 lines
Copy
17 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
29 lines
Copy
Copy
Copied
Copy
Copied
type
Options
=
{ foo: 'bar' }
type
Common
=
'c'
Copy
Copied
Copy
Copied
type ArgsRegExp = [first:
RegExp
, second?:
Options
]
type ArgsRegExp = [first:
'a0'
, second?:
Common
]
type ArgsString = [first:
string
, second?:
string
, third?:
Options
]
type ArgsString = [first:
'b0'
, second?:
'b1'
, third?:
Common
]
type Args = ArgsRegExp | ArgsString
type Args = ArgsRegExp | ArgsString
interface Params {
interface Params {
Copy
Copied
Copy
Copied
readonly
pattern: RegExp
readonly
custom: string
readonly
options
?:
Options
readonly
common
?:
Common
}
}
function getParams(args: ArgsRegExp): Params
function getParams(args: ArgsRegExp): Params
function getParams(args: ArgsString): Params
function getParams(args: ArgsString): Params
function getParams([first, second, third]: Args): Params {
function getParams([first, second, third]: Args): Params {
Copy
Copied
Copy
Copied
if (first
instanceof RegExp
) {
if (first
=== 'a0'
) {
return {
return {
Copy
Copied
Copy
Copied
pattern
: first,
custom
: first,
options
: second,
common
: second,
}
}
}
}
return {
return {
Copy
Copied
Copy
Copied
pattern: new RegExp(
custom:
first
,
first
+
second
second
,
)
,
common
: third,
options
: third,
}
}
}
}
Copy
Copied
Copy
Copied
Saved diffs
Original text
Open file
type Options = { foo: 'bar' } type ArgsRegExp = [first: RegExp, second?: Options] type ArgsString = [first: string, second?: string, third?: Options] type Args = ArgsRegExp | ArgsString interface Params { readonly pattern: RegExp readonly options?: Options } function getParams(args: ArgsRegExp): Params function getParams(args: ArgsString): Params function getParams([first, second, third]: Args): Params { if (first instanceof RegExp) { return { pattern: first, options: second, } } return { pattern: new RegExp( first, second ), options: third, } }
Changed text
Open file
type Common = 'c' type ArgsRegExp = [first: 'a0', second?: Common] type ArgsString = [first: 'b0', second?: 'b1', third?: Common] type Args = ArgsRegExp | ArgsString interface Params { readonly custom: string readonly common?: Common } function getParams(args: ArgsRegExp): Params function getParams(args: ArgsString): Params function getParams([first, second, third]: Args): Params { if (first === 'a0') { return { custom: first, common: second, } } return { custom: first + second, common: third, } }
Find difference