feat: 去除Object的扩展方法 减少冲突

This commit is contained in:
coding
2017-11-16 12:28:18 +00:00
parent dc716dc87c
commit 5ca2c2b02f
4 changed files with 273 additions and 18 deletions

View File

@ -9,16 +9,17 @@
return str.format(this, Array.prototype.slice.call(arguments, 0))
};
// JSON快捷方法
Object.prototype.toJson = function () {
return JSON.stringify(this);
};
// ========== 暂不扩展Object ==========
// // JSON快捷方法
// Object.prototype.toJson = function () {
// return JSON.stringify(this);
// };
// YAML快速生成
var yaml = require('modules/yaml');
Object.prototype.toYaml = function () {
return yaml.safeDump(this);
};
// // YAML快速生成
// var yaml = require('modules/yaml');
// Object.prototype.toYaml = function () {
// return yaml.safeDump(this);
// };
/**
* 日期格式化