ac-sanitizer 5.1.0 → 5.1.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,21 @@
1
+
2
+ ## [5.1.2](https://github.com/mmpro/ac-sanitizer/compare/v5.1.1..v5.1.2) (2025-09-19 05:13:36)
3
+
4
+
5
+ ### Bug Fix
6
+
7
+ * **Misc:** Package updates | MP | [b276d6b5e6d07bbfa99a0673037b093678bb8fe1](https://github.com/mmpro/ac-sanitizer/commit/b276d6b5e6d07bbfa99a0673037b093678bb8fe1)
8
+ Package updates
9
+ Related issues:
10
+
11
+ ## [5.1.1](https://github.com/mmpro/ac-sanitizer/compare/v5.1.0..v5.1.1) (2025-09-10 13:15:18)
12
+
13
+
14
+ ### Bug Fix
15
+
16
+ * **App:** Fixed error handling for UUID | MP | [c743db90d23e58513d0e785dbf8fc982ee041f9a](https://github.com/mmpro/ac-sanitizer/commit/c743db90d23e58513d0e785dbf8fc982ee041f9a)
17
+ Check that value is a string before checking for valid UUID
18
+ Related issues:
1
19
 
2
20
  # [5.1.0](https://github.com/mmpro/ac-sanitizer/compare/v5.0.1..v5.1.0) (2025-09-10 10:32:21)
3
21
 
package/index.js CHANGED
@@ -472,7 +472,8 @@ const sanitizer = function() {
472
472
  }
473
473
  else if (field.type === 'uuid') {
474
474
  const uuidVersion = _.get(field, 'uuidVersion', 4)
475
- if (!validator.isUUID(value, uuidVersion)) error = { message: fieldName + '_' + getTypeMapping(field.type, 'errorMessage'), additionalInfo: { uuidVersion } }
475
+ if (!_.isString(value)) error = { message: fieldName + '_' + getTypeMapping(field.type, 'errorMessage') }
476
+ else if (!validator.isUUID(value, uuidVersion)) error = { message: fieldName + '_' + getTypeMapping(field.type, 'errorMessage'), additionalInfo: { uuidVersion } }
476
477
  }
477
478
  else if (field.type === 'gps') {
478
479
  // test value for a combination of LAT, LNG and optional third, comma-separated distance value (as number)
package/package.json CHANGED
@@ -4,12 +4,12 @@
4
4
  "author": "Mark Poepping (https://www.admiralcloud.com)",
5
5
  "license": "MIT",
6
6
  "repository": "admiralcloud/ac-sanitizer",
7
- "version": "5.1.0",
7
+ "version": "5.1.2",
8
8
  "homepage": "https://www.admiralcloud.com",
9
9
  "dependencies": {
10
10
  "ac-countrylist": "^1.0.14",
11
- "ac-file-extensions": "^2.0.11",
12
- "ac-ip": "^4.1.4",
11
+ "ac-file-extensions": "^2.0.13",
12
+ "ac-ip": "^4.1.5",
13
13
  "chai": "^4.5.0",
14
14
  "date-and-time": "^3.6.0",
15
15
  "hashids": "^2.3.0",
@@ -17,7 +17,7 @@
17
17
  "validator": "^13.15.15"
18
18
  },
19
19
  "devDependencies": {
20
- "ac-semantic-release": "^0.4.7",
20
+ "ac-semantic-release": "^0.4.8",
21
21
  "c8": "^10.1.3",
22
22
  "eslint": "^9.35.0",
23
23
  "mocha": "^11.7.2"
@@ -6,7 +6,8 @@ module.exports = {
6
6
 
7
7
  const baseTests = [
8
8
  { name: 'Valid uuid', type: 'uuid', value: '4479f5d2-7c57-4300-bf4b-342ad5a40dc7', expected: '4479f5d2-7c57-4300-bf4b-342ad5a40dc7' },
9
- { name: 'Invalid - uuid is integer', type: 'uuid', value: '123', error: 'uuid_notAValidUUID' },
9
+ { name: 'Invalid - uuid is integer as string', type: 'uuid', value: '123', error: 'uuid_notAValidUUID' },
10
+ { name: 'Invalid - uuid is integer as number', type: 'uuid', value: 123, error: 'uuid_notAValidUUID' },
10
11
  ]
11
12
 
12
13
  runValidationTests(baseTests, 'uuid')