Closed byerun closed 5 years ago
I think that this line is causing problems.
https://github.com/grant/ts2gas/blob/4f7827164187c6d8deb2c9a259b1312061f2ab0b/src/index.ts#L20
In general, replace( 'A', 'B' )
replaces A with B only once.
Therefore, if an import statement exceeds two lines, you can not delete a line break completely.
See also : https://www.w3schools.com/jsref/jsref_replace.asp
So, I propose using regular expressions like replace( /\n/g , '\\n' )
.
Thanks for the report and fix.
1.6.1
.Please create a PR to update this dependency in clasp
.
This is still happening with ts2gas 3.6.1 and clasp 2.3.0 ! was the fix rolled back??
Expected Behavior
Multi-line typescript import statements translated correctly
Actual Behavior
The translated Apps Script code is invalid
Steps to Reproduce the Problem
The translated code will have a "\n" embedded along with invalid lines:
Attempting to run the code will produce the error message Illegal character.
Specifications
node -v
): 11.8.0clasp -v
): 2.0.1