Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91589811
RequestShortener.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, Nov 12, 12:30
Size
755 B
Mime Type
text/x-c++
Expires
Thu, Nov 14, 12:30 (2 d)
Engine
blob
Format
Raw Data
Handle
22289131
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
RequestShortener.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict"
;
const
{
contextify
}
=
require
(
"./util/identifier"
);
class
RequestShortener
{
/**
* @param {string} dir the directory
* @param {object=} associatedObjectForCache an object to which the cache will be attached
*/
constructor
(
dir
,
associatedObjectForCache
)
{
this
.
contextify
=
contextify
.
bindContextCache
(
dir
,
associatedObjectForCache
);
}
/**
* @param {string | undefined | null} request the request to shorten
* @returns {string | undefined | null} the shortened request
*/
shorten
(
request
)
{
if
(
!
request
)
{
return
request
;
}
return
this
.
contextify
(
request
);
}
}
module
.
exports
=
RequestShortener
;
Event Timeline
Log In to Comment