From 5dec03497d7f5067bfdac800ea423064bc9d0bd5 Mon Sep 17 00:00:00 2001 From: "Aka, but nice" <119691881+Aka-but-nice@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:28:13 -0500 Subject: [PATCH] Update localStorage.js Not sure why a function is being called in the first place. --- storages/localStorage.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/storages/localStorage.js b/storages/localStorage.js index 09fe08c9..288025e2 100644 --- a/storages/localStorage.js +++ b/storages/localStorage.js @@ -10,29 +10,26 @@ module.exports = { clearAll: clearAll, } -function localStorage() { - return Global.localStorage -} - +var localStorage = Global.localStorage; function read(key) { - return localStorage().getItem(key) + return localStorage.getItem(key) } function write(key, data) { - return localStorage().setItem(key, data) + return localStorage.setItem(key, data) } function each(fn) { - for (var i = localStorage().length - 1; i >= 0; i--) { - var key = localStorage().key(i) + for (var i = localStorage.length - 1; i >= 0; i--) { + var key = localStorage.key(i) fn(read(key), key) } } function remove(key) { - return localStorage().removeItem(key) + return localStorage.removeItem(key) } function clearAll() { - return localStorage().clear() + return localStorage.clear() }