UNPKG

286 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.ttl = ttl;
7function ttl(key) {
8 if (!this.data.has(key)) {
9 return -2;
10 }
11
12 if (!this.expires.has(key)) {
13 return -1;
14 }
15
16 return Math.ceil((this.expires.get(key) - Date.now()) / 1000);
17}
\No newline at end of file