not-node 6.5.59 → 6.5.61
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/package.json
CHANGED
|
@@ -2,7 +2,14 @@ module.exports = [
|
|
|
2
2
|
...require("./string"),
|
|
3
3
|
{
|
|
4
4
|
validator(val, { validator }) {
|
|
5
|
-
|
|
5
|
+
if (val.indexOf(",") > -1) {
|
|
6
|
+
return val
|
|
7
|
+
.split(",")
|
|
8
|
+
.map((ip) => ip.trim())
|
|
9
|
+
.every((ip) => validator.isIP(ip));
|
|
10
|
+
} else {
|
|
11
|
+
return validator.isIP(val);
|
|
12
|
+
}
|
|
6
13
|
},
|
|
7
14
|
message: "not-node:value_is_not_ip_address",
|
|
8
15
|
},
|
package/test/core.validators.js
CHANGED
|
@@ -675,7 +675,12 @@ describe("Core Validators", () => {
|
|
|
675
675
|
});
|
|
676
676
|
});
|
|
677
677
|
|
|
678
|
-
const listOfValidValues = [
|
|
678
|
+
const listOfValidValues = [
|
|
679
|
+
"127.0.1.1",
|
|
680
|
+
"10.8.1.10",
|
|
681
|
+
"0.0.0.0",
|
|
682
|
+
"123.1.1.4, 192.123.4.1",
|
|
683
|
+
];
|
|
679
684
|
listOfValidValues.forEach((val) => {
|
|
680
685
|
it(
|
|
681
686
|
"valid: " + val,
|