@jetthai/cuora 1.1.361-dev-10 → 1.1.361-v2api-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +0,0 @@
1
- export default {
2
- get(name, options) {
3
- const itemStr = sessionStorage.getItem(name)
4
-
5
- if (!itemStr) {
6
- return null
7
- }
8
-
9
- const item = JSON.parse(itemStr)
10
- if (item.expiry && new Date().getTime() > item.expiry) {
11
- sessionStorage.removeItem(name)
12
- return null
13
- }
14
-
15
- return item.value
16
- },
17
- set(name, value, options) {
18
- const item = { value }
19
-
20
- if (options?.maxAge) {
21
- item.expiry = new Date().getTime() + options.maxAge * 1000
22
- }
23
- sessionStorage.setItem(name, JSON.stringify(item))
24
- },
25
- remove(name, options) {
26
- sessionStorage.removeItem(name)
27
- },
28
- }