@@ -29,33 +29,33 @@ let createDirectoryIfNotExists = (dirPath: string): unit => {
29
29
}
30
30
31
31
let removeCodeTabTags = (content : string ): string => {
32
- let regex = Js . Re .fromStringWithFlags ("<CodeTab.*?>[\\ s\\ S]*?</CodeTab>" , ~flags = "g" )
33
- Js . String .replaceByRe ( regex , "" , content )
32
+ let regex = RegExp .fromStringWithFlags ("<CodeTab.*?>[\\ s\\ S]*?</CodeTab>" , ~flags = "g" )
33
+ String .replaceRegExp ( content , regex , "" )
34
34
}
35
35
36
36
let removeCodeBlocks = (content : string ): string => {
37
- let regex = Js . Re .fromStringWithFlags ("```[a-zA-Z]+\\ s*[\\ s\\ S]*?```" , ~flags = "g" )
38
- Js . String .replaceByRe ( regex , "" , content )
37
+ let regex = RegExp .fromStringWithFlags ("```[a-zA-Z]+\\ s*[\\ s\\ S]*?```" , ~flags = "g" )
38
+ String .replaceRegExp ( content , regex , "" )
39
39
}
40
40
41
41
let removeFileTitle = (content : string ): string => {
42
- let regex = Js . Re .fromStringWithFlags ("---\n title[\\ s\\ S]*?---" , ~flags = "g" )
43
- Js . String .replaceByRe ( regex , "" , content )
42
+ let regex = RegExp .fromStringWithFlags ("---\n title[\\ s\\ S]*?---" , ~flags = "g" )
43
+ String .replaceRegExp ( content , regex , "" )
44
44
}
45
45
46
46
let removeUnnecessaryBreaks = (content : string ): string => {
47
- let regex = Js . Re .fromStringWithFlags ("^\n {2,}" , ~flags = "g" )
48
- Js . String .replaceByRe ( regex , "" , content )
47
+ let regex = RegExp .fromStringWithFlags ("^\n {2,}" , ~flags = "g" )
48
+ String .replaceRegExp ( content , regex , "" )
49
49
}
50
50
51
51
let removeToDos = (content : string ): string => {
52
- let regex = Js . Re .fromStringWithFlags ("<!-- TODO[\\ s\\ S]*?-->" , ~flags = "g" )
53
- Js . String .replaceByRe ( regex , "" , content )
52
+ let regex = RegExp .fromStringWithFlags ("<!-- TODO[\\ s\\ S]*?-->" , ~flags = "g" )
53
+ String .replaceRegExp ( content , regex , "" )
54
54
}
55
55
56
56
let fillContentWithVersion = (content : string , version : string ): string => {
57
- let regex = Js . Re .fromStringWithFlags ("<VERSION>" , ~flags = "g" )
58
- Js . String .replaceByRe ( regex , version , content )
57
+ let regex = RegExp .fromStringWithFlags ("<VERSION>" , ~flags = "g" )
58
+ String .replaceRegExp ( content , regex , version )
59
59
}
60
60
61
61
let createFullFile = (content : string , filePath : string ): unit => {
@@ -113,7 +113,7 @@ let processVersions = (
113
113
versionDir
114
114
-> collectFiles
115
115
-> Array .forEach (filePath => {
116
- if Js . String .endsWith (".mdx" , filePath ) {
116
+ if String .endsWith (filePath , ".mdx" ) {
117
117
let content = readMarkdownFile (filePath )
118
118
119
119
content -> createFullFile (fullFilePath )
0 commit comments