@open-tender/utils 0.1.86 → 0.1.88

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.
@@ -11,7 +11,7 @@ export declare const handleRespError: (err: RequestError) => {
11
11
  export declare const processError: (msg: string | null) => string;
12
12
  export declare const handleFormErrors: (params: Record<string, string | null>) => Record<string, string>;
13
13
  export declare const makeFormErrors: (error: RequestError) => Record<string, string>;
14
- export declare const handleCheckoutErrors: (errors: RequestError, asMessages?: boolean) => Record<string, unknown>;
14
+ export declare const handleCheckoutError: (error: CheckoutError, asMessages?: boolean) => Record<string, unknown>;
15
15
  export declare const makeCheckError: (params: CheckoutErrorParams) => CheckoutError;
16
16
  export declare const errMessages: {
17
17
  unknown: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errMessages = exports.makeCheckError = exports.handleCheckoutErrors = exports.makeFormErrors = exports.handleFormErrors = exports.processError = exports.handleRespError = void 0;
3
+ exports.errMessages = exports.makeCheckError = exports.handleCheckoutError = exports.makeFormErrors = exports.handleFormErrors = exports.processError = exports.handleRespError = void 0;
4
4
  const helpers_1 = require("./helpers");
5
5
  const handleRespError = (err) => {
6
6
  const error = typeof err === 'string' ? { detail: err } : err;
@@ -75,8 +75,8 @@ const makeFormErrors = (error) => {
75
75
  return errors;
76
76
  };
77
77
  exports.makeFormErrors = makeFormErrors;
78
- const handleCheckoutErrors = (errors, asMessages = true) => {
79
- const { detail, params, message } = errors || {};
78
+ const handleCheckoutError = (error, asMessages = true) => {
79
+ const { detail, params, message } = error || {};
80
80
  if (!params || (0, helpers_1.isEmpty)(params))
81
81
  return { form: detail || message };
82
82
  const errObj = Object.entries(params).reduce((obj, error) => {
@@ -111,7 +111,7 @@ const handleCheckoutErrors = (errors, asMessages = true) => {
111
111
  }, { form: 'There are one or more errors below' });
112
112
  return errObj;
113
113
  };
114
- exports.handleCheckoutErrors = handleCheckoutErrors;
114
+ exports.handleCheckoutError = handleCheckoutError;
115
115
  const makeCheckError = (params) => {
116
116
  if (!params || (0, helpers_1.isEmpty)(params))
117
117
  return null;
@@ -4,6 +4,7 @@ export declare const remsToPixels: (rems?: string, responsive?: boolean) => stri
4
4
  export declare const remsToNumber: (rems: string) => number;
5
5
  export declare const objRemsToPixels: <T extends Partial<ThemeLayout & {
6
6
  big: string;
7
+ small: string;
7
8
  giga: string;
8
9
  h1: string;
9
10
  h2: string;
@@ -13,7 +14,6 @@ export declare const objRemsToPixels: <T extends Partial<ThemeLayout & {
13
14
  h6: string;
14
15
  main: string;
15
16
  mega: string;
16
- small: string;
17
17
  tera: string;
18
18
  xBig: string;
19
19
  xSmall: string;
@@ -11,7 +11,7 @@ export declare const handleRespError: (err: RequestError) => {
11
11
  export declare const processError: (msg: string | null) => string;
12
12
  export declare const handleFormErrors: (params: Record<string, string | null>) => Record<string, string>;
13
13
  export declare const makeFormErrors: (error: RequestError) => Record<string, string>;
14
- export declare const handleCheckoutErrors: (errors: RequestError, asMessages?: boolean) => Record<string, unknown>;
14
+ export declare const handleCheckoutError: (error: CheckoutError, asMessages?: boolean) => Record<string, unknown>;
15
15
  export declare const makeCheckError: (params: CheckoutErrorParams) => CheckoutError;
16
16
  export declare const errMessages: {
17
17
  unknown: string;
@@ -68,8 +68,8 @@ export const makeFormErrors = (error) => {
68
68
  }
69
69
  return errors;
70
70
  };
71
- export const handleCheckoutErrors = (errors, asMessages = true) => {
72
- const { detail, params, message } = errors || {};
71
+ export const handleCheckoutError = (error, asMessages = true) => {
72
+ const { detail, params, message } = error || {};
73
73
  if (!params || isEmpty(params))
74
74
  return { form: detail || message };
75
75
  const errObj = Object.entries(params).reduce((obj, error) => {
@@ -4,6 +4,7 @@ export declare const remsToPixels: (rems?: string, responsive?: boolean) => stri
4
4
  export declare const remsToNumber: (rems: string) => number;
5
5
  export declare const objRemsToPixels: <T extends Partial<ThemeLayout & {
6
6
  big: string;
7
+ small: string;
7
8
  giga: string;
8
9
  h1: string;
9
10
  h2: string;
@@ -13,7 +14,6 @@ export declare const objRemsToPixels: <T extends Partial<ThemeLayout & {
13
14
  h6: string;
14
15
  main: string;
15
16
  mega: string;
16
- small: string;
17
17
  tera: string;
18
18
  xBig: string;
19
19
  xSmall: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.86",
3
+ "version": "0.1.88",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",