2019-09-04 07:51:11 +00:00
|
|
|
let escape = require("lodash.escape");
|
2019-09-04 07:06:15 +00:00
|
|
|
|
|
|
|
module.exports = function(strings) {
|
|
|
|
//first element is the strings, don't need it
|
2019-09-18 07:28:15 +00:00
|
|
|
let args = Array.prototype.slice.call(arguments,1);
|
2019-09-04 07:06:15 +00:00
|
|
|
|
|
|
|
//first element will be the initial value
|
2019-09-18 07:28:15 +00:00
|
|
|
return strings.reduce(function(result, string, i) {
|
|
|
|
return result + escape(args[i-1]) + string;
|
|
|
|
});
|
2019-09-04 07:06:15 +00:00
|
|
|
};
|