mirror of
https://github.com/arnaucube/socketioMEANseed.git
synced 2026-02-07 19:56:46 +01:00
init
This commit is contained in:
2
www/node_modules/url-join/.npmignore
generated
vendored
Normal file
2
www/node_modules/url-join/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules/*
|
||||
*.log
|
||||
5
www/node_modules/url-join/.travis.yml
generated
vendored
Normal file
5
www/node_modules/url-join/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "5"
|
||||
- "4"
|
||||
- "0.12"
|
||||
47
www/node_modules/url-join/README.md
generated
vendored
Normal file
47
www/node_modules/url-join/README.md
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
22
www/node_modules/url-join/bower.json
generated
vendored
Normal file
22
www/node_modules/url-join/bower.json
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "url-join",
|
||||
"version": "1.0.0",
|
||||
"homepage": "https://github.com/jfromaniello/url-join",
|
||||
"authors": [
|
||||
"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)"
|
||||
],
|
||||
"description": "Join urls and normalize as in path.join.",
|
||||
"main": "lib/url-join.js",
|
||||
"keywords": [
|
||||
"url",
|
||||
"join"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
38
www/node_modules/url-join/lib/url-join.js
generated
vendored
Normal file
38
www/node_modules/url-join/lib/url-join.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
(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 normalize (str, options) {
|
||||
|
||||
// make sure protocol is followed by two slashes
|
||||
str = str.replace(/:\//g, '://');
|
||||
|
||||
// remove consecutive slashes
|
||||
str = str.replace(/([^:\s])\/+/g, '$1/');
|
||||
|
||||
// remove trailing slash before parameters or hash
|
||||
str = str.replace(/\/(\?|&|#[^!])/g, '$1');
|
||||
|
||||
// replace ? in parameters with &
|
||||
str = str.replace(/(\?.+)\?/g, '$1&');
|
||||
|
||||
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] || {};
|
||||
}
|
||||
|
||||
var joined = [].slice.call(input, 0).join('/');
|
||||
return normalize(joined, options);
|
||||
};
|
||||
|
||||
});
|
||||
92
www/node_modules/url-join/package.json
generated
vendored
Normal file
92
www/node_modules/url-join/package.json
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "url-join@^1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "url-join",
|
||||
"name": "url-join",
|
||||
"rawSpec": "^1.0.0",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/home/nau/MEGA/CODI/githubRepos/colspace/www/node_modules/ecstatic"
|
||||
]
|
||||
],
|
||||
"_from": "url-join@>=1.0.0 <2.0.0",
|
||||
"_id": "url-join@1.1.0",
|
||||
"_inCache": true,
|
||||
"_location": "/url-join",
|
||||
"_nodeVersion": "4.4.2",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/url-join-1.1.0.tgz_1459856865965_0.46360294660553336"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "jfromaniello",
|
||||
"email": "jfromaniello@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.15.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "url-join@^1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "url-join",
|
||||
"name": "url-join",
|
||||
"rawSpec": "^1.0.0",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ecstatic"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz",
|
||||
"_shasum": "741c6c2f4596c4830d6718460920d0c92202dc78",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "url-join@^1.0.0",
|
||||
"_where": "/home/nau/MEGA/CODI/githubRepos/colspace/www/node_modules/ecstatic",
|
||||
"author": {
|
||||
"name": "José F. Romaniello",
|
||||
"email": "jfromaniello@gmail.com",
|
||||
"url": "http://joseoncode.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jfromaniello/url-join/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Join urls and normalize as in path.join.",
|
||||
"devDependencies": {
|
||||
"mocha": "~1.8.1",
|
||||
"should": "~1.2.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "741c6c2f4596c4830d6718460920d0c92202dc78",
|
||||
"tarball": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz"
|
||||
},
|
||||
"gitHead": "3144ba1acbfcee988d6abb3b2be1df532f0e151c",
|
||||
"homepage": "https://github.com/jfromaniello/url-join#readme",
|
||||
"keywords": [
|
||||
"url",
|
||||
"join"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/url-join.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jfromaniello",
|
||||
"email": "jfromaniello@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "url-join",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jfromaniello/url-join.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --require should"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
51
www/node_modules/url-join/test/tests.js
generated
vendored
Normal file
51
www/node_modules/url-join/test/tests.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
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 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 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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user