Fix eslint warnings

This commit is contained in:
RainLoop Team 2016-04-20 20:12:51 +03:00
parent dd824179f1
commit 72ca818500
35 changed files with 510 additions and 290 deletions

View file

@ -22,19 +22,25 @@ class CookieDriver
const storageValue = $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME);
storageResult = null === storageValue ? null : JSON.parse(storageValue);
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
(storageResult || (storageResult = {}))[key] = data;
try
{
$.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME, JSON.stringify(storageResult), {
'expires': 30
expires: 30
});
result = true;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return result;
}
@ -43,7 +49,7 @@ class CookieDriver
* @param {string} key
* @return {*}
*/
get(sKey) {
get(key) {
let result = null;
@ -56,10 +62,13 @@ class CookieDriver
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return mResult;
};
return result;
}
/**
* @return {boolean}

View file

@ -22,7 +22,10 @@ class LocalStorageDriver
const storageValue = window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] || null;
storageResult = null === storageValue ? null : JSON.parse(storageValue);
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
(storageResult || (storageResult = {}))[key] = data;
@ -31,7 +34,10 @@ class LocalStorageDriver
window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] = JSON.stringify(storageResult);
result = true;
}
catch (e) {}
catch (e)
{
// eslint-disable-line no-empty
}
return result;
}
@ -41,19 +47,22 @@ class LocalStorageDriver
* @return {*}
*/
get(key) {
let result = null;
try
{
const
const
storageValue = window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] || null,
storageResult = null === storageValue ? null : JSON.parse(storageValue)
;
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null
result = (storageResult && !Utils.isUnd(storageResult[key])) ? storageResult[key] : null;
}
catch (e)
{
// eslint-disable-line no-empty
}
catch (e) {}
return result;
}