@searchspring/snap-toolbox 0.56.5 → 0.57.0

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,6 +1,6 @@
1
1
  export declare const cookies: Cookies;
2
2
  interface Cookies {
3
- set: (name: string, val: string, sameSite: string, expires: number) => void;
3
+ set: (name: string, val: string, sameSite?: string, expires?: number, domain?: string | undefined) => void;
4
4
  get: (name: string) => string;
5
5
  unset: (name: string) => void;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/cookies/cookies.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAE,OAuCrB,CAAC;AAEF,UAAU,OAAO;IAChB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B"}
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/cookies/cookies.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAE,OAiDrB,CAAC;AAEF,UAAU,OAAO;IAChB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC3G,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cookies = void 0;
4
4
  exports.cookies = {
5
- set: function (name, val, sameSite, expires) {
5
+ set: function (name, val, sameSite, expires, domain) {
6
6
  sameSite = sameSite || 'Lax';
7
7
  var cookie = name + '=' + encodeURIComponent(val) + ';' + 'SameSite=' + sameSite + ';path=/;';
8
8
  if (window.location.protocol == 'https:') {
@@ -13,6 +13,9 @@ exports.cookies = {
13
13
  d.setTime(d.getTime() + expires);
14
14
  cookie += 'expires=' + d['toUTCString']() + ';';
15
15
  }
16
+ if (domain) {
17
+ cookie += 'domain=' + domain + ';';
18
+ }
16
19
  window.document.cookie = cookie;
17
20
  },
18
21
  get: function (name) {
@@ -29,7 +32,11 @@ exports.cookies = {
29
32
  }
30
33
  return '';
31
34
  },
32
- unset: function (name) {
33
- window.document.cookie = name + '=; path=/; Max-Age=-99999999;';
35
+ unset: function (name, domain) {
36
+ var cookie = name + '=; path=/; Max-Age=-99999999;';
37
+ if (domain) {
38
+ cookie += 'domain=' + domain + ';';
39
+ }
40
+ window.document.cookie = cookie;
34
41
  },
35
42
  };
@@ -1,6 +1,6 @@
1
1
  export declare const cookies: Cookies;
2
2
  interface Cookies {
3
- set: (name: string, val: string, sameSite: string, expires: number) => void;
3
+ set: (name: string, val: string, sameSite?: string, expires?: number, domain?: string | undefined) => void;
4
4
  get: (name: string) => string;
5
5
  unset: (name: string) => void;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/cookies/cookies.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAE,OAuCrB,CAAC;AAEF,UAAU,OAAO;IAChB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B"}
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/cookies/cookies.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAE,OAiDrB,CAAC;AAEF,UAAU,OAAO;IAChB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC3G,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B"}
@@ -1,5 +1,5 @@
1
1
  export const cookies = {
2
- set: (name, val, sameSite, expires) => {
2
+ set: (name, val, sameSite, expires, domain) => {
3
3
  sameSite = sameSite || 'Lax';
4
4
  let cookie = name + '=' + encodeURIComponent(val) + ';' + 'SameSite=' + sameSite + ';path=/;';
5
5
  if (window.location.protocol == 'https:') {
@@ -10,6 +10,9 @@ export const cookies = {
10
10
  d.setTime(d.getTime() + expires);
11
11
  cookie += 'expires=' + d['toUTCString']() + ';';
12
12
  }
13
+ if (domain) {
14
+ cookie += 'domain=' + domain + ';';
15
+ }
13
16
  window.document.cookie = cookie;
14
17
  },
15
18
  get: (name) => {
@@ -26,7 +29,11 @@ export const cookies = {
26
29
  }
27
30
  return '';
28
31
  },
29
- unset: (name) => {
30
- window.document.cookie = name + '=; path=/; Max-Age=-99999999;';
32
+ unset: (name, domain) => {
33
+ let cookie = name + '=; path=/; Max-Age=-99999999;';
34
+ if (domain) {
35
+ cookie += 'domain=' + domain + ';';
36
+ }
37
+ window.document.cookie = cookie;
31
38
  },
32
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchspring/snap-toolbox",
3
- "version": "0.56.5",
3
+ "version": "0.57.0",
4
4
  "description": "Snap Toolbox",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,5 +23,5 @@
23
23
  "files": [
24
24
  "dist/**/*"
25
25
  ],
26
- "gitHead": "5562d502635a4f9a0df7c6f66f0ecc20b7a2da9c"
26
+ "gitHead": "ecf2e7bef805aa78834736ab44fbe5f9f912db78"
27
27
  }