Socket
Socket
Sign inDemoInstall

isurl

Package Overview
Dependencies
1
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha2 to 1.0.0-alpha3

29

index.js
"use strict";
const isObject = require("is-object");
const toString = Object.prototype.toString;

@@ -8,22 +9,20 @@

{
// Speed optimization
if (url == null) return false;
// Native implementation
if (toString.call(url) === "[object URL]") return true;
if (typeof url !== "object") return false;
if (isObject(url) === false) return false;
if (!("href" in url)) return false;
if (!("protocol" in url)) return false;
if (!("username" in url)) return false;
if (!("password" in url)) return false;
if (!("hostname" in url)) return false;
if (!("port" in url)) return false;
if (!("host" in url)) return false;
if (!("pathname" in url)) return false;
if (!("search" in url)) return false;
if (!("hash" in url)) return false;
if (!("href" in url)) return false;
if (!("protocol" in url)) return false;
if (!("username" in url)) return false;
if (!("password" in url)) return false;
if (!("hostname" in url)) return false;
if (!("port" in url)) return false;
if (!("host" in url)) return false;
if (!("pathname" in url)) return false;
if (!("search" in url)) return false;
//if (!("searchParams" in url)) return false;
if (!("hash" in url)) return false;
// Polyfill implementation
// Shimmed implementation
return true;

@@ -30,0 +29,0 @@ }

{
"name": "isurl",
"description": "Checks whether a value is a WHATWG URL.",
"version": "1.0.0-alpha2",
"version": "1.0.0-alpha3",
"license": "MIT",
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)",
"repository": "stevenvachon/isurl",
"dependencies": {
"is-object": "^1.0.1"
},
"devDependencies": {
"chai": "^3.5.0",
"isomorphic-url": "^1.0.0-alpha7",
"isomorphic-url": "^1.0.0-alpha12",
"mocha": "^3.2.0"

@@ -19,5 +22,3 @@ },

},
"files": [
"index.js"
],
"files": ["index.js"],
"keywords": [

@@ -24,0 +25,0 @@ "uri",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc