mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
||||||
})());
|
})());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user