ya-express-ntlm
Version:
18 lines • 540 B
JavaScript
export const userDelayCache = {
cache: {},
set(userData, rsn) {
this.cache[`${userData.domain}\${${userData.username}}`] = Date.now() + rsn.options.getAuthDelay(rsn);
},
get(userData) {
const id = `${userData.domain}\${${userData.username}}`;
let n = this.cache[id] || 0;
if (n) {
n = Math.floor(Math.max(0, (n - Date.now()) / 1000));
}
if (!n) {
delete this.cache[id];
}
return n;
},
};
//# sourceMappingURL=user-delay-cache.js.map