@adobe/spacecat-shared-utils 1.16.2 → 1.17.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-utils-v1.17.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.16.2...@adobe/spacecat-shared-utils-v1.17.0) (2024-07-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * isNonEmptyObject ([#280](https://github.com/adobe/spacecat-shared/issues/280)) ([2e8ce04](https://github.com/adobe/spacecat-shared/commit/2e8ce048f192b9dd5f108a3590c2b8ea01c9eb84))
7
+
1
8
  # [@adobe/spacecat-shared-utils-v1.16.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.16.1...@adobe/spacecat-shared-utils-v1.16.2) (2024-06-29)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.16.2",
3
+ "version": "1.17.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/functions.js CHANGED
@@ -66,6 +66,15 @@ function isObject(value) {
66
66
  return !isArray(value) && value !== null && typeof value === 'object';
67
67
  }
68
68
 
69
+ /**
70
+ * Checks if the given value is an object and contains properties of its own.
71
+ * @param {*} value - The value to check.
72
+ * @return {boolean} True if the value is a non-empty object, false otherwise.
73
+ */
74
+ function isNonEmptyObject(value) {
75
+ return isObject(value) && Object.keys(value).length > 0;
76
+ }
77
+
69
78
  /**
70
79
  * Determines if the given parameter is a string.
71
80
  *
@@ -196,6 +205,7 @@ export {
196
205
  isIsoTimeOffsetsDate,
197
206
  isNumber,
198
207
  isObject,
208
+ isNonEmptyObject,
199
209
  isString,
200
210
  toBoolean,
201
211
  isValidUrl,
package/src/index.d.ts CHANGED
@@ -29,6 +29,8 @@ export function isNumber(value: unknown): boolean;
29
29
 
30
30
  export function isObject(value: unknown): boolean;
31
31
 
32
+ export function isNonEmptyObject(value: unknown): boolean;
33
+
32
34
  export function isString(value: unknown): boolean;
33
35
 
34
36
  export function toBoolean(value: unknown): boolean;