mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Add support for ES6 template delimiters to _.template.
Former-commit-id: d84ef4fd89d9a51237b22a09affab366974b93ff
This commit is contained in:
@@ -1645,6 +1645,12 @@
|
||||
|
||||
equal(compiled({ 'value': true }), expected);
|
||||
});
|
||||
|
||||
test('should parse ES6 template delimiters', function() {
|
||||
var data = { 'value': 2 };
|
||||
equal(_.template('1${value}3', data), '123');
|
||||
equal(_.template('${"{" + value + "\\}"}', data), '{2}');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user