zspecza / common-tags

🔖 Useful template literal tags for dealing with strings in ES2015+
Other
2k stars 61 forks source link

Fix for stripping indent of empty and unindented strings. #53

Closed shannonmoeller closed 8 years ago

shannonmoeller commented 8 years ago

When stripping the indent of a zero-length string, the error "Cannot read property 'map' of null" would be thrown as the RexExp match is null. Added an early exit condition to handle this and similar cases.

codecov-io commented 8 years ago

Current coverage is 100% (diff: 100%)

Merging #53 into master will not change coverage

@@           master   #53   diff @@
===================================
  Files          22    22          
  Lines         137   139     +2   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits          137   139     +2   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update b8e203e...f6db821

zspecza commented 8 years ago

Good call! Thanks for the contribution @shannonmoeller