Skip to content
Extraits de code Groupes Projets
Valider e092066c rédigé par Kai A. Hiller's avatar Kai A. Hiller
Parcourir les fichiers

Rename isInstanceOfTypes


Signed-off-by: default avatarKai A. Hiller <V02460@gmail.com>
parent 53cf1ecb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -33,7 +33,7 @@ import { Log } from "./log"; ...@@ -33,7 +33,7 @@ import { Log } from "./log";
import "source-map-support/register"; import "source-map-support/register";
import { MetricPeg, PrometheusBridgeMetrics } from "./metrics"; import { MetricPeg, PrometheusBridgeMetrics } from "./metrics";
import { IMatrixEvent } from "./matrixtypes"; import { IMatrixEvent } from "./matrixtypes";
import { instanceofsome } from "./util"; import { isInstanceOfTypes } from "./util";
const log = new Log("DiscordAS"); const log = new Log("DiscordAS");
...@@ -239,9 +239,9 @@ function logOnEventError(err: Error): void { ...@@ -239,9 +239,9 @@ function logOnEventError(err: Error): void {
const verboseTypes = [Unstable.EventUnknownError]; const verboseTypes = [Unstable.EventUnknownError];
switch (true) { switch (true) {
case instanceofsome(err, errTypes): log.error(err); case isInstanceOfTypes(err, errTypes): log.error(err);
case instanceofsome(err, infoTypes): log.info(err); case isInstanceOfTypes(err, infoTypes): log.info(err);
case instanceofsome(err, verboseTypes): log.verbose(err); case isInstanceOfTypes(err, verboseTypes): log.verbose(err);
default: log.warn(err); default: log.warn(err);
} }
} }
......
...@@ -428,7 +428,7 @@ type Type = Function; // tslint:disable-line ban-types ...@@ -428,7 +428,7 @@ type Type = Function; // tslint:disable-line ban-types
/** /**
* Returns true if `obj` is subtype of at least one of the given types. * Returns true if `obj` is subtype of at least one of the given types.
*/ */
export function instanceofsome(obj: object, types: Type[]): boolean { export function isInstanceOfTypes(obj: object, types: Type[]): boolean {
return types.some((type) => obj instanceof type); return types.some((type) => obj instanceof type);
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter