Commit e7493f6a7d8d54c19dc2bdd6fa1e6e66a449410a
1 parent
1cf2b4f087
Exists in
master
Perbaikan dump history
Showing 1 changed file with 1 additions and 1 deletions Inline Diff
lib/history.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | const CircularBuffer = require("circular-buffer"); | 3 | const CircularBuffer = require("circular-buffer"); |
4 | const history = new CircularBuffer(200); | 4 | const history = new CircularBuffer(200); |
5 | 5 | ||
6 | function push(item) { | 6 | function push(item) { |
7 | history.push(item); | 7 | history.push(item); |
8 | } | 8 | } |
9 | 9 | ||
10 | function dump() { | 10 | function dump() { |
11 | history.toarray(); | 11 | return history.toarray(); |
12 | } | 12 | } |
13 | 13 | ||
14 | exports.push = push; | 14 | exports.push = push; |
15 | exports.dump = dump; | 15 | exports.dump = dump; |