@coveo/bueno
Advanced tools
Comparing version 1.0.5 to 1.0.6-pre.e48646b42a
@@ -163,3 +163,2 @@ /** | ||
// src/values/string-value.ts | ||
var urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i; | ||
var ISODateStringRegex = /^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i; | ||
@@ -192,4 +191,8 @@ var StringValue = class { | ||
} | ||
if (url && !urlRegex.test(value)) { | ||
return "value is not a valid URL."; | ||
if (url) { | ||
try { | ||
new URL(value); | ||
} catch (e) { | ||
return "value is not a valid URL."; | ||
} | ||
} | ||
@@ -196,0 +199,0 @@ if (regex && !regex.test(value)) { |
@@ -206,3 +206,2 @@ /** | ||
// src/values/string-value.ts | ||
var urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i; | ||
var ISODateStringRegex = /^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i; | ||
@@ -235,4 +234,8 @@ var StringValue = class { | ||
} | ||
if (url && !urlRegex.test(value)) { | ||
return "value is not a valid URL."; | ||
if (url) { | ||
try { | ||
new URL(value); | ||
} catch (e) { | ||
return "value is not a valid URL."; | ||
} | ||
} | ||
@@ -239,0 +242,0 @@ if (regex && !regex.test(value)) { |
@@ -163,3 +163,2 @@ /** | ||
// src/values/string-value.ts | ||
var urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i; | ||
var ISODateStringRegex = /^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i; | ||
@@ -192,4 +191,8 @@ var StringValue = class { | ||
} | ||
if (url && !urlRegex.test(value)) { | ||
return "value is not a valid URL."; | ||
if (url) { | ||
try { | ||
new URL(value); | ||
} catch (e) { | ||
return "value is not a valid URL."; | ||
} | ||
} | ||
@@ -196,0 +199,0 @@ if (regex && !regex.test(value)) { |
@@ -206,3 +206,2 @@ /** | ||
// src/values/string-value.ts | ||
var urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i; | ||
var ISODateStringRegex = /^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i; | ||
@@ -235,4 +234,8 @@ var StringValue = class { | ||
} | ||
if (url && !urlRegex.test(value)) { | ||
return "value is not a valid URL."; | ||
if (url) { | ||
try { | ||
new URL(value); | ||
} catch (e) { | ||
return "value is not a valid URL."; | ||
} | ||
} | ||
@@ -239,0 +242,0 @@ if (regex && !regex.test(value)) { |
@@ -16,3 +16,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "1.0.5", | ||
"version": "1.0.6-pre.e48646b42a", | ||
"files": [ | ||
@@ -19,0 +19,0 @@ "dist/" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1678
59939
2