@@ -36,6 +36,14 @@ async function buildPluginApiDocs(pluginId) {
36
36
37
37
const apiContent = createApiPage ( pluginId , readme , pkgJson ) ;
38
38
const fileName = `${ pluginId } .md` ;
39
+
40
+ // Delete all existing generated markdown files in docs/native
41
+ fs . readdirSync ( 'docs/native' ) . forEach ( ( file ) => {
42
+ if ( file . endsWith ( '.md' ) ) {
43
+ fs . rmSync ( `docs/native/${ file } ` ) ;
44
+ }
45
+ } ) ;
46
+
39
47
fs . writeFileSync ( `docs/native/${ fileName } ` , apiContent ) ;
40
48
fs . writeFileSync ( `versioned_docs/version-v6/native/${ fileName } ` , apiContent ) ;
41
49
}
@@ -85,18 +93,15 @@ function toTitleCase(str) {
85
93
}
86
94
87
95
if ( ! String . prototype . replaceAll ) {
88
- String . prototype . replaceAll = function ( str , newStr ) {
89
-
90
- // If a regex pattern
91
- if ( Object . prototype . toString . call ( str ) . toLowerCase ( ) === '[object regexp]' ) {
92
- return this . replace ( str , newStr ) ;
93
- }
94
-
95
- // If a string
96
- return this . replace ( new RegExp ( str , 'g' ) , newStr ) ;
97
-
98
- } ;
96
+ String . prototype . replaceAll = function ( str , newStr ) {
97
+ // If a regex pattern
98
+ if ( Object . prototype . toString . call ( str ) . toLowerCase ( ) === '[object regexp]' ) {
99
+ return this . replace ( str , newStr ) ;
100
+ }
101
+
102
+ // If a string
103
+ return this . replace ( new RegExp ( str , 'g' ) , newStr ) ;
104
+ } ;
99
105
}
100
106
101
107
main ( ) ;
102
-
0 commit comments