X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Froot-helpers%2Fpeertube-web-storage.ts;h=3622cdc44e74f275408ac4afcebe9c07e8952bbd;hb=fbe415609c0f0d7ab104d66b2ce0eee24ce86393;hp=0bbe2c9fc8fac423771276006a8b1fd17f9c93ad;hpb=db9df9a72c67a6ba150620f0f1c0838a3c155786;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/root-helpers/peertube-web-storage.ts b/client/src/root-helpers/peertube-web-storage.ts index 0bbe2c9fc..3622cdc44 100644 --- a/client/src/root-helpers/peertube-web-storage.ts +++ b/client/src/root-helpers/peertube-web-storage.ts @@ -6,7 +6,8 @@ function proxify (instance: MemoryStorage) { return new Proxy(instance, { set: function (obj, prop: string | symbol, value) { if (Object.prototype.hasOwnProperty.call(MemoryStorage, prop)) { - instance[prop] = value + // FIXME: remove cast on typescript upgrade + instance[prop as any] = value } else { instance.setItem(prop, value) } @@ -14,8 +15,10 @@ function proxify (instance: MemoryStorage) { return true }, get: function (target, name: string | symbol | number) { - if (typeof instance[name] === 'function') { - return instance[name] + // FIXME: remove cast on typescript upgrade + if (typeof instance[name as any] === 'function') { + // FIXME: remove cast on typescript upgrade + return instance[name as any] } else if (valuesMap.has(name)) { return instance.getItem(name) } @@ -24,7 +27,7 @@ function proxify (instance: MemoryStorage) { } class MemoryStorage implements Storage { - [key: string | symbol]: any + [key: string]: any getItem (key: any) { const stringKey = String(key)