UNPKG
amf-codec
Version:
latest (1.4.0)
1.4.0
1.3.1
1.3.0
1.2.0
1.1.1
1.1.0
1.0.0
AMF0 codec with tiny size and high performance
github.com/csimi/amf-codec
csimi/amf-codec
amf-codec
/
lib
/
memo.js
18 lines
(15 loc)
•
296 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module.exports =
class
Memo
{
constructor
(position =
0
) {
this
.position = position;
this
.references = []; } consume (amount) {
const
position =
this
.position;
this
.position += amount;
return
position; } skip (amount) {
this
.position += amount;
return
this
.position; } };