Merge pull request #1102 from ParsePlatform/flovilmart.vendorCoverage
Ignores uncovered mongodbURL
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
"flow-bin": "^0.22.0",
|
"flow-bin": "^0.22.0",
|
||||||
"gaze": "^0.5.2",
|
"gaze": "^0.5.2",
|
||||||
"jasmine": "^2.3.2",
|
"jasmine": "^2.3.2",
|
||||||
"mongodb-runner": "^3.1.15",
|
"mongodb-runner": "3.1.15",
|
||||||
"nodemon": "^1.8.1"
|
"nodemon": "^1.8.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
13
src/vendor/mongodbUrl.js
vendored
13
src/vendor/mongodbUrl.js
vendored
@@ -66,6 +66,7 @@ const slashedProtocol = {
|
|||||||
};
|
};
|
||||||
const querystring = require('querystring');
|
const querystring = require('querystring');
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
||||||
if (url instanceof Url) return url;
|
if (url instanceof Url) return url;
|
||||||
|
|
||||||
@@ -74,6 +75,7 @@ function urlParse(url, parseQueryString, slashesDenoteHost) {
|
|||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
||||||
if (typeof url !== 'string') {
|
if (typeof url !== 'string') {
|
||||||
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
|
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
|
||||||
@@ -394,6 +396,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function validateHostname(self, rest, hostname) {
|
function validateHostname(self, rest, hostname) {
|
||||||
for (var i = 0, lastPos; i <= hostname.length; ++i) {
|
for (var i = 0, lastPos; i <= hostname.length; ++i) {
|
||||||
var code;
|
var code;
|
||||||
@@ -429,6 +432,7 @@ function validateHostname(self, rest, hostname) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function autoEscapeStr(rest) {
|
function autoEscapeStr(rest) {
|
||||||
var newRest = '';
|
var newRest = '';
|
||||||
var lastPos = 0;
|
var lastPos = 0;
|
||||||
@@ -531,6 +535,7 @@ function autoEscapeStr(rest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// format a parsed object into a url string
|
// format a parsed object into a url string
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function urlFormat(obj) {
|
function urlFormat(obj) {
|
||||||
// ensure it's an object, and not a string url.
|
// ensure it's an object, and not a string url.
|
||||||
// If it's an obj, this is a no-op.
|
// If it's an obj, this is a no-op.
|
||||||
@@ -547,6 +552,7 @@ function urlFormat(obj) {
|
|||||||
return obj.format();
|
return obj.format();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
Url.prototype.format = function() {
|
Url.prototype.format = function() {
|
||||||
var auth = this.auth || '';
|
var auth = this.auth || '';
|
||||||
if (auth) {
|
if (auth) {
|
||||||
@@ -623,19 +629,23 @@ Url.prototype.format = function() {
|
|||||||
return protocol + host + pathname + search + hash;
|
return protocol + host + pathname + search + hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function urlResolve(source, relative) {
|
function urlResolve(source, relative) {
|
||||||
return urlParse(source, false, true).resolve(relative);
|
return urlParse(source, false, true).resolve(relative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
Url.prototype.resolve = function(relative) {
|
Url.prototype.resolve = function(relative) {
|
||||||
return this.resolveObject(urlParse(relative, false, true)).format();
|
return this.resolveObject(urlParse(relative, false, true)).format();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function urlResolveObject(source, relative) {
|
function urlResolveObject(source, relative) {
|
||||||
if (!source) return relative;
|
if (!source) return relative;
|
||||||
return urlParse(source, false, true).resolveObject(relative);
|
return urlParse(source, false, true).resolveObject(relative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
Url.prototype.resolveObject = function(relative) {
|
Url.prototype.resolveObject = function(relative) {
|
||||||
if (typeof relative === 'string') {
|
if (typeof relative === 'string') {
|
||||||
var rel = new Url();
|
var rel = new Url();
|
||||||
@@ -908,6 +918,7 @@ Url.prototype.resolveObject = function(relative) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
Url.prototype.parseHost = function() {
|
Url.prototype.parseHost = function() {
|
||||||
var host = this.host;
|
var host = this.host;
|
||||||
var port = portPattern.exec(host);
|
var port = portPattern.exec(host);
|
||||||
@@ -922,6 +933,7 @@ Url.prototype.parseHost = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// About 1.5x faster than the two-arg version of Array#splice().
|
// About 1.5x faster than the two-arg version of Array#splice().
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function spliceOne(list, index) {
|
function spliceOne(list, index) {
|
||||||
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
|
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
|
||||||
list[i] = list[k];
|
list[i] = list[k];
|
||||||
@@ -931,6 +943,7 @@ function spliceOne(list, index) {
|
|||||||
var hexTable = new Array(256);
|
var hexTable = new Array(256);
|
||||||
for (var i = 0; i < 256; ++i)
|
for (var i = 0; i < 256; ++i)
|
||||||
hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
|
hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
|
||||||
|
/* istanbul ignore next: improve coverage */
|
||||||
function encodeAuth(str) {
|
function encodeAuth(str) {
|
||||||
// faster encodeURIComponent alternative for encoding auth uri components
|
// faster encodeURIComponent alternative for encoding auth uri components
|
||||||
var out = '';
|
var out = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user