Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121621086
compose.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, Jul 12, 13:11
Size
1006 B
Mime Type
text/x-java
Expires
Mon, Jul 14, 13:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27360350
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
compose.js
View Options
import
_extends
from
"@babel/runtime/helpers/esm/extends"
;
import
merge
from
'./merge'
;
function
compose
()
{
for
(
var
_len
=
arguments
.
length
,
styles
=
new
Array
(
_len
),
_key
=
0
;
_key
<
_len
;
_key
++
)
{
styles
[
_key
]
=
arguments
[
_key
];
}
var
handlers
=
styles
.
reduce
(
function
(
acc
,
style
)
{
style
.
filterProps
.
forEach
(
function
(
prop
)
{
acc
[
prop
]
=
style
;
});
return
acc
;
},
{});
// false positive
// eslint-disable-next-line react/function-component-definition
var
fn
=
function
fn
(
props
)
{
return
Object
.
keys
(
props
).
reduce
(
function
(
acc
,
prop
)
{
if
(
handlers
[
prop
])
{
return
merge
(
acc
,
handlers
[
prop
](
props
));
}
return
acc
;
},
{});
};
fn
.
propTypes
=
process
.
env
.
NODE_ENV
!==
'production'
?
styles
.
reduce
(
function
(
acc
,
style
)
{
return
_extends
(
acc
,
style
.
propTypes
);
},
{})
:
{};
fn
.
filterProps
=
styles
.
reduce
(
function
(
acc
,
style
)
{
return
acc
.
concat
(
style
.
filterProps
);
},
[]);
return
fn
;
}
export
default
compose
;
Event Timeline
Log In to Comment