File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -14,25 +14,15 @@ function getConfigFromPath(filePath: string): CodeshiftConfig {
1414function hasValidTransforms ( transforms ?: Record < string , string > ) {
1515 if ( ! transforms || ! Object . keys ( transforms ) . length ) return false ;
1616
17- let isValid = true ;
18-
19- Object . entries ( transforms ) . forEach ( ( [ key ] ) => {
20- if ( ! semver . valid ( key ) ) isValid = false ;
21- } ) ;
22-
23- return isValid ;
17+ return Object . entries ( transforms ) . every ( ( [ key ] ) => semver . valid ( key ) ) ;
2418}
2519
2620function hasValidPresets ( presets ?: Record < string , string > ) {
2721 if ( ! presets || ! Object . keys ( presets ) . length ) return false ;
2822
29- let isValid = true ;
30-
31- Object . entries ( presets ) . forEach ( ( [ key ] ) => {
32- if ( ! key . match ( / ^ [ 0 - 9 a - z A - Z \- ] + $ / ) ) isValid = false ;
33- } ) ;
34-
35- return isValid ;
23+ return Object . entries ( presets ) . every ( ( [ key ] ) =>
24+ key . match ( / ^ [ 0 - 9 a - z A - Z \- ] + $ / ) ,
25+ ) ;
3626}
3727
3828export function isValidPackageName ( dir : string ) {
You can’t perform that action at this time.
0 commit comments