@formo/analytics 1.16.12 → 1.16.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formo/analytics",
3
- "version": "1.16.12",
3
+ "version": "1.16.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/getformo/sdk.git"
@@ -1,7 +1,7 @@
1
1
  import { KEY_PREFIX } from "../constant";
2
- import { CookieOptions } from "../type";
2
+ import { CookieOptions, IStorage } from "../type";
3
3
 
4
- abstract class StorageBlueprint {
4
+ abstract class StorageBlueprint implements IStorage {
5
5
  constructor(private readonly writeKey: string) {}
6
6
 
7
7
  abstract isAvailable(): boolean;
@@ -3,14 +3,9 @@ import { CookieOptions } from "../type";
3
3
 
4
4
  class CookieStorage extends StorageBlueprint {
5
5
  public override isAvailable(): boolean {
6
- try {
7
- document.cookie = "cookie_test=1";
8
- const available = document.cookie.includes("cookie_test=");
9
- this.remove("cookie_test");
10
- return available;
11
- } catch {
12
- return false;
13
- }
6
+ return (
7
+ typeof document !== "undefined" && typeof document.cookie !== "undefined"
8
+ );
14
9
  }
15
10
 
16
11
  public override set(
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.16.12';
2
+ export const version = '1.16.14';