@open-tender/utils 0.1.150 → 0.1.151

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.
@@ -42,7 +42,7 @@ export declare const formatQuantity: (n: string) => string;
42
42
  export declare const formatDollars: (str: string, space?: string, decimals?: number) => string;
43
43
  export declare const convertStringToArray: (str: string | null) => string[];
44
44
  export declare const hasEntities: <T extends unknown[]>(reducer: {
45
- entities: T;
45
+ entities: T | null;
46
46
  loading: RequestStatus;
47
47
  error: RequestError;
48
48
  }) => number | false;
@@ -196,6 +196,8 @@ const hasEntities = (reducer) => {
196
196
  if (!reducer)
197
197
  return false;
198
198
  const { entities, loading, error } = reducer;
199
+ if (!entities)
200
+ return false;
199
201
  if (loading === 'pending' && !entities.length)
200
202
  return false;
201
203
  return !error && entities.length;
@@ -42,7 +42,7 @@ export declare const formatQuantity: (n: string) => string;
42
42
  export declare const formatDollars: (str: string, space?: string, decimals?: number) => string;
43
43
  export declare const convertStringToArray: (str: string | null) => string[];
44
44
  export declare const hasEntities: <T extends unknown[]>(reducer: {
45
- entities: T;
45
+ entities: T | null;
46
46
  loading: RequestStatus;
47
47
  error: RequestError;
48
48
  }) => number | false;
@@ -163,6 +163,8 @@ export const hasEntities = (reducer) => {
163
163
  if (!reducer)
164
164
  return false;
165
165
  const { entities, loading, error } = reducer;
166
+ if (!entities)
167
+ return false;
166
168
  if (loading === 'pending' && !entities.length)
167
169
  return false;
168
170
  return !error && entities.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.150",
3
+ "version": "0.1.151",
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",