Skip to content

Commit 0edb191

Browse files
committed
Merge branch 'v2' of https://github.com/braswelljr/colored into v2
2 parents 77cfbe2 + a01f211 commit 0edb191

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/generate-colors.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function toTsObject(data: unknown, indent: number = 2): string {
105105
if (data === null || data === undefined) return 'null';
106106

107107
if (typeof data === 'string') {
108-
return `'${data.replace(/'/g, "\\'").replace(/\n/g, '\\n')}'`;
108+
return `'${data.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\n/g, '\\n')}'`;
109109
}
110110

111111
if (typeof data === 'number' || typeof data === 'boolean') {

0 commit comments

Comments
 (0)