Skip to content

Commit

Permalink
Use JSON instead of window.JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
xander-marjoram committed Apr 25, 2024
1 parent b96bec2 commit 55958df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ const generateFormQueryUrl = (queryString, formUrl) => {
const fullAddressLocalStorageService = {
setItem (key, value = {}) {
if (window.localStorage) {
window.localStorage.setItem(key, window.JSON.stringify(value));
window.localStorage.setItem(key, JSON.stringify(value));
}
},

getItem (key) {
if (window.localStorage) {
const item = window.localStorage.getItem(key);

return item ? window.JSON.parse(item) : false;
return item ? JSON.parse(item) : false;
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ describe('`general.services`', () => {
}());

Object.defineProperty(window, 'localStorage', { value: localStorage });
Object.defineProperty(window, 'JSON', { value: JSON });
});

it('should exist', () => {
Expand Down

0 comments on commit 55958df

Please sign in to comment.