Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4384665
format.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
806 B
Referenced Files
None
Subscribers
None
format.ts
View Options
export
function
formatBytes
(
value
:
number
|
null
)
:
string
{
if
(
!
value
||
!
Number
.
isFinite
(
value
))
return
'unknown'
;
if
(
value
>=
1024
*
1024
)
return
`
${
Math
.
round
(
value
/
1024
/
1024
)
}
mb`
;
if
(
value
>=
1024
)
return
`
${
Math
.
round
(
value
/
1024
)
}
kb`
;
return
`
${
value
}
b`
;
}
export
function
crashDetail
(
code
:
string
)
:
string
{
switch
(
code
)
{
case
'SIGSEGV'
:
case
'EXCEPTION_ACCESS_VIOLATION'
:
return
'Invalid memory access'
;
case
'SIGBUS'
:
return
'Bus error'
;
case
'SIGFPE'
:
return
'Floating point exception'
;
case
'SIGILL'
:
case
'EXCEPTION_ILLEGAL_INSTRUCTION'
:
return
'Illegal instruction'
;
case
'SIGABRT'
:
return
'Abort'
;
case
'EXCEPTION_STACK_OVERFLOW'
:
return
'Stack overflow'
;
default
:
return
'Fatal error'
;
}
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, May 1, 7:56 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
541783
Default Alt Text
format.ts (806 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment