DamonOehlman/clarity — pull request #1 by coen-hyde (2013-06-03 09:22:22+00:00)
Title: fix bug where slice was called on undefined

If a variable was matched but no data existed to replace the variable then slice would be called on undefined. It assumes that a default must exist. This was breaking the test "should be able to replace an environment var with underscores" for me as I did not have the environment variable used in the test.

This fix will check to see if a default was provided before calling slice on the default match.