Skip to content

Commit

Permalink
Merge pull request #30 from Maizify/v2
Browse files Browse the repository at this point in the history
fix isObject()
  • Loading branch information
Maizify committed Jun 5, 2016
2 parents e3a964e + 0e24933 commit 9cfb360
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/lib/tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,20 @@ export function isSymbol(value) {
return Object.prototype.toString.call(value) == '[object Symbol]';
}
export function isObject(value) {
return Object.prototype.toString.call(value) == '[object Object]';
return (
Object.prototype.toString.call(value) == '[object Object]'
||
// if it isn't a primitive value, then it is a common object
(
!isNumber(value) &&
!isString(value) &&
!isArray(value) &&
!isNull(value) &&
!isFunction(value) &&
!isUndefined(value) &&
!isSymbol(value)
)
);
}
export function isFunction(value) {
return Object.prototype.toString.call(value) == '[object Function]';
Expand Down

0 comments on commit 9cfb360

Please sign in to comment.