Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101759132
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
Thu, Feb 13, 10:19
Size
755 B
Mime Type
text/x-c++
Expires
Sat, Feb 15, 10:19 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24225636
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