1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var getWindow_1 = require("./dom/getWindow");
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | function getItem(key) {
|
9 | var result = null;
|
10 | try {
|
11 | var win = getWindow_1.getWindow();
|
12 | result = win ? win.localStorage.getItem(key) : null;
|
13 | }
|
14 | catch (e) {
|
15 |
|
16 | }
|
17 | return result;
|
18 | }
|
19 | exports.getItem = getItem;
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | function setItem(key, data) {
|
26 | try {
|
27 | var win = getWindow_1.getWindow();
|
28 | win && win.localStorage.setItem(key, data);
|
29 | }
|
30 | catch (e) {
|
31 |
|
32 | }
|
33 | }
|
34 | exports.setItem = setItem;
|
35 |
|
\ | No newline at end of file |