Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Masquer les espaces
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Styles de texte
Modifier l’apparence
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 7 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
9 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
34 lignes
Copier tout
13 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
33 lignes
Copier tout
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;
Copier
Copié
Copier
Copié
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)) {
Copier
Copié
Copier
Copié
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];
}
}
}
}
Copier
Copié
Copier
Copié
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
Copier
Copié
Copier
Copié
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"));
Copier
Copié
Copier
Copié
// function myMethod(a:
string
, b: string):
string
// function myMethod(a:
number
, b: string):
[string,
string
]
// [123, "Andrew"]
// [123, "Andrew"]
Copier
Copié
Copier
Copié
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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"]
Texte modifié
Ouvrir un fichier
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"]
Trouver la différence