Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7859940
index.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
index.js
View Options
/*
* Module requirements.
*/
var
isArray
=
require
(
'isarray'
);
/**
* Module exports.
*/
module
.
exports
=
hasBinary
;
/**
* Checks for binary data.
*
* Right now only Buffer and ArrayBuffer are supported..
*
* @param {Object} anything
* @api public
*/
function
hasBinary
(
data
)
{
function
_hasBinary
(
obj
)
{
if
(
!
obj
)
return
false
;
if
(
(
global
.
Buffer
&&
Buffer
.
isBuffer
(
obj
))
||
(
global
.
ArrayBuffer
&&
obj
instanceof
ArrayBuffer
)
||
(
global
.
Blob
&&
obj
instanceof
Blob
)
||
(
global
.
File
&&
obj
instanceof
File
)
)
{
return
true
;
}
if
(
isArray
(
obj
))
{
for
(
var
i
=
0
;
i
<
obj
.
length
;
i
++
)
{
if
(
_hasBinary
(
obj
[
i
]))
{
return
true
;
}
}
}
else
if
(
obj
&&
'object'
==
typeof
obj
)
{
if
(
obj
.
toJSON
)
{
obj
=
obj
.
toJSON
();
}
for
(
var
key
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
key
)
&&
_hasBinary
(
obj
[
key
]))
{
return
true
;
}
}
}
return
false
;
}
return
_hasBinary
(
data
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 13, 17:10 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
876849
Default Alt Text
index.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment