1 | ;
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.rpop = rpop;
|
7 | function rpop(key) {
|
8 | if (this.data.has(key) && !(this.data.get(key) instanceof Array)) {
|
9 | throw new Error("Key " + key + " does not contain a list");
|
10 | }
|
11 | var list = this.data.get(key) || [];
|
12 |
|
13 | var item = list.length > 0 ? list.pop() : null;
|
14 |
|
15 | this.data.set(key, list);
|
16 |
|
17 | return item;
|
18 | } |
\ | No newline at end of file |