UNPKG
@snipsonian/core
Version:
latest (4.0.0)
4.0.0
3.3.0
3.1.0
3.0.3
3.0.2
2.1.0
2.0.0
1.11.0
1.9.1
1.8.0
1.7.0
1.6.0
1.5.4
1.5.3
1.5.2
1.5.0
1.4.4
1.4.3
1.4.1
1.4.0
1.3.1
Core/base reusable javascript code snippets
@snipsonian/core
/
src
/
error
/
isError.ts
11 lines
(8 loc)
•
295 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
isObjectPure
from
'../is/isObjectPure'
;
import
isSetString
from
'../string/isSetString'
;
export
default
function
isError
(
error
:
unknown
|
Error
): error is
Error
{
if
(!
isObjectPure
(error)) {
return
false
; }
return
isSetString
((error
as
unknown
as
Error
).
message
); }