Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-url-superb

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-url-superb - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

12

index.js
'use strict';
const urlRegex = require('url-regex')({exact: true});
module.exports = url => {
if (typeof url !== 'string') {
module.exports = string => {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
return urlRegex.test(url.trim());
try {
new URL(string); // eslint-disable-line no-new
return true;
} catch {
return false;
}
};
{
"name": "is-url-superb",
"version": "3.0.0",
"version": "4.0.0",
"description": "Check if a string is a URL",
"license": "MIT",
"repository": "sindresorhus/is-url-superb",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -30,10 +31,7 @@ "scripts": {

],
"dependencies": {
"url-regex": "^5.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^2.4.0",
"tsd": "^0.11.0",
"xo": "^0.32.0"
}
}

@@ -1,8 +0,5 @@

# is-url-superb [![Build Status](https://travis-ci.org/sindresorhus/is-url-superb.svg?branch=master)](https://travis-ci.org/sindresorhus/is-url-superb)
# is-url-superb [![Build Status](https://travis-ci.com/sindresorhus/is-url-superb.svg?branch=master)](https://travis-ci.com/github/sindresorhus/is-url-superb)
> Check if a string is a URL
Created because the [`is-url`](https://github.com/segmentio/is-url) module is too loose. This module depends on a much more comprehensive [regex](https://github.com/kevva/url-regex).
## Install

@@ -14,3 +11,2 @@

## Usage

@@ -24,5 +20,2 @@

isUrl('//sindresorhus.com');
//=> true
isUrl('unicorn');

@@ -32,5 +25,4 @@ //=> false

## Related
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
- [is](https://github.com/sindresorhus/is) - Type check values

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc