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)) {
this.__type = 'array';
this.__type = 'array'; // []
}
else if(typeof data === 'object') {
this.__type = 'object';
this.__type = 'object'; // {}
if(data.hasOwnProperty('length') && !Object.keys(data).includes('length')) {
this.__type = 'arrayObject';
this.__type = 'arrayObject'; // args
}
}
else {
@@ -88,7 +88,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
Collection.prototype.toArray = function () {
var index, arr = [];
for(index in this.__keys) {
arr.push(this.__values[index]);
arr[this.__keys[index]] = this.__values[index];
}
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;
return this;
}
this.length = this.__keys.push(safeArrayKey(key));
this.__keys.push(safeArrayKey(key));
this.data[key] = this.__values[this.length-1] = value;
return this;
};