aboutsummaryrefslogtreecommitdiff
path: root/node_modules/is-absolute-url
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/is-absolute-url')
-rw-r--r--node_modules/is-absolute-url/index.js8
-rw-r--r--node_modules/is-absolute-url/license21
-rw-r--r--node_modules/is-absolute-url/package.json32
-rw-r--r--node_modules/is-absolute-url/readme.md36
4 files changed, 97 insertions, 0 deletions
diff --git a/node_modules/is-absolute-url/index.js b/node_modules/is-absolute-url/index.js
new file mode 100644
index 00000000..06b28161
--- /dev/null
+++ b/node_modules/is-absolute-url/index.js
@@ -0,0 +1,8 @@
+'use strict';
+module.exports = function (url) {
+ if (typeof url !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ return /^[a-z][a-z0-9+.-]*:/.test(url);
+};
diff --git a/node_modules/is-absolute-url/license b/node_modules/is-absolute-url/license
new file mode 100644
index 00000000..654d0bfe
--- /dev/null
+++ b/node_modules/is-absolute-url/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/is-absolute-url/package.json b/node_modules/is-absolute-url/package.json
new file mode 100644
index 00000000..9208b287
--- /dev/null
+++ b/node_modules/is-absolute-url/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "is-absolute-url",
+ "version": "2.1.0",
+ "description": "Check if an URL is absolute",
+ "license": "MIT",
+ "repository": "sindresorhus/is-absolute-url",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "url",
+ "absolute",
+ "relative",
+ "uri",
+ "is",
+ "check"
+ ],
+ "devDependencies": {
+ "mocha": "*"
+ }
+}
diff --git a/node_modules/is-absolute-url/readme.md b/node_modules/is-absolute-url/readme.md
new file mode 100644
index 00000000..59472b97
--- /dev/null
+++ b/node_modules/is-absolute-url/readme.md
@@ -0,0 +1,36 @@
+# is-absolute-url [![Build Status](https://travis-ci.org/sindresorhus/is-absolute-url.svg?branch=master)](https://travis-ci.org/sindresorhus/is-absolute-url)
+
+> Check if an URL is absolute
+
+
+## Install
+
+```sh
+$ npm install --save is-absolute-url
+```
+
+
+## Usage
+
+```js
+var isAbsoluteUrl = require('is-absolute-url');
+
+isAbsoluteUrl('http://sindresorhus.com/foo/bar');
+//=> true
+
+isAbsoluteUrl('//sindresorhus.com');
+//=> false
+
+isAbsoluteUrl('foo/bar');
+//=> false
+```
+
+
+## Related
+
+See [is-relative-url](https://github.com/sindresorhus/is-relative-url) for the inverse.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)