@@ -11,52 +11,52 @@ Source code:
1111 declare const placeholder2: any;
1212
1313 // splits a line by potential comment starts and joins until one is an actual comment
14- styled\`abc def//ghi//jkl\`
14+ styled.div \`abc def//ghi//jkl\`
1515
1616 // ignores comment markers that are inside strings
17- styled\`abc def"//"ghi\\'//\\'jkl//the end\`
18- styled\`abc def"//"\`
17+ styled.div \`abc def"//"ghi\\'//\\'jkl//the end\`
18+ styled.div \`abc def"//"\`
1919
2020 // ignores comment markers that are inside parantheses
21- styled\`bla (//) bla//the end\`
21+ styled.div \`bla (//) bla//the end\`
2222
2323 // ignores even unescaped URLs
24- styled\`https://test.com// comment//\`
24+ styled.div \`https://test.com// comment//\`
2525
2626 // removes multi-line comments
27- styled\`this is a/* ignore me please */test\`
27+ styled.div \`this is a/* ignore me please */test\`
2828
2929 // joins all lines of code
30- styled\`this\\nis\\na/* ignore me \\n please */\\ntest\`
30+ styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`
3131
3232 // removes line comments filling an entire line
33- styled\`line one
33+ styled.div \`line one
3434 // remove this comment
3535 line two\`
3636
3737 // removes line comments at the end of lines of code
38- styled\`valid line with // a comment
38+ styled.div \`valid line with // a comment
3939 out comments\`
4040
4141 // preserves multi-line comments starting with /*!
42- styled\`this is a /*! dont ignore me please */ test/* but you can ignore me */\`
42+ styled.div \`this is a /*! dont ignore me please */ test/* but you can ignore me */\`
4343
4444 // returns the indices of removed placeholders (expressions)
45- styled\`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`
45+ styled.div \`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`
4646
4747 // works with raw escape codes
48- styled\`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`
49- styled\`this\\nis\\na/* ignore me \\n please */\\ntest\`
50- styled\`this
48+ styled.div \`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`
49+ styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`
50+ styled.div \`this
5151 is
5252 a/* ignore me \\n please *
5353 ntest\`
5454
5555 // removes spaces around symbols
56- styled\`; : { } , ; \`
56+ styled.div \`; : { } , ; \`
5757
5858 // ignores symbols inside strings
59- styled\`; " : " \\' : \\' ;\`
59+ styled.div \`; " : " \\' : \\' ;\`
6060
6161
6262TypeScript before transform:
@@ -65,34 +65,34 @@ TypeScript before transform:
6565 declare const placeholder1: any;
6666 declare const placeholder2: any;
6767 // splits a line by potential comment starts and joins until one is an actual comment
68- styled \`abc def//ghi//jkl\`;
68+ styled.div \`abc def//ghi//jkl\`;
6969 // ignores comment markers that are inside strings
70- styled \`abc def"//"ghi'//'jkl//the end\`;
71- styled \`abc def"//"\`;
70+ styled.div \`abc def"//"ghi'//'jkl//the end\`;
71+ styled.div \`abc def"//"\`;
7272 // ignores comment markers that are inside parantheses
73- styled \`bla (//) bla//the end\`;
73+ styled.div \`bla (//) bla//the end\`;
7474 // ignores even unescaped URLs
75- styled \`https://test.com// comment//\`;
75+ styled.div \`https://test.com// comment//\`;
7676 // removes multi-line comments
77- styled \`this is a/* ignore me please */test\`;
77+ styled.div \`this is a/* ignore me please */test\`;
7878 // joins all lines of code
79- styled \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
79+ styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
8080 // removes line comments filling an entire line
81- styled \`line one\\n// remove this comment\\nline two\`;
81+ styled.div \`line one\\n// remove this comment\\nline two\`;
8282 // removes line comments at the end of lines of code
83- styled \`valid line with // a comment\\nout comments\`;
83+ styled.div \`valid line with // a comment\\nout comments\`;
8484 // preserves multi-line comments starting with /*!
85- styled \`this is a /*! dont ignore me please */ test/* but you can ignore me */\`;
85+ styled.div \`this is a /*! dont ignore me please */ test/* but you can ignore me */\`;
8686 // returns the indices of removed placeholders (expressions)
87- styled \`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`;
87+ styled.div \`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`;
8888 // works with raw escape codes
89- styled \`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`;
90- styled \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
91- styled \`this\\nis\\na/* ignore me \\n please *\\nntest\`;
89+ styled.div \`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`;
90+ styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
91+ styled.div \`this\\nis\\na/* ignore me \\n please *\\nntest\`;
9292 // removes spaces around symbols
93- styled \`; : { } , ; \`;
93+ styled.div \`; : { } , ; \`;
9494 // ignores symbols inside strings
95- styled \`; " : " ' : ' ;\`;
95+ styled.div \`; " : " ' : ' ;\`;
9696
9797
9898TypeScript after transform:
@@ -101,40 +101,34 @@ TypeScript after transform:
101101 declare const placeholder1: any;
102102 declare const placeholder2: any;
103103 // splits a line by potential comment starts and joins until one is an actual comment
104- styled \`abc def//ghi//jkl \`;
104+ styled.div \`abc def//\`;
105105 // ignores comment markers that are inside strings
106- styled \`abc def"//"ghi\\ '//\\ 'jkl//the end \`;
107- styled \`abc def"//"\`;
106+ styled.div \`abc def"//"ghi'//'jkl//\`;
107+ styled.div \`abc def"//"\`;
108108 // ignores comment markers that are inside parantheses
109- styled \`bla (//) bla//the end \`;
109+ styled.div \`bla (//\`;
110110 // ignores even unescaped URLs
111- styled \`https://test.com// comment //\`;
111+ styled.div \`https://\`;
112112 // removes multi-line comments
113- styled \`this is a/* ignore me please */test \`;
113+ styled.div \`this is atest \`;
114114 // joins all lines of code
115- styled \`this\\nis\\na/* ignore me \\n please */\\ntest \`;
115+ styled.div \`this is atest \`;
116116 // removes line comments filling an entire line
117- styled \`line one
118- // remove this comment
119- line two\`;
117+ styled.div \`line oneline two\`;
120118 // removes line comments at the end of lines of code
121- styled \`valid line with // a comment
122- out comments\`;
119+ styled.div \`valid line without comments\`;
123120 // preserves multi-line comments starting with /*!
124- styled \`this is a /*! dont ignore me please */ test/* but you can ignore me */ \`;
121+ styled.div \`this is atest \`;
125122 // returns the indices of removed placeholders (expressions)
126- styled \`this is some\\ninput with \${placeholder1} and // ignored \${placeholder2}\`;
123+ styled.div \`this is some input with \${placeholder1} and// \${placeholder2}\`;
127124 // works with raw escape codes
128- styled \`this\\\\nis\\\\na/* ignore me \\\\n please */\\\\ntest\`;
129- styled \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
130- styled \`this
131- is
132- a/* ignore me \\n please *
133- ntest\`;
125+ styled.div \`this\\\\nis\\\\na\\\\ntest\`;
126+ styled.div \`this is atest\`;
127+ styled.div \`this is a/*\`;
134128 // removes spaces around symbols
135- styled \`; : { } , ; \`;
129+ styled.div \`;:{},; \`;
136130 // ignores symbols inside strings
137- styled \`; " : " \\ ' : \\' ;\`;
131+ styled.div \`;" : "' : ' ;\`;
138132
139133
140134
0 commit comments