Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120877891
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
Mon, Jul 7, 15:25
Size
755 B
Mime Type
text/x-c++
Expires
Wed, Jul 9, 15:25 (2 d)
Engine
blob
Format
Raw Data
Handle
27263130
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