mirror of
https://github.com/prymitive/karma
synced 2026-05-13 03:56:59 +00:00
22 lines
311 B
JavaScript
22 lines
311 B
JavaScript
class LocalStorageMock {
|
|
|
|
constructor() {
|
|
this.store = {};
|
|
}
|
|
|
|
getItem(key) {
|
|
return this.store[key] || null;
|
|
}
|
|
|
|
setItem(key, value) {
|
|
this.store[key] = value.toString();
|
|
}
|
|
|
|
clear() {
|
|
this.store = {};
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = new LocalStorageMock();
|