UNPKG
captcha-canvas-js
Version:
latest (1.0.5)
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
A simple captcha generator using canvas in JavaScript
captcha-canvas-js
/
dist
/
memory
/
memory-store.js
14 lines
(13 loc)
•
307 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export
class
MemoryStore
{ store =
new
Map
();
async
set
(
id, value
) {
this
.
store
.
set
(id, value);
setTimeout
(
() =>
this
.
store
.
delete
(id),
180_000
); }
async
get
(
id
) {
return
this
.
store
.
get
(id) ||
null
; }
async
delete
(
id
) {
this
.
store
.
delete
(id); } }