@adobe/spacecat-shared-utils 1.25.0 → 1.25.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-utils-v1.25.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.25.1...@adobe/spacecat-shared-utils-v1.25.2) (2024-12-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * isNonEmptyArray from utils ([#512](https://github.com/adobe/spacecat-shared/issues/512)) ([21b87ed](https://github.com/adobe/spacecat-shared/commit/21b87edc507f20285355becd5d51a9b7010e9651))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.25.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.25.0...@adobe/spacecat-shared-utils-v1.25.1) (2024-12-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * types & deps ([#510](https://github.com/adobe/spacecat-shared/issues/510)) ([d162c1d](https://github.com/adobe/spacecat-shared/commit/d162c1d75a2052fc07da844923762e9397016b90))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.25.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.24.1...@adobe/spacecat-shared-utils-v1.25.0) (2024-12-23)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@adobe/helix-shared-wrap": "2.0.2",
38
- "@adobe/spacecat-shared-data-access": "1.60.3",
38
+ "@adobe/spacecat-shared-data-access": "1.61.5",
39
39
  "chai": "5.1.2",
40
40
  "chai-as-promised": "8.0.1",
41
41
  "husky": "9.1.7",
package/src/functions.js CHANGED
@@ -24,6 +24,15 @@ function isArray(value) {
24
24
  return Array.isArray(value);
25
25
  }
26
26
 
27
+ /**
28
+ * Determines whether the given value is a non-empty array (length greater than zero).
29
+ * @param {*} value - The value to check.
30
+ * @return {boolean} True if the value is a non-empty array, false otherwise.
31
+ */
32
+ function isNonEmptyArray(value) {
33
+ return isArray(value) && value.length > 0;
34
+ }
35
+
27
36
  /**
28
37
  * Determines case-insensitively if the given value is a boolean or a string
29
38
  * representation of a boolean.
@@ -233,19 +242,20 @@ function dateAfterDays(days, dateString) {
233
242
 
234
243
  export {
235
244
  arrayEquals,
245
+ dateAfterDays,
246
+ deepEqual,
236
247
  hasText,
237
248
  isArray,
238
249
  isBoolean,
239
250
  isInteger,
240
- isValidDate,
241
251
  isIsoDate,
242
252
  isIsoTimeOffsetsDate,
253
+ isNonEmptyArray,
254
+ isNonEmptyObject,
243
255
  isNumber,
244
256
  isObject,
245
- isNonEmptyObject,
246
257
  isString,
247
- toBoolean,
258
+ isValidDate,
248
259
  isValidUrl,
249
- dateAfterDays,
250
- deepEqual,
260
+ toBoolean,
251
261
  };
package/src/index.d.ts CHANGED
@@ -31,6 +31,8 @@ export function isNumber(value: unknown): boolean;
31
31
 
32
32
  export function isObject(value: unknown): boolean;
33
33
 
34
+ export function isNonEmptyArray(value: unknown): boolean;
35
+
34
36
  export function isNonEmptyObject(value: unknown): boolean;
35
37
 
36
38
  export function isString(value: unknown): boolean;
package/src/index.js CHANGED
@@ -12,21 +12,22 @@
12
12
 
13
13
  export {
14
14
  arrayEquals,
15
+ dateAfterDays,
16
+ deepEqual,
15
17
  hasText,
16
18
  isArray,
17
19
  isBoolean,
18
20
  isInteger,
19
- isValidDate,
20
21
  isIsoDate,
21
22
  isIsoTimeOffsetsDate,
23
+ isNonEmptyArray,
24
+ isNonEmptyObject,
22
25
  isNumber,
23
26
  isObject,
24
- isNonEmptyObject,
25
27
  isString,
26
- toBoolean,
28
+ isValidDate,
27
29
  isValidUrl,
28
- dateAfterDays,
29
- deepEqual,
30
+ toBoolean,
30
31
  } from './functions.js';
31
32
 
32
33
  export {