File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/metric/deprecated-images Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- // @ts -expect-error it's a js library
21import cfLogs from 'cf-logs' ;
32
43// eslint-disable-next-line import/no-unresolved
54import { DeprecatedImageDto } from './deprecated-image.dto' ;
65
76const logger = cfLogs . Logger ( 'codefresh:containerLogger' ) ;
87
8+ // eslint-disable-next-line no-control-regex
9+ const DEPRECATED_IMAGE_REGEX = / ^ \u001b \[ 3 1 m \u001b \[ 1 m \[ D E P R E C A T I O N N O T I C E ] .+ ?S u g g e s t t h e a u t h o r o f (?< image > .+ ?) t o / ;
10+
911class DeprecatedImagesCollector {
1012
1113 private list : DeprecatedImageDto [ ] = [ ] ;
@@ -35,9 +37,7 @@ class DeprecatedImagesCollector {
3537 }
3638
3739 private _parseImageName ( logText : string ) {
38- // eslint-disable-next-line no-control-regex
39- const regex = / ^ \u001b \[ 3 1 m \u001b \[ 1 m \[ D E P R E C A T I O N N O T I C E ] .+ ?S u g g e s t t h e a u t h o r o f (?< image > .+ ?) t o / ;
40- const match = logText . match ( regex ) ;
40+ const match = logText . match ( DEPRECATED_IMAGE_REGEX ) ;
4141 return match ?. groups ?. image ?? null ;
4242 }
4343}
You can’t perform that action at this time.
0 commit comments