aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/peertube-web-storage.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-14 16:12:45 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-05-27 16:00:13 +0200
commit0f01a8bacddf6c502e6470e34fdac7750bb76e89 (patch)
treec0eb33e4b74f955979f2cb9ee747dfc81d7ff4fb /client/src/root-helpers/peertube-web-storage.ts
parent05ded92ed16bc83a33e71ecccf0f3ee9751fd7b0 (diff)
downloadPeerTube-0f01a8bacddf6c502e6470e34fdac7750bb76e89.tar.gz
PeerTube-0f01a8bacddf6c502e6470e34fdac7750bb76e89.tar.zst
PeerTube-0f01a8bacddf6c502e6470e34fdac7750bb76e89.zip
Remove ngx-meta
Unmaintained
Diffstat (limited to 'client/src/root-helpers/peertube-web-storage.ts')
-rw-r--r--client/src/root-helpers/peertube-web-storage.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/root-helpers/peertube-web-storage.ts b/client/src/root-helpers/peertube-web-storage.ts
index f29845443..d4cad8a20 100644
--- a/client/src/root-helpers/peertube-web-storage.ts
+++ b/client/src/root-helpers/peertube-web-storage.ts
@@ -4,17 +4,19 @@ const valuesMap = new Map()
4 4
5function proxify (instance: MemoryStorage) { 5function proxify (instance: MemoryStorage) {
6 return new Proxy(instance, { 6 return new Proxy(instance, {
7 set: function (obj, prop: string | number, value) { 7 set: function (obj, prop: string | symbol, value) {
8 if (MemoryStorage.prototype.hasOwnProperty(prop)) { 8 if (MemoryStorage.prototype.hasOwnProperty(prop)) {
9 instance[prop] = value 9 // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863
10 instance[prop as any] = value
10 } else { 11 } else {
11 instance.setItem(prop, value) 12 instance.setItem(prop, value)
12 } 13 }
13 return true 14 return true
14 }, 15 },
15 get: function (target, name: string | number) { 16 get: function (target, name: string | symbol | number) {
16 if (MemoryStorage.prototype.hasOwnProperty(name)) { 17 if (MemoryStorage.prototype.hasOwnProperty(name)) {
17 return instance[name] 18 // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863
19 return instance[name as any]
18 } 20 }
19 if (valuesMap.has(name)) { 21 if (valuesMap.has(name)) {
20 return instance.getItem(name) 22 return instance.getItem(name)
@@ -23,9 +25,8 @@ function proxify (instance: MemoryStorage) {
23 }) 25 })
24} 26}
25 27
26class MemoryStorage { 28class MemoryStorage implements Storage {
27 [key: string]: any 29 [key: string]: any
28 [index: number]: string
29 30
30 getItem (key: any) { 31 getItem (key: any) {
31 const stringKey = String(key) 32 const stringKey = String(key)