-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sean Hamilton
committed
Nov 29, 2018
1 parent
066da0d
commit 613d4ed
Showing
1 changed file
with
16 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Check if the specified value is an object | ||
* | ||
* @param {*} value The value to check | ||
* | ||
* @returns {boolean} Whether it is an object | ||
*/ | ||
function is(value) { | ||
// check if the value is an instance of Object | ||
return value instanceof Object | ||
// check if the value constructor is Object | ||
&& value.constructor === Object; | ||
// if both match the value is truly an object | ||
} | ||
|
||
export default is; |