-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
/** | ||
* 判断是否是Object值 | ||
* @author 陈随易 <https://chensuiyi.me> | ||
* @category is | ||
* @alias yd_is_object | ||
* @category is | ||
* @param {any} value 任意值 | ||
* @returns {Boolean} 返回是否是Object值 | ||
* @returns {boolean} 返回是否是Object值 | ||
* @author 陈随易 <https://chensuiyi.me> | ||
* @example yd_is_object({}) // true | ||
*/ | ||
export default (variable) => { | ||
return variable !== null && typeof variable === 'object' && Object.prototype.toString.call(variable) === '[object Object]'; | ||
export default (value) => { | ||
return value !== null && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]'; | ||
}; |