File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed
Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -35,21 +35,23 @@ const getSoftwareName = (obj, result = { title: '' }) => {
3535}
3636
3737const getIconDetail = ( data , url = '' ) => {
38- if ( data . type === 'imageReference' && data . identifier && / ^ ( f r e e w a r e \s + i c o n | o s s \s + i c o n | a p p - s t o r e \s + i c o n | a w e s o m e - l i s t \s + i c o n ) / . test ( data . identifier . toLocaleLowerCase ( ) ) ) {
39- let type = ''
40- if ( / ^ ( f r e e w a r e \s + i c o n ) / . test ( data . identifier . toLocaleLowerCase ( ) ) ) {
41- type = 'freeware'
42- }
43- if ( / ^ ( o s s \s + i c o n ) / . test ( data . identifier . toLocaleLowerCase ( ) ) ) {
44- type = 'oss'
45- }
46- if ( / ^ ( a p p - s t o r e \s + i c o n ) / . test ( data . identifier . toLocaleLowerCase ( ) ) ) {
47- type = 'app-store'
48- }
49- if ( / ^ ( a w e s o m e - l i s t \s + i c o n ) / . test ( data . identifier . toLocaleLowerCase ( ) ) ) {
50- type = 'awesome-list'
51- }
52- return { type, url }
38+ if ( data . type === 'imageReference' && data . identifier ) {
39+ const identifier = data . identifier . toLocaleLowerCase ( )
40+ if ( / ^ ( f r e e w a r e \s + i c o n | o s s \s + i c o n | a p p - s t o r e \s + i c o n | a w e s o m e - l i s t \s + i c o n ) / . test ( identifier ) ) {
41+ let type = ''
42+ if ( / ^ ( f r e e w a r e \s + i c o n ) / . test ( identifier ) ) {
43+ type = 'freeware'
44+ }
45+ if ( / ^ ( o s s \s + i c o n ) / . test ( identifier ) ) {
46+ type = 'oss'
47+ }
48+ if ( / ^ ( a p p - s t o r e \s + i c o n ) / . test ( identifier ) ) {
49+ type = 'app-store'
50+ }
51+ if ( / ^ ( a w e s o m e - l i s t \s + i c o n ) / . test ( identifier ) ) {
52+ type = 'awesome-list'
53+ }
54+ return { type, url }
5355 }
5456 return false
5557}
You can’t perform that action at this time.
0 commit comments