electron-store icon indicating copy to clipboard operation
electron-store copied to clipboard

Default Behaviour for `store.get(undefined)`

Open Bug-Reaper opened this issue 1 year ago • 2 comments

I've just realized that the default behavior of getting undefined resolves the entire store w/any error or warning. Is an error or warning desirable for case of bad input args?

let u;
let storedu = store.get(u);
console.log(storedu);
// Lists entire contents of the satore

If so, happy to PR.

Bug-Reaper avatar Sep 30 '24 05:09 Bug-Reaper

It should throw a user-friendly error.

sindresorhus avatar Feb 04 '25 17:02 sindresorhus

Sweet! I can snipe that as soon as I get a sec!

Bug-Reaper avatar Feb 11 '25 21:02 Bug-Reaper