web-component-gallery 2.1.7 → 2.1.8
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/dist/index.umd.js +1 -1
- package/dist/js.umd.js +1 -1
- package/package.json +1 -1
- package/utils/Validate.js +3 -3
package/package.json
CHANGED
package/utils/Validate.js
CHANGED
|
@@ -17,9 +17,9 @@ export const verifyCDN = /^\/\/at\.alicdn\.com\/t\/[cf]\/font_\d+_[a-z0-9]+\.js$
|
|
|
17
17
|
* @returns {boolean}
|
|
18
18
|
*/
|
|
19
19
|
export function verifyIPStr(url) {
|
|
20
|
-
const domainReg = /^https:\/\/[a-z0-9.-]+\.[a-z]{2,}(?:\/[^\s]*)?$/i
|
|
21
|
-
const ipv4Reg = /^
|
|
22
|
-
const ipv6Reg = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
|
|
20
|
+
const domainReg = /^https:\/\/[a-z0-9.-]+\.[a-z]{2,}(?:\/[^\s]*)?$/i
|
|
21
|
+
const ipv4Reg = /^https?:\/\/((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3})(:\d{1,5})?(\/.*)?$/
|
|
22
|
+
const ipv6Reg = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/
|
|
23
23
|
|
|
24
24
|
if (domainReg.test(url) || ipv4Reg.test(url) || ipv6Reg.test(url)) return true
|
|
25
25
|
return false
|