1
+ /**
2
+ * SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
5
+
6
+ const fs = require ( 'fs' ) ;
7
+ const path = require ( 'path' ) ;
8
+
9
+ /* eslint-disable */
10
+ // prettier-ignore
1
11
const flagsData = {
2
12
"af-za" : '"af-za", "Afrikaans", "South Africa"' ,
3
13
"ar" : '"ar", "Arabic"' ,
@@ -472,6 +482,7 @@ const flagsData = {
472
482
"zu-za" : '"zu-za", "Zulu", "South Africa"'
473
483
} ;
474
484
485
+ // prettier-ignore
475
486
const iconsData = {
476
487
"add-cell" : '"center", "excel", "grid", "squares", "table"' ,
477
488
"add-column" : '"cell", "center", "excel", "grid", "squares", "table", "vertical"' ,
@@ -724,9 +735,7 @@ const iconsData = {
724
735
"wiki-page" : '"knowledge"' ,
725
736
"workflow" : '"function", "progress"'
726
737
} ;
727
-
728
- const fs = require ( 'fs' ) ;
729
- const path = require ( 'path' ) ;
738
+ /* eslint-enable */
730
739
731
740
const iconsPath = path . join ( 'static' , 'images' , 'icons' , 'icons.svg' ) ;
732
741
@@ -747,19 +756,18 @@ function buildJson(arr, aliasesMap) {
747
756
let aliases = aliasesMap [ arr [ i ] ] ;
748
757
749
758
json += ' {\n' ;
750
- json += ' "name": "' + arr [ i ] + ' ",\n' ;
751
- json += ' "aliases": ['
759
+ json += ` "name": "${ arr [ i ] } ",\n` ;
760
+ json += ' "aliases": [' ;
752
761
753
762
if ( ! aliases ) {
754
763
aliases = '""' ;
755
764
}
756
765
757
- json += aliases + ' ]\n' ;
766
+ json += ` ${ aliases } ]\n` ;
758
767
759
768
if ( i === arr . length - 1 ) {
760
769
json += ' }\n' ;
761
- }
762
- else {
770
+ } else {
763
771
json += ' },\n' ;
764
772
}
765
773
}
@@ -769,16 +777,15 @@ function buildJson(arr, aliasesMap) {
769
777
return json ;
770
778
}
771
779
772
- let flagsArr = [ ] ;
773
- let newIconsArr = [ ] ;
780
+ const flagsArr = [ ] ;
781
+ const newIconsArr = [ ] ;
774
782
775
783
for ( let i = 0 ; i < symbolsArr . length ; i ++ ) {
776
784
const symbol = getId ( symbolsArr [ i ] ) ;
777
785
778
786
if ( flagsData [ symbol ] ) {
779
787
flagsArr . push ( symbol ) ;
780
- }
781
- else {
788
+ } else {
782
789
newIconsArr . push ( symbol ) ;
783
790
}
784
791
}
0 commit comments