Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101020338
exactProp.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
Tue, Feb 4, 21:22
Size
981 B
Mime Type
text/x-java
Expires
Thu, Feb 6, 21:22 (2 d)
Engine
blob
Format
Raw Data
Handle
24077818
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
exactProp.js
View Options
import
_defineProperty
from
"@babel/runtime/helpers/esm/defineProperty"
;
import
_extends
from
"@babel/runtime/helpers/esm/extends"
;
// This module is based on https://github.com/airbnb/prop-types-exact repository.
// However, in order to reduce the number of dependencies and to remove some extra safe checks
// the module was forked.
var
specialProperty
=
"exact-prop: \u200B"
;
export
default
function
exactProp
(
propTypes
)
{
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
return
propTypes
;
}
return
_extends
({},
propTypes
,
_defineProperty
({},
specialProperty
,
function
(
props
)
{
var
unsupportedProps
=
Object
.
keys
(
props
).
filter
(
function
(
prop
)
{
return
!
propTypes
.
hasOwnProperty
(
prop
);
});
if
(
unsupportedProps
.
length
>
0
)
{
return
new
Error
(
"The following props are not supported: "
.
concat
(
unsupportedProps
.
map
(
function
(
prop
)
{
return
"`"
.
concat
(
prop
,
"`"
);
}).
join
(
', '
),
". Please remove them."
));
}
return
null
;
}));
}
Event Timeline
Log In to Comment