From 4b990e8015a8755af76bb5ad44cc966405f167f6 Mon Sep 17 00:00:00 2001 From: bellord13 Date: Mon, 14 Aug 2023 17:09:09 +0300 Subject: [PATCH] fix --- assets/collection/collection.js | 10 +++++----- assets/support/support.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/collection/collection.js b/assets/collection/collection.js index 8e2e469..5cdd3f3 100644 --- a/assets/collection/collection.js +++ b/assets/collection/collection.js @@ -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; }; diff --git a/assets/support/support.js b/assets/support/support.js index f8d6a83..4525994 100644 --- a/assets/support/support.js +++ b/assets/support/support.js @@ -195,14 +195,14 @@ __PluginManager__.register('support', function(module, exports, require, global) val === 0 || val === false || ((isObject(val) || isArray(val)) && (function () { - for(var v in val) return false; + for(var k in val) return false; return true; })()); } function emptyEx(val) { return empty(val) || ((isObject(val) || isArray(val)) && (function () { - for(var v in val) return false; + for(var k in val) return false; return true; })()); }