is-image-url
Advanced tools
Comparing version 1.1.2 to 1.1.3
10
index.js
@@ -9,7 +9,11 @@ var request = require('sync-request'); | ||
if (!isUrl(url)) return isImage(url); | ||
var http = url.lastIndexOf('http'); | ||
if (http == -1) return false; | ||
url = url.substring(http); | ||
var pathname = urlParse(url).pathname; | ||
if (!pathname) return false; | ||
if (isImage(pathname.split(':')[0])) { | ||
return true; | ||
} | ||
var last = pathname.search(/[:?&]/); | ||
if (last != -1) | ||
pathname = pathname.substring(0, last); | ||
if (isImage(pathname)) return true; | ||
try { | ||
@@ -16,0 +20,0 @@ if (!accurate) return false; |
{ | ||
"name": "is-image-url", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Check if a url is an image", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
4624
28