angular2-template-loader
angular2-template-loader copied to clipboard
Use typescript to parse source files
Fixes #54
This pull request uses typescript to construct an AST and find the positions where the require()s
should be placed. It should fix several issues and edge cases caused by the regexp approach.
All tests are passing and one new test (adding the possibility to use template literals) was added.
Codecov Report
Merging #70 into master will increase coverage by
2.47%
. The diff coverage is98.78%
.
@@ Coverage Diff @@
## master #70 +/- ##
=========================================
+ Coverage 96.42% 98.9% +2.47%
=========================================
Files 1 1
Lines 28 91 +63
Branches 5 24 +19
=========================================
+ Hits 27 90 +63
Misses 1 1
Impacted Files | Coverage Δ | |
---|---|---|
index.js | 98.9% <98.78%> (+2.47%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update c2dc887...4ded269. Read the comment docs.
@TheLarkInn I am planning on looking through the issues and see which of them are resolved by this PR. Some of the other PRs already define new tests for the edge cases they fix (based on the regexp approach). So I am planning on adding those tests to the spec as well, just to make sure that the AST approach really covers them
This would resolve my issue where the regex fails on properly quoted JSON object keys.