2021-09-19 12:28:21 +02:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
|
2021-08-02 13:16:10 +02:00
|
|
|
/**
|
2021-09-07 13:37:18 +02:00
|
|
|
* Check if class/object A is the same as or a subclass of class B.
|
2021-08-02 13:16:10 +02:00
|
|
|
*/
|
2021-09-19 12:28:21 +02:00
|
|
|
export function subclassOf(A: Object, B: Object): boolean {
|
2021-09-07 13:37:18 +02:00
|
|
|
// noinspection JSUnresolvedVariable
|
2021-08-02 13:16:10 +02:00
|
|
|
return A && (A === B || A.prototype instanceof B);
|
|
|
|
}
|
2021-09-19 12:28:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if a string contains HTML code/tags
|
|
|
|
*/
|
|
|
|
export function containsHTML(string_: string): boolean {
|
|
|
|
// eslint-disable-next-line unicorn/better-regex
|
|
|
|
return /<[a-z][\s\S]*>/i.test(string_);
|
|
|
|
}
|