mm_machine 1.9.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/item.js +7 -7
- package/package.json +1 -1
package/item.js
CHANGED
|
@@ -97,7 +97,7 @@ class Item {
|
|
|
97
97
|
* @param {Object} config 配置
|
|
98
98
|
*/
|
|
99
99
|
Item.prototype.set_config = function(config) {
|
|
100
|
-
if (config.func_file !== this.config.func_file) {
|
|
100
|
+
if (config && config.func_file !== this.config.func_file) {
|
|
101
101
|
this.complete = false;
|
|
102
102
|
}
|
|
103
103
|
this.config = conf(Object.assign({}, this.config, config || {}), this.filename);
|
|
@@ -352,16 +352,16 @@ Item.prototype.remove_file = function() {
|
|
|
352
352
|
|
|
353
353
|
/**
|
|
354
354
|
* 载入配置
|
|
355
|
-
* @param {Object|String}
|
|
355
|
+
* @param {Object|String} conf 配置对象或配置路径
|
|
356
356
|
* @param {String} name 配置名称
|
|
357
357
|
*/
|
|
358
|
-
Item.prototype.load_config = function(
|
|
358
|
+
Item.prototype.load_config = function(conf, name) {
|
|
359
359
|
var config;
|
|
360
|
-
if (
|
|
361
|
-
if (typeof(
|
|
362
|
-
config = this.load_file(
|
|
360
|
+
if (conf) {
|
|
361
|
+
if (typeof(conf) === "string") {
|
|
362
|
+
config = this.load_file(conf, name);
|
|
363
363
|
} else {
|
|
364
|
-
config =
|
|
364
|
+
config = conf;
|
|
365
365
|
}
|
|
366
366
|
} else {
|
|
367
367
|
config = this.load_file(this.filename, name);
|