Skip to content

Commit

Permalink
Merge pull request #9 from TheDragonCode/1.x
Browse files Browse the repository at this point in the history
Added `@babel/plugin-proposal-optional-chaining` plugin
  • Loading branch information
andrey-helldar authored Mar 2, 2023
2 parents 2da1b13 + 5266e45 commit 68144d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
"@babel/plugin-proposal-optional-chaining"
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"vite": "^4.1.3"
},
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@types/node": "^18.14.1",
"@vuepress/core": "^2.0.0-beta.60",
"@vuepress/utils": "^2.0.0-beta.60",
Expand Down
2 changes: 1 addition & 1 deletion src/node/plugins/replacer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Replacer

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

value = replaces !== undefined && replaces[i] !== undefined
value = !! replaces?.[i]
? value.replace('$' + i, replaces[i](match[i]))
: value.replace('$' + i, match[i])
}
Expand Down

0 comments on commit 68144d1

Please sign in to comment.