File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 14
14
},
15
15
"main" : " src/singleton.js" ,
16
16
"dependencies" : {
17
+ "iserror" : " ^0.0.2" ,
17
18
"json-stringify-safe" : " ^5.0.1"
18
19
},
19
20
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var isError = require ( 'iserror' ) ;
4
+
3
5
function isObject ( what ) {
4
6
return typeof what === 'object' && what !== null ;
5
7
}
6
8
7
- // Sorta yanked from https://github.com/joyent/node/blob/aa3b4b4/lib/util.js#L560
8
- // with some tiny modifications
9
- function isError ( what ) {
10
- var toString = { } . toString . call ( what ) ;
11
- return isObject ( what ) &&
12
- toString === '[object Error]' ||
13
- toString === '[object Exception]' || // Firefox NS_ERROR_FAILURE Exceptions
14
- what instanceof Error ;
15
- }
16
-
17
9
module . exports = {
18
10
isObject : isObject ,
19
11
isError : isError
You can’t perform that action at this time.
0 commit comments