1
1
import fs from "fs" ;
2
- import { themes } from "../themes/index" ;
2
+ import { themes } from "../themes/index.js " ;
3
3
4
4
const TARGET_FILE = "./themes/README.md" ;
5
5
const REPO_CARD_LINKS_FLAG = "<!-- REPO_CARD_LINKS -->" ;
@@ -65,14 +65,14 @@ const createTableItem = ({ link, label, isRepoCard }) => {
65
65
} ;
66
66
const generateTable = ( { isRepoCard} ) => {
67
67
const rows = [ ] ;
68
- const themes = Object . keys ( themes ) . filter (
68
+ const themesFiltered = Object . keys ( themes ) . filter (
69
69
( name ) => name !== ( ! isRepoCard ?"default_repocard" :"default" ) ,
70
70
) ;
71
71
72
- for ( let i = 0 ; i < themes . length ; i += 3 ) {
73
- const one = themes [ i ] ;
74
- const two = themes [ i + 1 ] ;
75
- const three = themes [ i + 2 ] ;
72
+ for ( let i = 0 ; i < themesFiltered . length ; i += 3 ) {
73
+ const one = themesFiltered [ i ] ;
74
+ const two = themesFiltered [ i + 1 ] ;
75
+ const three = themesFiltered [ i + 2 ] ;
76
76
77
77
let tableItem1 = createTableItem ( { link :one , label :one , isRepoCard} ) ;
78
78
let tableItem2 = createTableItem ( { link :two , label :two , isRepoCard} ) ;
@@ -84,7 +84,7 @@ const generateTable = ({ isRepoCard }) => {
84
84
rows . push ( `|${ tableItem1 } |${ tableItem2 } |${ tableItem3 } |` ) ;
85
85
86
86
// if it's the last row & the row has no empty space push a new row
87
- if ( three && i + 3 === themes . length ) {
87
+ if ( three && i + 3 === themesFiltered . length ) {
88
88
rows . push ( `| [Add your theme][add-theme] | | |` ) ;
89
89
}
90
90
}