ac-sanitizer 4.0.12 → 4.0.13

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,13 @@
1
+ <a name="4.0.13"></a>
2
+
3
+ ## [4.0.13](https://github.com/mmpro/ac-sanitizer/compare/v4.0.12..v4.0.13) (2024-07-06 12:27:30)
4
+
5
+
6
+ ### Bug Fix
7
+
8
+ * **App:** Updated packages | MP | [8a05aaed9a621fd3c2de27007ece6e6235b3cae8](https://github.com/mmpro/ac-sanitizer/commit/8a05aaed9a621fd3c2de27007ece6e6235b3cae8)
9
+ Updated packages
10
+ Related issues: [undefined/undefined#master](undefined/browse/master)
1
11
  <a name="4.0.12"></a>
2
12
 
3
13
  ## [4.0.12](https://github.com/mmpro/ac-sanitizer/compare/v4.0.11..v4.0.12) (2024-06-11 10:48:11)
package/index.js CHANGED
@@ -392,9 +392,11 @@ const sanitizer = function() {
392
392
  if (!_.isArray(value)) {
393
393
  checkItem = [{ cidr: value }]
394
394
  }
395
- let check = acip.checkCIDR({ cidr: checkItem })
396
- if (check) {
397
- error = { message: fieldName + '_' + getTypeMapping(field.type, 'errorMessage'), additionalInfo: _.get(check, 'additionalInfo') }
395
+ try {
396
+ acip.checkCIDR({ cidr: checkItem })
397
+ }
398
+ catch (e) {
399
+ error = { message: fieldName + '_' + getTypeMapping(field.type, 'errorMessage') }
398
400
  }
399
401
  }
400
402
  else if (field.type === 'email') {
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": "4.0.12",
7
+ "version": "4.0.13",
8
8
  "homepage": "https://www.admiralcloud.com",
9
9
  "dependencies": {
10
10
  "ac-countrylist": "^1.0.12",
11
11
  "ac-file-extensions": "^2.0.9",
12
- "ac-ip": "^3.1.1",
12
+ "ac-ip": "^4.0.0",
13
13
  "chai": "^4.4.1",
14
14
  "date-and-time": "^3.3.0",
15
15
  "hashids": "^2.3.0",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "ac-semantic-release": "^0.4.2",
21
- "c8": "^10.0.0",
22
- "eslint": "^9.4.0",
23
- "mocha": "^10.4.0"
21
+ "c8": "^10.1.2",
22
+ "eslint": "^9.6.0",
23
+ "mocha": "^10.6.0"
24
24
  },
25
25
  "scripts": {
26
26
  "test": "mocha --reporter spec",
@@ -28,5 +28,8 @@
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=16.0.0"
31
+ },
32
+ "resolutions": {
33
+ "mocha/chokidar/braces": "3.0.3"
31
34
  }
32
35
  }
@@ -8,11 +8,11 @@ module.exports = {
8
8
  const baseTests = [
9
9
  { name: 'Valid CIDR', type: 'cidr', value: '8.8.8.8/32', expected: '8.8.8.8/32' },
10
10
  { name: 'Invalid CIDR', type: 'cidr', value: '8.8.8.8', error: 'cidr_notAValidCIDR' },
11
- { name: 'Valid CIDR array', type: 'cidr', valueType: 'cidr', value: [{ cidr: '8.8.8.8/32' }], expected: [{ cidr: '8.8.8.8/32' }] },
11
+ { name: 'Valid CIDR array ipv4', type: 'cidr', valueType: 'cidr', value: [{ cidr: '8.8.8.8/32' }], expected: [{ cidr: '8.8.8.8/32' }] },
12
12
  { name: 'Invalid CIDR array', type: 'cidr', valueType: 'cidr', value: [{ cidr: '8.8.8.8' }], error: 'cidr_notAValidCIDR' },
13
13
  // ipv6
14
- { name: 'Valid CIDR array', type: 'cidr', valueType: 'cidr', value: [{ cidr: '::ffff:127.0.0.1/32', type: 'ipv6' }], expected: [{ cidr: '::ffff:127.0.0.1/32', type: 'ipv6' }] },
15
- { name: 'Invalid CIDR array', type: 'cidr', valueType: 'cidr', value: [{ cidr: '::ffff:127.0.0.1', type: 'ipv6' }], error: 'cidr_notAValidCIDR' },
14
+ { name: 'Valid CIDR array ipv6', type: 'cidr', valueType: 'cidr', value: [{ cidr: '2001:4d20::/32' }], expected: [{ cidr: '2001:4d20::/32' }] },
15
+ { name: 'Invalid CIDR array', type: 'cidr', valueType: 'cidr', value: [{ cidr: '::ffff:127.0.0.1' }], error: 'cidr_notAValidCIDR' },
16
16
  ]
17
17
 
18
18