1 回答

TA貢獻(xiàn)1846條經(jīng)驗(yàn) 獲得超7個(gè)贊
templateArgs = arguments,
stringify = function(obj) {
return "function" == typeof obj ? obj.toString().replace(/ \{[\s\S]*$/, "") : "undefined" == typeof obj ? "undefined" : "string" != typeof obj ? JSON.stringify(obj) : obj
};
for (message = prefix + template.replace(/\{\d+\}/g, function(match) {
var arg, index = +match.slice(1, -1);
return index + 2 < templateArgs.length ? (arg = templateArgs[index + 2], "function" == typeof arg ? arg.toString().replace(/ ?\{[\s\S]*$/, "") : "undefined" == typeof arg ? "undefined" : "string" !=
- 1 回答
- 0 關(guān)注
- 917 瀏覽
添加回答
舉報(bào)