@kiva/kv-shop 1.1.2 → 1.1.4

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/dist/basket.cjs CHANGED
@@ -20,12 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var basket_exports = {};
21
21
  __export(basket_exports, {
22
22
  getBasketID: () => getBasketID,
23
+ getCookieValue: () => getCookieValue,
23
24
  setBasketID: () => setBasketID
24
25
  });
25
26
  module.exports = __toCommonJS(basket_exports);
26
27
  var getCookieValue = (name) => {
27
28
  if (typeof document !== void 0) {
28
- return document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "";
29
+ return decodeURIComponent(document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "");
29
30
  }
30
31
  };
31
32
  function getBasketID() {
@@ -36,5 +37,6 @@ function setBasketID(basketId) {
36
37
  // Annotate the CommonJS export names for ESM import in node:
37
38
  0 && (module.exports = {
38
39
  getBasketID,
40
+ getCookieValue,
39
41
  setBasketID
40
42
  });
package/dist/basket.d.ts CHANGED
@@ -1,4 +1,5 @@
1
+ declare const getCookieValue: (name: string) => string;
1
2
  declare function getBasketID(): string;
2
3
  declare function setBasketID(basketId: string): void;
3
4
 
4
- export { getBasketID, setBasketID };
5
+ export { getBasketID, getCookieValue, setBasketID };
package/dist/basket.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  getBasketID,
3
+ getCookieValue,
3
4
  setBasketID
4
- } from "./chunk-NEYLLDXO.js";
5
+ } from "./chunk-F6QCMBHV.js";
5
6
  export {
6
7
  getBasketID,
8
+ getCookieValue,
7
9
  setBasketID
8
10
  };
@@ -38,7 +38,7 @@ var import_numeral = __toESM(require("numeral"), 1);
38
38
  // src/basket.ts
39
39
  var getCookieValue = (name) => {
40
40
  if (typeof document !== void 0) {
41
- return document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "";
41
+ return decodeURIComponent(document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "");
42
42
  }
43
43
  };
44
44
  function getBasketID() {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  setTipDonation
3
- } from "./chunk-SFN7S4NC.js";
4
- import "./chunk-NEYLLDXO.js";
3
+ } from "./chunk-KSEC5YWO.js";
4
+ import "./chunk-F6QCMBHV.js";
5
5
  import "./chunk-H35VQXDR.js";
6
6
  export {
7
7
  setTipDonation
@@ -1,7 +1,7 @@
1
1
  // src/basket.ts
2
2
  var getCookieValue = (name) => {
3
3
  if (typeof document !== void 0) {
4
- return document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "";
4
+ return decodeURIComponent(document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "");
5
5
  }
6
6
  };
7
7
  function getBasketID() {
@@ -11,6 +11,7 @@ function setBasketID(basketId) {
11
11
  }
12
12
 
13
13
  export {
14
+ getCookieValue,
14
15
  getBasketID,
15
16
  setBasketID
16
17
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBasketID
3
- } from "./chunk-NEYLLDXO.js";
3
+ } from "./chunk-F6QCMBHV.js";
4
4
  import {
5
5
  parseShopError
6
6
  } from "./chunk-H35VQXDR.js";
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  executeOneTimeCheckout: () => executeOneTimeCheckout,
37
37
  getBasketID: () => getBasketID,
38
38
  getClientToken: () => getClientToken,
39
+ getCookieValue: () => getCookieValue,
39
40
  parseShopError: () => parseShopError,
40
41
  setBasketID: () => setBasketID,
41
42
  setTipDonation: () => setTipDonation,
@@ -47,7 +48,7 @@ module.exports = __toCommonJS(src_exports);
47
48
  // src/basket.ts
48
49
  var getCookieValue = (name) => {
49
50
  if (typeof document !== void 0) {
50
- return document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "";
51
+ return decodeURIComponent(document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "");
51
52
  }
52
53
  };
53
54
  function getBasketID() {
@@ -401,6 +402,7 @@ function useBraintreeDropIn() {
401
402
  executeOneTimeCheckout,
402
403
  getBasketID,
403
404
  getClientToken,
405
+ getCookieValue,
404
406
  parseShopError,
405
407
  setBasketID,
406
408
  setTipDonation,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { getBasketID, setBasketID } from './basket.js';
1
+ export { getBasketID, getCookieValue, setBasketID } from './basket.js';
2
2
  export { SetTipDonationOptions, setTipDonation } from './basketItems.js';
3
3
  export { OneTimeCheckoutOptions, WaitOnTransactionOptions, executeOneTimeCheckout, waitOnTransaction } from './oneTimeCheckout.js';
4
4
  export { ShopError, ShopErrorOptions, parseShopError } from './shopError.js';
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  setTipDonation
3
- } from "./chunk-SFN7S4NC.js";
3
+ } from "./chunk-KSEC5YWO.js";
4
4
  import {
5
5
  getBasketID,
6
+ getCookieValue,
6
7
  setBasketID
7
- } from "./chunk-NEYLLDXO.js";
8
+ } from "./chunk-F6QCMBHV.js";
8
9
  import {
9
10
  executeOneTimeCheckout,
10
11
  waitOnTransaction
@@ -30,6 +31,7 @@ export {
30
31
  executeOneTimeCheckout,
31
32
  getBasketID,
32
33
  getClientToken,
34
+ getCookieValue,
33
35
  parseShopError,
34
36
  setBasketID,
35
37
  setTipDonation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-shop",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,15 +19,18 @@
19
19
  }
20
20
  },
21
21
  "scripts": {
22
- "build": "tsup src/**/*.ts --format cjs,esm --dts --clean && cp -R src/components/ dist/components/",
22
+ "build": "tsup src/*.ts --format cjs,esm --dts --clean && cp -R src/components/ dist/components/",
23
23
  "lint": "eslint --ext .ts,.vue ./src",
24
- "test": "echo No test yet for kv-shop"
24
+ "test": "jest"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^5.59.7",
28
28
  "@typescript-eslint/parser": "^5.59.7",
29
29
  "@vue/eslint-config-typescript": "^11.0.3",
30
30
  "eslint-plugin-vue": "^9.14.0",
31
+ "jest": "^29.5.0",
32
+ "jest-environment-jsdom": "^29.5.0",
33
+ "ts-jest": "^29.1.0",
31
34
  "tsup": "^6.7.0",
32
35
  "typescript": "^5.0.4",
33
36
  "vue": "2.6",
@@ -50,5 +53,5 @@
50
53
  "optional": true
51
54
  }
52
55
  },
53
- "gitHead": "b9a95be67446d13e2e3ca878baf717dd02c8c5d6"
56
+ "gitHead": "2ad76dbc917ebd7ce1ef1278f8ce6164b8acfc57"
54
57
  }