diff options
| author | ruki <waruqi@gmail.com> | 2018-11-08 00:43:05 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-11-07 22:18:30 +0800 |
| commit | 89e95b3f143682ed9a006991bacf45c9dcba4818 (patch) | |
| tree | 4f44cf41b828577d583890bdd5a1c31e8491a6ba /node_modules/url-join | |
| parent | aa7f0199255277949790b41c56e8ec97dd4f0da4 (diff) | |
| download | xmake-docs-vuepress.tar.gz xmake-docs-vuepress.zip | |
remove node_modulesvuepress
Diffstat (limited to 'node_modules/url-join')
| -rw-r--r-- | node_modules/url-join/.npmignore | 2 | ||||
| -rw-r--r-- | node_modules/url-join/.travis.yml | 5 | ||||
| -rw-r--r-- | node_modules/url-join/LICENSE | 21 | ||||
| -rw-r--r-- | node_modules/url-join/README.md | 47 | ||||
| -rw-r--r-- | node_modules/url-join/bower.json | 27 | ||||
| -rw-r--r-- | node_modules/url-join/lib/url-join.js | 77 | ||||
| -rw-r--r-- | node_modules/url-join/package.json | 23 | ||||
| -rw-r--r-- | node_modules/url-join/test/tests.js | 131 |
8 files changed, 0 insertions, 333 deletions
diff --git a/node_modules/url-join/.npmignore b/node_modules/url-join/.npmignore deleted file mode 100644 index 8ee2d2ba..00000000 --- a/node_modules/url-join/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/* -*.log
\ No newline at end of file diff --git a/node_modules/url-join/.travis.yml b/node_modules/url-join/.travis.yml deleted file mode 100644 index 7e2eb1fc..00000000 --- a/node_modules/url-join/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "5" - - "4" - - "0.12"
\ No newline at end of file diff --git a/node_modules/url-join/LICENSE b/node_modules/url-join/LICENSE deleted file mode 100644 index 4c2ef041..00000000 --- a/node_modules/url-join/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015 José F. Romaniello - -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/url-join/README.md b/node_modules/url-join/README.md deleted file mode 100644 index 13012c8d..00000000 --- a/node_modules/url-join/README.md +++ /dev/null @@ -1,47 +0,0 @@ -Join all arguments together and normalize the resulting url. - -## Install - -~~~ -npm install url-join -~~~ - -## Usage - -~~~javascript -var urljoin = require('url-join'); - -var fullUrl = urljoin('http://www.google.com', 'a', '/b/cd', '?foo=123'); - -console.log(fullUrl); - -~~~ - -Prints: - -~~~ -'http://www.google.com/a/b/cd?foo=123' -~~~ - -## Browser and AMD - -It also works in the browser, you can either include ```lib/url-join.js``` in your page: - -~~~html -<script src="url-join.js"></script> -<script type="text/javascript"> - urljoin('http://blabla.com', 'foo?a=1') -</script> -~~~ - -Or using an AMD module system like requirejs: - -~~~javascript -define(['path/url-join.js'], function (urljoin) { - urljoin('http://blabla.com', 'foo?a=1'); -}); -~~~ - -## License - -MIT diff --git a/node_modules/url-join/bower.json b/node_modules/url-join/bower.json deleted file mode 100644 index 98bd08b4..00000000 --- a/node_modules/url-join/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "url-join", - "version": "3.0.0", - "homepage": "https://github.com/jfromaniello/url-join", - "authors": [ - "José F. Romaniello <jfromaniello@gmail.com>" - ], - "description": "Join urls and normalize as in path.join.", - "main": "lib/url-join.js", - "moduleType": [ - "amd", - "globals", - "node" - ], - "keywords": [ - "url", - "join" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -}
\ No newline at end of file diff --git a/node_modules/url-join/lib/url-join.js b/node_modules/url-join/lib/url-join.js deleted file mode 100644 index ed88c8f4..00000000 --- a/node_modules/url-join/lib/url-join.js +++ /dev/null @@ -1,77 +0,0 @@ -(function (name, context, definition) { - if (typeof module !== 'undefined' && module.exports) module.exports = definition(); - else if (typeof define === 'function' && define.amd) define(definition); - else context[name] = definition(); -})('urljoin', this, function () { - - function startsWith(str, searchString) { - return str.substr(0, searchString.length) === searchString; - } - - function normalize (strArray, options) { - var resultArray = []; - - // If the first part is a plain protocol, we combine it with the next part. - if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { - var first = strArray.shift(); - strArray[0] = first + strArray[0]; - } - - // There must be two or three slashes in the file protocol, two slashes in anything else. - if (strArray[0].match(/^file:\/\/\//)) { - strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///'); - } else { - strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://'); - } - - for (var i = 0; i < strArray.length; i++) { - - var component = strArray[i]; - - if (typeof component !== 'string') { - component = component && component.toString() || ''; - } - - if (i > 0) { - // Removing the starting slashes for each component but the first. - component = component.replace(/^[\/]+/, ''); - } - if (i < strArray.length - 1) { - // Removing the ending slashes for each component but the last. - component = component.replace(/[\/]+$/, ''); - } else { - // For the last component we will combine multiple slashes to a single one. - component = component.replace(/[\/]+$/, '/'); - } - - resultArray.push(component); - - } - - var str = resultArray.join('/'); - // Each input component is now separated by a single slash except the possible first plain protocol part. - - // remove trailing slash before parameters or hash - str = str.replace(/\/(\?|&|#[^!])/g, '$1'); - - // replace ? in parameters with & - var parts = str.split('?'); - str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&'); - - return str; - } - - return function () { - var input = arguments; - var options = {}; - - if (typeof arguments[0] === 'object') { - // new syntax with array and options - input = arguments[0]; - options = arguments[1] || {}; - } - - return normalize([].slice.call(input), options); - }; - -}); diff --git a/node_modules/url-join/package.json b/node_modules/url-join/package.json deleted file mode 100644 index ee66bd40..00000000 --- a/node_modules/url-join/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "url-join", - "version": "3.0.0", - "description": "Join urls and normalize as in path.join.", - "main": "lib/url-join.js", - "scripts": { - "test": "mocha --require should" - }, - "repository": { - "type": "git", - "url": "git://github.com/jfromaniello/url-join.git" - }, - "keywords": [ - "url", - "join" - ], - "author": "José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)", - "license": "MIT", - "devDependencies": { - "mocha": "^3.2.0", - "should": "~1.2.1" - } -}
\ No newline at end of file diff --git a/node_modules/url-join/test/tests.js b/node_modules/url-join/test/tests.js deleted file mode 100644 index fd16044f..00000000 --- a/node_modules/url-join/test/tests.js +++ /dev/null @@ -1,131 +0,0 @@ -var urljoin = require('../lib/url-join'); - -describe('url join', function () { - it('should work for simple case', function () { - urljoin('http://www.google.com/', 'foo/bar', '?test=123') - .should.eql('http://www.google.com/foo/bar?test=123'); - }); - - it('should work for simple case with new syntax', function () { - urljoin(['http://www.google.com/', 'foo/bar', '?test=123']) - .should.eql('http://www.google.com/foo/bar?test=123'); - }); - - it('should work for hashbang urls', function () { - urljoin(['http://www.google.com', '#!', 'foo/bar', '?test=123']) - .should.eql('http://www.google.com/#!/foo/bar?test=123'); - }); - - it('should be able to join protocol', function () { - urljoin('http:', 'www.google.com/', 'foo/bar', '?test=123') - .should.eql('http://www.google.com/foo/bar?test=123'); - }); - - it('should be able to join protocol with slashes', function () { - urljoin('http://', 'www.google.com/', 'foo/bar', '?test=123') - .should.eql('http://www.google.com/foo/bar?test=123'); - }); - - it('should remove extra slashes', function () { - urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123') - .should.eql('http://www.google.com/foo/bar?test=123'); - }); - - it('should not remove extra slashes in an encoded URL', function () { - urljoin('http:', 'www.google.com///', 'foo/bar', '?url=http%3A//Ftest.com') - .should.eql('http://www.google.com/foo/bar?url=http%3A//Ftest.com'); - - urljoin('http://a.com/23d04b3/', '/b/c.html') - .should.eql('http://a.com/23d04b3/b/c.html') - .should.not.eql('http://a.com/23d04b3//b/c.html'); - }); - - it('should support anchors in urls', function () { - urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '#faaaaa') - .should.eql('http://www.google.com/foo/bar?test=123#faaaaa'); - }); - - it('should support protocol-relative urls', function () { - urljoin('//www.google.com', 'foo/bar', '?test=123') - .should.eql('//www.google.com/foo/bar?test=123') - }); - - it('should support file protocol urls', function () { - urljoin('file:/', 'android_asset', 'foo/bar') - .should.eql('file://android_asset/foo/bar') - - urljoin('file:', '/android_asset', 'foo/bar') - .should.eql('file://android_asset/foo/bar') - }); - - it('should support absolute file protocol urls', function () { - urljoin('file:', '///android_asset', 'foo/bar') - .should.eql('file:///android_asset/foo/bar') - - urljoin('file:///', 'android_asset', 'foo/bar') - .should.eql('file:///android_asset/foo/bar') - - urljoin('file:///', '//android_asset', 'foo/bar') - .should.eql('file:///android_asset/foo/bar') - - urljoin('file:///android_asset', 'foo/bar') - .should.eql('file:///android_asset/foo/bar') - }); - - it('should merge multiple query params properly', function () { - urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?key=456') - .should.eql('http://www.google.com/foo/bar?test=123&key=456'); - - urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?boom=value', '&key=456') - .should.eql('http://www.google.com/foo/bar?test=123&boom=value&key=456'); - - urljoin('http://example.org/x', '?a=1', '?b=2', '?c=3', '?d=4') - .should.eql('http://example.org/x?a=1&b=2&c=3&d=4'); - }); - - it('should merge slashes in paths correctly', function () { - urljoin('http://example.org', 'a//', 'b//', 'A//', 'B//') - .should.eql('http://example.org/a/b/A/B/'); - }); - - it('should merge colons in paths correctly', function () { - urljoin('http://example.org/', ':foo:', 'bar') - .should.eql('http://example.org/:foo:/bar'); - }); - - it('should merge just a simple path without URL correctly', function() { - urljoin('/', 'test') - .should.eql('/test'); - }); - - it('should merge a simple path with a number correctly', function() { - urljoin('http://blabla.com/', 1) - .should.eql('http://blabla.com/1'); - }); - - it('should merge a path with colon properly', function(){ - urljoin('/users/:userId', '/cars/:carId') - .should.eql('/users/:userId/cars/:carId'); - }); - - it('should merge slashes in protocol correctly', function () { - urljoin('http://example.org', 'a') - .should.eql('http://example.org/a'); - urljoin('http:', '//example.org', 'a') - .should.eql('http://example.org/a'); - urljoin('http:///example.org', 'a') - .should.eql('http://example.org/a'); - urljoin('file:///example.org', 'a') - .should.eql('file:///example.org/a'); - - urljoin('file:example.org', 'a') - .should.eql('file://example.org/a'); - - urljoin('file:/', 'example.org', 'a') - .should.eql('file://example.org/a'); - urljoin('file:', '/example.org', 'a') - .should.eql('file://example.org/a'); - urljoin('file:', '//example.org', 'a') - .should.eql('file://example.org/a'); - }); -}); |
