This commit is contained in:
2023-08-14 17:09:09 +03:00
parent ec646fad15
commit 4b990e8015
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -43,12 +43,12 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
} }
if(Array.isArray(data)) { if(Array.isArray(data)) {
this.__type = 'array'; this.__type = 'array'; // []
} }
else if(typeof data === 'object') { else if(typeof data === 'object') {
this.__type = 'object'; this.__type = 'object'; // {}
if(data.hasOwnProperty('length') && !Object.keys(data).includes('length')) { if(data.hasOwnProperty('length') && !Object.keys(data).includes('length')) {
this.__type = 'arrayObject'; this.__type = 'arrayObject'; // args
} }
} }
else { else {
@@ -88,7 +88,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
Collection.prototype.toArray = function () { Collection.prototype.toArray = function () {
var index, arr = []; var index, arr = [];
for(index in this.__keys) { for(index in this.__keys) {
arr.push(this.__values[index]); arr[this.__keys[index]] = this.__values[index];
} }
return arr; return arr;
}; };
@@ -122,7 +122,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
this.data[key] = this.__values[index = this.indexKey(key)] = value; this.data[key] = this.__values[index = this.indexKey(key)] = value;
return this; return this;
} }
this.length = this.__keys.push(safeArrayKey(key)); this.__keys.push(safeArrayKey(key));
this.data[key] = this.__values[this.length-1] = value; this.data[key] = this.__values[this.length-1] = value;
return this; return this;
}; };
+2 -2
View File
@@ -195,14 +195,14 @@ __PluginManager__.register('support', function(module, exports, require, global)
val === 0 || val === 0 ||
val === false || val === false ||
((isObject(val) || isArray(val)) && (function () { ((isObject(val) || isArray(val)) && (function () {
for(var v in val) return false; for(var k in val) return false;
return true; return true;
})()); })());
} }
function emptyEx(val) { function emptyEx(val) {
return empty(val) || return empty(val) ||
((isObject(val) || isArray(val)) && (function () { ((isObject(val) || isArray(val)) && (function () {
for(var v in val) return false; for(var k in val) return false;
return true; return true;
})()); })());
} }