File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -41,31 +41,28 @@ export default class Image extends React.Component<Props, State> {
41
41
constructor ( props ) {
42
42
super ( props ) ;
43
43
this . state = {
44
- widthDescriptorOnly : Object . keys ( this . props . srcSet ) . every ( ( descriptor ) => {
45
- return matchWidthDescriptor ( descriptor ) ;
46
- } ) ,
44
+ widthDescriptorOnly : Object . keys ( this . props . srcSet ) . every ( ( descriptor ) => matchWidthDescriptor ( descriptor ) ) ,
47
45
} ;
48
46
}
49
47
50
- // TODO: fix any
51
- buildSrcSet ( ) : any {
48
+ buildSrcSet ( ) {
52
49
const matcher = this . state . widthDescriptorOnly ? matchWidthDescriptor : matchPixelDescriptor ;
53
50
return Object . keys ( this . props . srcSet )
54
51
. filter ( matcher )
55
- . map ( descriptor => `${ this . props . srcSet [ descriptor ] } ${ descriptor } ` ) ;
52
+ . map ( descriptor => `${ this . props . srcSet [ descriptor ] } ${ descriptor } ` )
53
+ . join ( ',' ) ;
56
54
}
57
55
58
- // TODO: fix any
59
- buildSizes ( ) : any {
56
+ buildSizes ( ) {
60
57
if ( this . props . sizes && this . state . widthDescriptorOnly ) {
61
58
return this . props . sizes . map ( ( size ) => {
62
59
if ( size . mediaCondition ) {
63
60
return `${ size . mediaCondition } ${ size . size } ` ;
64
61
}
65
62
return `${ size . size } ` ;
66
- } ) ;
63
+ } ) . join ( ',' ) ;
67
64
}
68
- return null ;
65
+ return '' ;
69
66
}
70
67
71
68
render ( ) {
You can’t perform that action at this time.
0 commit comments