gengojs-core-modules
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,12 @@ | ||
1.2.0 / 2015-08-31 | ||
================== | ||
* Update | ||
Added change log. | ||
* Merge pull request [#3](https://github.com/iwatakeshi/gengojs-core-modules/issues/3) from iwatakeshi/fix-undefined-plugins | ||
Fix | ||
* Fix | ||
This should fix the undefined functions that appear in the core when | ||
only one plugin is used. | ||
1.1.0 / 2015-08-30 | ||
@@ -2,0 +13,0 @@ ================== |
@@ -17,3 +17,4 @@ /** | ||
debug('core', 'info', | ||
`class: ${Plugify.name}`, `plugins: ${key}`); | ||
`class: ${Plugify.name}`, | ||
`plugins: type - ${key} typeof - ${typeof value}`); | ||
}); | ||
@@ -167,8 +168,4 @@ } | ||
var plugs = this.plugins; | ||
for (var key in plugs) { | ||
if (plugs.hasOwnProperty(key)) { | ||
var element = plugs[key]; | ||
if (element[0]) { | ||
// Get the type | ||
var {type} = element[0].package; | ||
_.forEach(plugs, (plugin, type)=>{ | ||
if(plugin[0]){ | ||
// Get the index of the type from the types stack | ||
@@ -179,14 +176,9 @@ var index = this.types.indexOf(this.normalize(type)); | ||
// Register the plugin | ||
this.plugins[this.normalize(type)] = element[0]; | ||
} else { | ||
if (!_.isEmpty(this.types)) { | ||
// Get a random type from the stack and | ||
// set a placeholder plugin in case it doesn't exist | ||
this.plugins[this.normalize(this.types[0])] = () => { }; | ||
// Remove the type from the stack | ||
this.types.pop(); | ||
} | ||
} | ||
this.plugins[this.normalize(type)] = plugin[0]; | ||
} | ||
} | ||
}); | ||
// Set the placeholder | ||
_.forEach(this.types, (type) => { | ||
this.plugins[this.normalize(type)] = () => {}; | ||
}); | ||
} | ||
@@ -193,0 +185,0 @@ } |
@@ -36,3 +36,3 @@ /** | ||
_lodash2['default'].forEach(this.plugins, function (value, key) { | ||
(0, _gengojsDebug2['default'])('core', 'info', 'class: ' + Plugify.name, 'plugins: ' + key); | ||
(0, _gengojsDebug2['default'])('core', 'info', 'class: ' + Plugify.name, 'plugins: type - ' + key + ' typeof - ' + typeof value); | ||
}); | ||
@@ -187,2 +187,4 @@ } | ||
value: function bundle() { | ||
var _this = this; | ||
// Remove the plugin from array | ||
@@ -193,26 +195,16 @@ // and set it as the root | ||
var plugs = this.plugins; | ||
for (var key in plugs) { | ||
if (plugs.hasOwnProperty(key)) { | ||
var element = plugs[key]; | ||
if (element[0]) { | ||
// Get the type | ||
var type = element[0]['package'].type; | ||
// Get the index of the type from the types stack | ||
var index = this.types.indexOf(this.normalize(type)); | ||
// Remove the type from the stack since it is registered | ||
if (index > -1) this.types.splice(index, 1); | ||
// Register the plugin | ||
this.plugins[this.normalize(type)] = element[0]; | ||
} else { | ||
if (!_lodash2['default'].isEmpty(this.types)) { | ||
// Get a random type from the stack and | ||
// set a placeholder plugin in case it doesn't exist | ||
this.plugins[this.normalize(this.types[0])] = function () {}; | ||
// Remove the type from the stack | ||
this.types.pop(); | ||
} | ||
} | ||
_lodash2['default'].forEach(plugs, function (plugin, type) { | ||
if (plugin[0]) { | ||
// Get the index of the type from the types stack | ||
var index = _this.types.indexOf(_this.normalize(type)); | ||
// Remove the type from the stack since it is registered | ||
if (index > -1) _this.types.splice(index, 1); | ||
// Register the plugin | ||
_this.plugins[_this.normalize(type)] = plugin[0]; | ||
} | ||
} | ||
}); | ||
// Set the placeholder | ||
_lodash2['default'].forEach(this.types, function (type) { | ||
_this.plugins[_this.normalize(type)] = function () {}; | ||
}); | ||
} | ||
@@ -219,0 +211,0 @@ }]); |
{ | ||
"name": "gengojs-core-modules", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "gengo.js core modules is a set of modules that helps the core to function properly.", | ||
@@ -5,0 +5,0 @@ "main": "./modules/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111520
1159