@adobe/spacecat-shared-utils 1.25.4 → 1.26.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 +14 -0
- package/package.json +6 -5
- package/src/functions.js +12 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.26.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.25.5...@adobe/spacecat-shared-utils-v1.26.0) (2025-01-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* isValidUUID ([#531](https://github.com/adobe/spacecat-shared/issues/531)) ([30bb19b](https://github.com/adobe/spacecat-shared/commit/30bb19bf47937a33ea8beb47d420a68a4bd1cd8b))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-utils-v1.25.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.25.4...@adobe/spacecat-shared-utils-v1.25.5) (2025-01-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#524](https://github.com/adobe/spacecat-shared/issues/524)) ([ae50dad](https://github.com/adobe/spacecat-shared/commit/ae50dad8e6e31f53350fc411122a8aed0b715279))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-utils-v1.25.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.25.3...@adobe/spacecat-shared-utils-v1.25.4) (2025-01-03)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@adobe/fetch": "4.1.11",
|
|
48
|
-
"@aws-sdk/client-s3": "3.
|
|
49
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
50
|
-
"@aws-sdk/client-sqs": "3.
|
|
48
|
+
"@aws-sdk/client-s3": "3.722.0",
|
|
49
|
+
"@aws-sdk/client-secrets-manager": "3.721.0",
|
|
50
|
+
"@aws-sdk/client-sqs": "3.721.0",
|
|
51
51
|
"@json2csv/plainjs": "7.0.6",
|
|
52
|
-
"aws-xray-sdk": "3.10.2"
|
|
52
|
+
"aws-xray-sdk": "3.10.2",
|
|
53
|
+
"uuid": "11.0.4"
|
|
53
54
|
}
|
|
54
55
|
}
|
package/src/functions.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { validate as uuidValidate } from 'uuid';
|
|
14
|
+
|
|
13
15
|
// Precompile regular expressions
|
|
14
16
|
const REGEX_ISO_DATE = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
|
15
17
|
const REGEX_TIME_OFFSET_DATE = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}(Z|[+-]\d{2}:\d{2})/;
|
|
@@ -194,6 +196,15 @@ function isValidUrl(urlString) {
|
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Validates whether the given string is a valid UUID.
|
|
201
|
+
* @param {string} uuid - The string to validate.
|
|
202
|
+
* @return {boolean} True if the given string is a valid UUID.
|
|
203
|
+
*/
|
|
204
|
+
function isValidUUID(uuid) {
|
|
205
|
+
return uuidValidate(uuid);
|
|
206
|
+
}
|
|
207
|
+
|
|
197
208
|
/**
|
|
198
209
|
* Converts a given value to a boolean. Throws an error if the value is not a boolean.
|
|
199
210
|
*
|
|
@@ -257,5 +268,6 @@ export {
|
|
|
257
268
|
isString,
|
|
258
269
|
isValidDate,
|
|
259
270
|
isValidUrl,
|
|
271
|
+
isValidUUID,
|
|
260
272
|
toBoolean,
|
|
261
273
|
};
|
package/src/index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export function toBoolean(value: unknown): boolean;
|
|
|
43
43
|
|
|
44
44
|
export function isValidUrl(urlString: string): boolean;
|
|
45
45
|
|
|
46
|
+
export function isValidUUID(uuid: string): boolean;
|
|
47
|
+
|
|
46
48
|
export function dateAfterDays(days: number, dateString: string): Date;
|
|
47
49
|
|
|
48
50
|
export function deepEqual(a: unknown, b: unknown): boolean;
|