Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 21 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | const storage = { |
||
2 | storeToken: function storeToken(token) { |
||
3 | localStorage.setItem("tokenDate", new Date().getTime()); |
||
|
|||
4 | localStorage.setItem("token", token); |
||
5 | }, |
||
6 | readToken: function readToken() { |
||
7 | const token = localStorage.getItem("token"); |
||
8 | const tokenDate = localStorage.getItem("tokenDate"); |
||
9 | const tokenObj = { |
||
10 | token: token, |
||
11 | date: tokenDate, |
||
12 | }; |
||
13 | return tokenObj; |
||
14 | }, |
||
15 | deleteToken: function readToken() { |
||
16 | localStorage.removeItem("token"); |
||
17 | localStorage.removeItem("tokenDate"); |
||
18 | }, |
||
19 | }; |
||
20 | |||
21 | export default storage; |
||
22 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.