We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f36349e commit 741a1f0Copy full SHA for 741a1f0
packages/common/src/utils/variables.ts
@@ -84,7 +84,9 @@ export function replaceVariables(
84
keepTypeIfOnlyVariable = false,
85
}: { modifier?: ((variable: unknown) => unknown) | undefined; trim?: boolean; keepTypeIfOnlyVariable?: boolean } = {}
86
): string | unknown {
87
- const formattedPhrase = trim ? phrase?.trim() : phrase;
+ const stringPhrase = typeof phrase === 'string' ? phrase : String(phrase ?? '');
88
+
89
+ const formattedPhrase = trim ? stringPhrase.trim() : stringPhrase;
90
91
if (!formattedPhrase) {
92
return '';
0 commit comments