Skip to content

Commit 68144d1

Browse files
Merge pull request #9 from TheDragonCode/1.x
Added `@babel/plugin-proposal-optional-chaining` plugin
2 parents 2da1b13 + 5266e45 commit 68144d1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": [
3+
"@babel/plugin-proposal-optional-chaining"
4+
]
5+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"vite": "^4.1.3"
4949
},
5050
"devDependencies": {
51+
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
5152
"@types/node": "^18.14.1",
5253
"@vuepress/core": "^2.0.0-beta.60",
5354
"@vuepress/utils": "^2.0.0-beta.60",

src/node/plugins/replacer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class Replacer
7070

7171
link = link.replace('$' + i, match[i])
7272

73-
value = replaces !== undefined && replaces[i] !== undefined
73+
value = !! replaces?.[i]
7474
? value.replace('$' + i, replaces[i](match[i]))
7575
: value.replace('$' + i, match[i])
7676
}

0 commit comments

Comments
 (0)