-
Notifications
You must be signed in to change notification settings - Fork 2
/
RedirectionUtil.ts
33 lines (27 loc) · 1.03 KB
/
RedirectionUtil.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { TypeNames } from './types';
export class RedirectionUtil {
public static isRedirection(o: any): boolean {
return [
TypeNames.DialogRedirectionTypeName,
TypeNames.ContentRedirectionTypeName,
TypeNames.NullRedirectionTypeName,
TypeNames.WebRedirectionTypeName,
TypeNames.WorkbenchRedirectionTypeName
].some(n => n === o.type);
}
public static isDialogRedirection(o: any): boolean {
return o.type === TypeNames.DialogRedirectionTypeName;
}
public static isContentRedirection(o: any): boolean {
return o.type === TypeNames.ContentRedirectionTypeName;
}
public static isNullRedirection(o: any): boolean {
return o.type === TypeNames.NullRedirectionTypeName;
}
public static isWebRedirection(o: any): boolean {
return o.type === TypeNames.WebRedirectionTypeName;
}
public static isWorkbenchRedirection(o: any): boolean {
return o.type === TypeNames.WorkbenchRedirectionTypeName;
}
}