jacany / nosbin

Returning values from setters JS-0037
Bug risk
Major
3 months agoa year old
Setter cannot return a value
135
136		this._privkey = key;
137		if (browser) localStorage.setItem("keys", JSON.stringify([this._pubkey, key]));
138		return input;139	}
140
141	public generateKeys(): string[] {
Setter cannot return a value
129			try {
130				key = nip19.decode(input).data;
131			} catch (error) {
132				return new Error("Failed to decode nsec");133			}
134		}
135
Setter cannot return a value
111
112		this._pubkey = key;
113		if (browser) localStorage.setItem("keys", JSON.stringify([key, this._privkey]));
114		return input;115	}
116	public get privkey(): string {
117		if (!this._privkey) return "";
Setter cannot return a value
105			try {
106				key = nip19.decode(input).data;
107			} catch (error) {
108				return new Error("Failed to decode npub");109			}
110		}
111