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
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
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
Discriminated union diff
Créé
il y a 3 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
18 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
29 lignes
Copier tout
17 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
29 lignes
Copier tout
Copier
Copié
Copier
Copié
type
Options
=
{ foo: 'bar' }
type
Common
=
'c'
Copier
Copié
Copier
Copié
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 {
Copier
Copié
Copier
Copié
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 {
Copier
Copié
Copier
Copié
if (first
instanceof RegExp
) {
if (first
=== 'a0'
) {
return {
return {
Copier
Copié
Copier
Copié
pattern
: first,
custom
: first,
options
: second,
common
: second,
}
}
}
}
return {
return {
Copier
Copié
Copier
Copié
pattern: new RegExp(
custom:
first
,
first
+
second
second
,
)
,
common
: third,
options
: third,
}
}
}
}
Copier
Copié
Copier
Copié
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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, } }
Texte modifié
Ouvrir un fichier
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, } }
Trouver la différence