happy-dom
Advanced tools
Comparing version 14.3.0 to 14.3.1
@@ -7,3 +7,2 @@ /** | ||
export default class Storage { | ||
#private; | ||
/** | ||
@@ -10,0 +9,0 @@ * Returns length. |
@@ -7,3 +7,2 @@ /** | ||
export default class Storage { | ||
#private; | ||
/** | ||
@@ -10,0 +9,0 @@ * Returns length. |
@@ -1,13 +0,1 @@ | ||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { | ||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); | ||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); | ||
}; | ||
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
if (kind === "m") throw new TypeError("Private method is not writable"); | ||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); | ||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; | ||
}; | ||
var _Storage_store; | ||
/** | ||
@@ -18,6 +6,3 @@ * Storage. | ||
*/ | ||
class Storage { | ||
constructor() { | ||
_Storage_store.set(this, {}); | ||
} | ||
export default class Storage { | ||
/** | ||
@@ -29,3 +14,3 @@ * Returns length. | ||
get length() { | ||
return Object.keys(__classPrivateFieldGet(this, _Storage_store, "f")).length; | ||
return Object.keys(this).length; | ||
} | ||
@@ -39,3 +24,3 @@ /** | ||
key(index) { | ||
const name = Object.keys(__classPrivateFieldGet(this, _Storage_store, "f"))[index]; | ||
const name = Object.keys(this)[index]; | ||
return name === undefined ? null : name; | ||
@@ -50,3 +35,3 @@ } | ||
setItem(name, item) { | ||
__classPrivateFieldGet(this, _Storage_store, "f")[name] = item; | ||
this[name] = item; | ||
} | ||
@@ -60,3 +45,3 @@ /** | ||
getItem(name) { | ||
return __classPrivateFieldGet(this, _Storage_store, "f")[name] === undefined ? null : __classPrivateFieldGet(this, _Storage_store, "f")[name]; | ||
return this[name] === undefined ? null : this[name]; | ||
} | ||
@@ -69,3 +54,3 @@ /** | ||
removeItem(name) { | ||
delete __classPrivateFieldGet(this, _Storage_store, "f")[name]; | ||
delete this[name]; | ||
} | ||
@@ -76,7 +61,8 @@ /** | ||
clear() { | ||
__classPrivateFieldSet(this, _Storage_store, {}, "f"); | ||
const keys = Object.keys(this); | ||
for (const key of keys) { | ||
delete this[key]; | ||
} | ||
} | ||
} | ||
_Storage_store = new WeakMap(); | ||
export default Storage; | ||
//# sourceMappingURL=Storage.js.map |
{ | ||
"name": "happy-dom", | ||
"version": "14.3.0", | ||
"version": "14.3.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom", |
@@ -7,4 +7,2 @@ /** | ||
export default class Storage { | ||
#store: { [k: string]: string } = {}; | ||
/** | ||
@@ -16,3 +14,3 @@ * Returns length. | ||
public get length(): number { | ||
return Object.keys(this.#store).length; | ||
return Object.keys(this).length; | ||
} | ||
@@ -27,3 +25,3 @@ | ||
public key(index: number): string { | ||
const name = Object.keys(this.#store)[index]; | ||
const name = Object.keys(this)[index]; | ||
return name === undefined ? null : name; | ||
@@ -39,3 +37,3 @@ } | ||
public setItem(name: string, item: string): void { | ||
this.#store[name] = item; | ||
this[name] = item; | ||
} | ||
@@ -50,3 +48,3 @@ | ||
public getItem(name: string): string { | ||
return this.#store[name] === undefined ? null : this.#store[name]; | ||
return this[name] === undefined ? null : this[name]; | ||
} | ||
@@ -60,3 +58,3 @@ | ||
public removeItem(name: string): void { | ||
delete this.#store[name]; | ||
delete this[name]; | ||
} | ||
@@ -68,4 +66,7 @@ | ||
public clear(): void { | ||
this.#store = {}; | ||
const keys = Object.keys(this); | ||
for (const key of keys) { | ||
delete this[key]; | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
17
153
8188718
164215