Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99501749
_to_primitive.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 25, 01:20
Size
859 B
Mime Type
text/x-Algol68
Expires
Mon, Jan 27, 01:20 (2 d)
Engine
blob
Format
Raw Data
Handle
23807011
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
_to_primitive.js
View Options
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
Object
.
defineProperty
(
exports
,
"default"
,
{
enumerable
:
true
,
get
:
function
()
{
return
_toPrimitive
;
}
});
var
_typeOfMjs
=
/*#__PURE__*/
_interopRequireDefault
(
require
(
"./_type_of.js"
));
function
_interopRequireDefault
(
obj
)
{
return
obj
&&
obj
.
__esModule
?
obj
:
{
default
:
obj
};
}
function
_toPrimitive
(
input
,
hint
)
{
if
((
0
,
_typeOfMjs
.
default
)(
input
)
!==
"object"
||
input
===
null
)
return
input
;
var
prim
=
input
[
Symbol
.
toPrimitive
];
if
(
prim
!==
undefined
)
{
var
res
=
prim
.
call
(
input
,
hint
||
"default"
);
if
((
0
,
_typeOfMjs
.
default
)(
res
)
!==
"object"
)
return
res
;
throw
new
TypeError
(
"@@toPrimitive must return a primitive value."
);
}
return
(
hint
===
"string"
?
String
:
Number
)(
input
);
}
Event Timeline
Log In to Comment