File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,12 @@ export function writeTypescript(
352
352
r . message . text !== null &&
353
353
r . message . text !== undefined
354
354
) {
355
- receivers . push ( `'${ r . message . text } '` ) ;
355
+ // since we are using single quotes, escape them in the message name
356
+ const escaped = r . message . text . replace (
357
+ / ' / g,
358
+ "\\'" ,
359
+ ) ;
360
+ receivers . push ( `'${ escaped } '` ) ;
356
361
} else {
357
362
receivers . push ( `string` ) ;
358
363
}
@@ -419,9 +424,12 @@ export function writeTypescript(
419
424
} ) ;
420
425
w . append ( `}` ) ;
421
426
} else {
422
- w . append (
423
- `if (message === '${ msg . text } ') {` ,
427
+ // since we are using single quotes, escape them in the message name
428
+ const escaped = msg . text . replace (
429
+ / ' / g,
430
+ "\\'" ,
424
431
) ;
432
+ w . append ( `if (message === '${ escaped } ') {` ) ;
425
433
w . inIndent ( ( ) => {
426
434
w . append (
427
435
`body = beginCell().storeUint(0, 32).storeStringTail(message).endCell();` ,
You can’t perform that action at this time.
0 commit comments