mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+34
-11
@@ -113,7 +113,7 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
for(var i = 1; arguments.length - 1 >= i;i++) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
if(typeof value === 'function') {
|
||||
if(isFunction(value)) {
|
||||
return value.apply(this, args);
|
||||
}
|
||||
return value;
|
||||
@@ -125,25 +125,45 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
Number.isNaN(val) === true ||
|
||||
val === '' ||
|
||||
val === 0 ||
|
||||
val === false;
|
||||
}
|
||||
function emptyEx(val) {
|
||||
return empty(val) ||
|
||||
(isObject(val) && (function () {
|
||||
for(v in val) return false;
|
||||
val === false ||
|
||||
((isObject(val) || isArray(val)) && (function () {
|
||||
for(var v in val) return false;
|
||||
return true;
|
||||
})());
|
||||
}
|
||||
function typeOf(value) {
|
||||
function emptyEx(val) {
|
||||
return empty(val) ||
|
||||
((isObject(val) || isArray(val)) && (function () {
|
||||
for(var v in val) return false;
|
||||
return true;
|
||||
})());
|
||||
}
|
||||
function isUndefined(value) {
|
||||
return value === undefined || Number.isNaN(value) || value === null || (typeof value === 'number' && !isFinite(value));
|
||||
}
|
||||
function getType(value) {
|
||||
if(isUndefined(value)) {
|
||||
return 'undefined';
|
||||
} else if(isArray(value)) {
|
||||
return 'array';
|
||||
}
|
||||
return typeof value;
|
||||
}
|
||||
function isFunction(value) {
|
||||
return typeof value === 'function';
|
||||
}
|
||||
function isObject(value) {
|
||||
return typeOf(value) === 'object' ? value !== null : typeof value === 'function';
|
||||
return getType(value) === 'object' ? value !== null : false;
|
||||
}
|
||||
function isIterable(value) {
|
||||
return isObject(value) || isArray(value);
|
||||
}
|
||||
function isNumber(value) {
|
||||
return !Number.isNaN(value) && isFinite(value) && typeof value === 'number';
|
||||
}
|
||||
function isArray(value) { return Array.isArray(value);}
|
||||
function isArray(value) {
|
||||
return Array.isArray(value);
|
||||
}
|
||||
/**
|
||||
* @return {number}
|
||||
*/
|
||||
@@ -370,9 +390,12 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
uniqueId,
|
||||
valueEx,
|
||||
empty,
|
||||
isUndefined,
|
||||
isNumber,
|
||||
typeOf,
|
||||
getType,
|
||||
isIterable,
|
||||
isObject,
|
||||
isArray,
|
||||
isInteger,
|
||||
isFloat,
|
||||
isString,
|
||||
|
||||
Reference in New Issue
Block a user