constructor()

in libs/@guardian/libs/src/storage/storage.ts [7:20]


	constructor(storageHandler: 'localStorage' | 'sessionStorage') {
		try {
			const storage = window[storageHandler];
			const uid = new Date().toString();
			storage.setItem(uid, uid);
			const available = storage.getItem(uid) == uid;
			storage.removeItem(uid);
			if (available) {
				this.#storage = storage;
			}
		} catch (e) {
			// do nothing
		}
	}