mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Fix: getObjType
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
|
_('upperFirst');
|
||||||
|
|
||||||
function exports(obj)
|
function exports(obj)
|
||||||
{
|
{
|
||||||
if (obj.constructor && obj.constructor.name) return obj.constructor.name;
|
if (obj.constructor && obj.constructor.name) return obj.constructor.name;
|
||||||
|
|
||||||
return util.upperFirst(({}).toString.call(obj).replace(/(\[object )|]/g, ''));
|
return upperFirst(({}).toString.call(obj).replace(/(\[object )|]/g, ''));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,6 +597,32 @@ module.exports = (function ()
|
|||||||
return exports;
|
return exports;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/* ------------------------------ upperFirst ------------------------------ */
|
||||||
|
|
||||||
|
var upperFirst = _.upperFirst = (function ()
|
||||||
|
{
|
||||||
|
/* Convert the first character of string to upper case.
|
||||||
|
*
|
||||||
|
* |Name |Type |Desc |
|
||||||
|
* |------|------|-----------------|
|
||||||
|
* |str |string|String to convert|
|
||||||
|
* |return|string|Converted string |
|
||||||
|
*
|
||||||
|
* ```javascript
|
||||||
|
* upperFirst('red'); // -> Red
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
|
||||||
|
function exports(str)
|
||||||
|
{
|
||||||
|
if (str.length < 1) return str;
|
||||||
|
|
||||||
|
return str[0].toUpperCase() + str.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return exports;
|
||||||
|
})();
|
||||||
|
|
||||||
/* ------------------------------ getObjType ------------------------------ */
|
/* ------------------------------ getObjType ------------------------------ */
|
||||||
|
|
||||||
var getObjType = _.getObjType = (function ()
|
var getObjType = _.getObjType = (function ()
|
||||||
@@ -605,7 +631,7 @@ module.exports = (function ()
|
|||||||
{
|
{
|
||||||
if (obj.constructor && obj.constructor.name) return obj.constructor.name;
|
if (obj.constructor && obj.constructor.name) return obj.constructor.name;
|
||||||
|
|
||||||
return util.upperFirst(({}).toString.call(obj).replace(/(\[object )|]/g, ''));
|
return upperFirst(({}).toString.call(obj).replace(/(\[object )|]/g, ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
return exports;
|
return exports;
|
||||||
@@ -4022,32 +4048,6 @@ module.exports = (function ()
|
|||||||
return exports;
|
return exports;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/* ------------------------------ upperFirst ------------------------------ */
|
|
||||||
|
|
||||||
var upperFirst = _.upperFirst = (function ()
|
|
||||||
{
|
|
||||||
/* Convert the first character of string to upper case.
|
|
||||||
*
|
|
||||||
* |Name |Type |Desc |
|
|
||||||
* |------|------|-----------------|
|
|
||||||
* |str |string|String to convert|
|
|
||||||
* |return|string|Converted string |
|
|
||||||
*
|
|
||||||
* ```javascript
|
|
||||||
* upperFirst('red'); // -> Red
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
|
|
||||||
function exports(str)
|
|
||||||
{
|
|
||||||
if (str.length < 1) return str;
|
|
||||||
|
|
||||||
return str[0].toUpperCase() + str.slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return exports;
|
|
||||||
})();
|
|
||||||
|
|
||||||
/* ------------------------------ wrap ------------------------------ */
|
/* ------------------------------ wrap ------------------------------ */
|
||||||
|
|
||||||
var wrap = _.wrap = (function ()
|
var wrap = _.wrap = (function ()
|
||||||
|
|||||||
Reference in New Issue
Block a user