class MemoryStorage {
constructor() {
Object.defineProperties(this, {_: {value: new Map}});
}
get length() {
return this._.size;
}
key(index) {
return Array.from(this._.keys())[index | 0];
}
getItem(key) {
return this._.has(key += "") ? this._.get(key) : null;
}
setItem(key, value) {
this._.set(key + "", value + "");
}
removeItem(key) {
this._.delete(key + "");
}
clear() {
this._.clear();
}
}