Skip to content

Commit b774989

Browse files
author
Jakub Jankowski
committed
chore: use JSON.stringify
1 parent 37b219f commit b774989

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/shared/Validations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const numberValidationFormatters: Record<string, (value: unknown) => string> = {
3838
};
3939

4040
const createStringFormatter = (nowrap: boolean | undefined) => (value: unknown) => {
41-
return nowrap || typeof value !== 'string' ? String(value) : `"${value}"`;
41+
return nowrap || typeof value !== 'string' ? JSON.stringify(value) : `"${value}"`;
4242
};
4343

4444
const createValidationsFormatter = (name: string, options?: { exact?: boolean; nowrap?: boolean }) => (

0 commit comments

Comments
 (0)