Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 01ff6c7

Browse files
committed
fix(packages/core): i18n treats 0 parameter as undefined
Fixes #5188
1 parent 866451c commit 01ff6c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/util/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default (
6565
if (!parameters) return str
6666
else
6767
return parameters
68-
.map(_ => (_ || '').toString()) // only needed due to https://github.com/microsoft/TypeScript/issues/7014
68+
.map(_ => (_ === undefined ? '' : _).toString()) // only needed due to https://github.com/microsoft/TypeScript/issues/7014
6969
.reduce((str: string, param, idx) => {
7070
// e.g. replace all occurrences of {0} in the str
7171
return str.replace(new RegExp(`\\{${idx}\\}`, 'g'), param.toString())

0 commit comments

Comments
 (0)