@@ -79,6 +79,17 @@ const stringProperty = {
7979 parse : parseStringRepositoryProperty ,
8080} ;
8181
82+ /** Determines whether a value from the API is a non-empty string or not. */
83+ function isNonEmptyString ( value : RepositoryPropertyValue ) : value is string {
84+ return isString ( value ) && value . trim ( ) . length > 0 ;
85+ }
86+
87+ /** A repository property that we expect to contain a non-empty string value. */
88+ const nonEmptyStringProperty = {
89+ ...stringProperty ,
90+ validate : isNonEmptyString ,
91+ } ;
92+
8293/** A repository property that we expect to contain a boolean value. */
8394const booleanProperty = {
8495 // The value from the API should come as a string, which we then parse into a boolean.
@@ -90,7 +101,7 @@ const booleanProperty = {
90101const repositoryPropertyParsers : {
91102 [ K in RepositoryPropertyName ] : PropertyInfo < K > ;
92103} = {
93- [ RepositoryPropertyName . CONFIG_FILE ] : stringProperty ,
104+ [ RepositoryPropertyName . CONFIG_FILE ] : nonEmptyStringProperty ,
94105 [ RepositoryPropertyName . DISABLE_OVERLAY ] : booleanProperty ,
95106 [ RepositoryPropertyName . EXTRA_QUERIES ] : stringProperty ,
96107 [ RepositoryPropertyName . FILE_COVERAGE_ON_PRS ] : booleanProperty ,
0 commit comments