const _sessionStorage = {}
Object.defineProperty(globalThis, 'sessionStorage', {
value: {
- length: Object.getOwnPropertyNames(_sessionStorage).length,
+ length: Object.entries().length,
setItem: (key, value) => _sessionStorage[key] = value,
getItem: (key) => _sessionStorage[key],
- removeItem: (key) => delete _sessionStorage[key]
+ removeItem: (key) => delete _sessionStorage[key],
+ clear: () => _sessionStorage = {}
},
configurable: true,
enumerable: true