(key, defaultValue = undefined)
| 1 | const PREFIX = "localOptions:"; |
| 2 | |
| 3 | function get(key, defaultValue = undefined) { |
| 4 | const fullKey = PREFIX + key; |
| 5 | if (fullKey in window.localStorage) { |
| 6 | return JSON.parse(window.localStorage.getItem(fullKey)); |
| 7 | } |
| 8 | return defaultValue; |
| 9 | } |
| 10 | |
| 11 | function set(key, value) { |
| 12 | const fullKey = PREFIX + key; |
no outgoing calls
no test coverage detected