is-url-superb
Advanced tools
+20
| /** | ||
| Check if a string is a URL. | ||
| @example | ||
| ``` | ||
| import isUrl = require('is-url-superb'); | ||
| isUrl('https://sindresorhus.com'); | ||
| //=> true | ||
| isUrl('//sindresorhus.com'); | ||
| //=> true | ||
| isUrl('unicorn'); | ||
| //=> false | ||
| ``` | ||
| */ | ||
| declare function isUrl(url: string): boolean; | ||
| export = isUrl; |
+2
-2
| 'use strict'; | ||
| var urlRegex = require('url-regex')({exact: true}); | ||
| const urlRegex = require('url-regex')({exact: true}); | ||
| module.exports = function (url) { | ||
| module.exports = url => { | ||
| if (typeof url !== 'string') { | ||
@@ -6,0 +6,0 @@ throw new TypeError('Expected a string'); |
+36
-33
| { | ||
| "name": "is-url-superb", | ||
| "version": "2.0.0", | ||
| "description": "Check if a string is an URL", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/is-url-superb", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "http://sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=0.10.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "node test.js" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "url", | ||
| "uri", | ||
| "string", | ||
| "validate", | ||
| "check", | ||
| "is" | ||
| ], | ||
| "dependencies": { | ||
| "url-regex": "^3.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "0.0.4" | ||
| } | ||
| "name": "is-url-superb", | ||
| "version": "3.0.0", | ||
| "description": "Check if a string is a URL", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/is-url-superb", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=8" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava && tsd" | ||
| }, | ||
| "files": [ | ||
| "index.js", | ||
| "index.d.ts" | ||
| ], | ||
| "keywords": [ | ||
| "url", | ||
| "uri", | ||
| "string", | ||
| "validate", | ||
| "check", | ||
| "is" | ||
| ], | ||
| "dependencies": { | ||
| "url-regex": "^5.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "^1.4.1", | ||
| "tsd": "^0.7.2", | ||
| "xo": "^0.24.0" | ||
| } | ||
| } |
+7
-7
| # is-url-superb [](https://travis-ci.org/sindresorhus/is-url-superb) | ||
| > Check if a string is an URL | ||
| > Check if a string is a URL | ||
@@ -10,5 +10,5 @@ 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). | ||
| ```sh | ||
| $ npm install --save is-url-superb | ||
| ``` | ||
| $ npm install is-url-superb | ||
| ``` | ||
@@ -19,8 +19,8 @@ | ||
| ```js | ||
| var isUrl = require('is-url-superb'); | ||
| const isUrl = require('is-url-superb'); | ||
| isUrl('http://todomvc.com'); | ||
| isUrl('https://sindresorhus.com'); | ||
| //=> true | ||
| isUrl('//todomvc.com'); | ||
| isUrl('//sindresorhus.com'); | ||
| //=> true | ||
@@ -35,2 +35,2 @@ | ||
| MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
| MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2857
10.01%5
25%23
187.5%0
-100%3
200%2
100%+ Added
+ Added
+ Added
- Removed
- Removed
Updated