mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -7,6 +7,12 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
return str[0].toUpperCase() + str.slice(1);
|
||||
}
|
||||
};
|
||||
var arr = {
|
||||
isKey: function (key) {
|
||||
var n = Number(key);
|
||||
return isInteger(n) && (''+n === ''+key);
|
||||
}
|
||||
};
|
||||
function uniqueId (length = 32, firstLetter = true) {
|
||||
var idStr = '';
|
||||
if(length < 1) return idStr;
|
||||
@@ -39,14 +45,35 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
val === 0 ||
|
||||
val === false;
|
||||
}
|
||||
function typeOf(value) {
|
||||
return typeof value;
|
||||
}
|
||||
function isObject(value) {
|
||||
return typeOf(value) === 'object' ? value !== null : typeof value === 'function';
|
||||
}
|
||||
function isNumber(value) {
|
||||
return !Number.isNaN(value) && isFinite(value) && typeof value === 'number';
|
||||
}
|
||||
function isInteger(value) {
|
||||
return isNumber(value) && (value % 1) === 0;
|
||||
}
|
||||
function isFloat(value) {
|
||||
return isNumber(value);
|
||||
}
|
||||
/**
|
||||
* @memberOf kit
|
||||
*/
|
||||
var support = {
|
||||
str: str,
|
||||
arr: arr,
|
||||
uniqueId,
|
||||
valueEx,
|
||||
empty
|
||||
empty,
|
||||
isNumber,
|
||||
typeOf,
|
||||
isObject,
|
||||
isInteger,
|
||||
isFloat,
|
||||
};
|
||||
|
||||
return module.exports = support;
|
||||
|
||||
Reference in New Issue
Block a user