Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95183421
utilities.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
Fri, Dec 13, 13:09
Size
462 B
Mime Type
text/x-java
Expires
Sun, Dec 15, 13:09 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22917376
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
utilities.js
View Options
import
{
fileURLToPath
}
from
'node:url'
;
import
{
Transform
}
from
'node:stream'
;
export
const
toPath
=
urlOrPath
=>
urlOrPath
instanceof
URL
?
fileURLToPath
(
urlOrPath
)
:
urlOrPath
;
export
class
FilterStream
extends
Transform
{
constructor
(
filter
)
{
super
({
objectMode
:
true
,
transform
(
data
,
encoding
,
callback
)
{
callback
(
undefined
,
filter
(
data
)
?
data
:
undefined
);
},
});
}
}
export
const
isNegativePattern
=
pattern
=>
pattern
[
0
]
===
'!'
;
Event Timeline
Log In to Comment