1
1
import { Injectable } from '@angular/core' ;
2
2
import { Observable } from 'rxjs/Observable' ;
3
3
import { Platform } from '../model/platform' ;
4
- import { SharedAboutService } from '../../shared/services/shared-about.service' ;
5
4
import { StreamsService } from '../streams.service' ;
6
5
import { mergeMap } from 'rxjs/operators' ;
7
6
import { Parser } from '../../shared/services/parser' ;
@@ -16,7 +15,6 @@ import {
16
15
import { StreamDeployConfig } from '../model/stream-deploy-config' ;
17
16
import { Utils } from '../../shared/flo/support/utils' ;
18
17
19
-
20
18
/**
21
19
* Provides {@link StreamDeployConfig} related services.
22
20
*
@@ -39,11 +37,11 @@ export class StreamDeployService {
39
37
*/
40
38
public static deployer = {
41
39
is : ( key : string ) : boolean => {
42
- return / ^ ( d e p l o y e r ) ( ( \. \* ) | ( [ . ] [ a - z A - Z 0 - 9 ] { 1 , 50 } ) ? ) + ( [ . ] [ a - z A - Z 0 - 9 ] { 1 , 50 } ) $ / . test ( key ) ;
40
+ return / ^ ( d e p l o y e r . ) / . test ( key ) ;
43
41
} ,
44
42
extract : ( key : string ) : string => {
45
- const result = key . match ( / ^ d e p l o y e r \. [ \w \* ] + . ( . * ) $ / ) ;
46
- return result . length > 1 ? result [ 1 ] : '' ;
43
+ const result = key . split ( '.' ) ;
44
+ return result . length > 2 ? result [ 2 ] : '' ;
47
45
} ,
48
46
} ;
49
47
@@ -52,7 +50,7 @@ export class StreamDeployService {
52
50
*/
53
51
public static version = {
54
52
is : ( key : string ) : boolean => {
55
- return / ^ ( v e r s i o n ) + ( [ . ] [ a - z A - Z 0 - 9 ] { 2 , 50 } ) $ / . test ( key ) ;
53
+ return / ^ ( v e r s i o n . ) / . test ( key ) ;
56
54
}
57
55
} ;
58
56
@@ -61,11 +59,11 @@ export class StreamDeployService {
61
59
*/
62
60
public static app = {
63
61
is : ( key : string ) : boolean => {
64
- return / ^ ( a p p ) ( ( \. \* ) | ( [ . ] [ a - z A - Z 0 - 9 - \- ] { 1 , 50 } ) ? ) + ( [ . ] [ a - z A - Z 0 - 9 - \- ] { 1 , 50 } ) $ / . test ( key ) ;
62
+ return / ^ ( a p p . ) / . test ( key ) ;
65
63
} ,
66
64
extract : ( key : string ) : string => {
67
- const result = key . match ( / ^ a p p \. [ \w \* ] + . ( . * ) $ / ) ;
68
- return result . length > 1 ? result [ 1 ] : '' ;
65
+ const result = key . split ( '.' ) ;
66
+ return result . length > 2 ? result [ 2 ] : '' ;
69
67
}
70
68
} ;
71
69
@@ -275,5 +273,4 @@ export class StreamDeployService {
275
273
} ) ;
276
274
}
277
275
278
-
279
276
}
0 commit comments