From: Chris Duncan Date: Tue, 19 Nov 2024 07:01:57 +0000 (-0800) Subject: Assign private property in Safe constructor. X-Git-Tag: v0.0.20~8 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=1731241421f99978b6fc4088b03bd1e8248dbb8e;p=libnemo.git Assign private property in Safe constructor. --- diff --git a/src/lib/safe.ts b/src/lib/safe.ts index 8654756..e22503f 100644 --- a/src/lib/safe.ts +++ b/src/lib/safe.ts @@ -7,7 +7,11 @@ const { subtle } = globalThis.crypto const ERR_MSG = 'Failed to store item in Safe' export class Safe { - #storage = globalThis.sessionStorage + #storage: Storage + + constructor () { + this.#storage = globalThis.sessionStorage + } /** * Encrypts data with a password and stores it in the Safe.