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 whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
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
Untitled diff
Created
7 years ago
Diff never expires
Clear
Export
Share
Explain
9 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
34 lines
Copy
13 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
33 lines
Copy
import ow from "ow";
import ow from "ow";
function myMethod(a: string): string;
function myMethod(a: string): string;
function myMethod(a: number): number;
function myMethod(a: number): number;
Copy
Copied
Copy
Copied
function myMethod(a: number, b: string):
string
;
function myMethod(a: number, b: string):
[string,
string
]
;
function myMethod(a:
any
, b?: string)
: any
{
function myMethod(a:
string | number
, b?: string)
{
if (ow.isValid(a, ow.string) && ow.isValid(b, ow.undefined)) {
if (ow.isValid(a, ow.string) && ow.isValid(b, ow.undefined)) {
console.log("function myMethod(a: string): string");
console.log("function myMethod(a: string): string");
return a;
return a;
}
}
if (ow.isValid(a, ow.number) && ow.isValid(b, ow.undefined)) {
if (ow.isValid(a, ow.number) && ow.isValid(b, ow.undefined)) {
console.log("function myMethod(a: number): number");
console.log("function myMethod(a: number): number");
return a;
return a;
}
}
if (ow.isValid(a, ow.number) && ow.isValid(b, ow.string)) {
if (ow.isValid(a, ow.number) && ow.isValid(b, ow.string)) {
Copy
Copied
Copy
Copied
console.log("function myMethod(a:
string
, b: string):
string
");
console.log("function myMethod(a:
number
, b: string):
[string,
string
]
");
return [a, b];
return [a, b];
}
}
}
}
Copy
Copied
Copy
Copied
Text moved to lines 27-30
console.log(myMethod(123));
// function myMethod(a: number): number
// 123
console.log(myMethod("Andrew"));
console.log(myMethod("Andrew"));
// function myMethod(a: string): string
// function myMethod(a: string): string
// Andrew
// Andrew
Copy
Copied
Copy
Copied
Text moved from lines 23-26
console.log(myMethod(123));
// function myMethod(a: number): number
// 123
console.log(myMethod(123, "Andrew"));
console.log(myMethod(123, "Andrew"));
Copy
Copied
Copy
Copied
// function myMethod(a:
string
, b: string):
string
// function myMethod(a:
number
, b: string):
[string,
string
]
// [123, "Andrew"]
// [123, "Andrew"]
Copy
Copied
Copy
Copied
Saved diffs
Original text
Open file
import ow from "ow"; function myMethod(a: string): string; function myMethod(a: number): number; function myMethod(a: number, b: string): string; function myMethod(a: any, b?: string): any { if (ow.isValid(a, ow.string) && ow.isValid(b, ow.undefined)) { console.log("function myMethod(a: string): string"); return a; } if (ow.isValid(a, ow.number) && ow.isValid(b, ow.undefined)) { console.log("function myMethod(a: number): number"); return a; } if (ow.isValid(a, ow.number) && ow.isValid(b, ow.string)) { console.log("function myMethod(a: string, b: string): string"); return [a, b]; } } console.log(myMethod(123)); // function myMethod(a: number): number // 123 console.log(myMethod("Andrew")); // function myMethod(a: string): string // Andrew console.log(myMethod(123, "Andrew")); // function myMethod(a: string, b: string): string // [123, "Andrew"]
Changed text
Open file
import ow from "ow"; function myMethod(a: string): string; function myMethod(a: number): number; function myMethod(a: number, b: string): [string, string]; function myMethod(a: string | number, b?: string) { if (ow.isValid(a, ow.string) && ow.isValid(b, ow.undefined)) { console.log("function myMethod(a: string): string"); return a; } if (ow.isValid(a, ow.number) && ow.isValid(b, ow.undefined)) { console.log("function myMethod(a: number): number"); return a; } if (ow.isValid(a, ow.number) && ow.isValid(b, ow.string)) { console.log("function myMethod(a: number, b: string): [string, string]"); return [a, b]; } } console.log(myMethod("Andrew")); // function myMethod(a: string): string // Andrew console.log(myMethod(123)); // function myMethod(a: number): number // 123 console.log(myMethod(123, "Andrew")); // function myMethod(a: number, b: string): [string, string] // [123, "Andrew"]
Find difference