Cleanup
This commit is contained in:
17
node_modules/validator/lib/util/assertString.js
generated
vendored
17
node_modules/validator/lib/util/assertString.js
generated
vendored
@@ -11,21 +11,10 @@ function assertString(input) {
|
||||
var isString = typeof input === 'string' || input instanceof String;
|
||||
|
||||
if (!isString) {
|
||||
var invalidType;
|
||||
var invalidType = _typeof(input);
|
||||
|
||||
if (input === null) {
|
||||
invalidType = 'null';
|
||||
} else {
|
||||
invalidType = _typeof(input);
|
||||
|
||||
if (invalidType === 'object' && input.constructor && input.constructor.hasOwnProperty('name')) {
|
||||
invalidType = input.constructor.name;
|
||||
} else {
|
||||
invalidType = "a ".concat(invalidType);
|
||||
}
|
||||
}
|
||||
|
||||
throw new TypeError("Expected string but received ".concat(invalidType, "."));
|
||||
if (input === null) invalidType = 'null';else if (invalidType === 'object') invalidType = input.constructor.name;
|
||||
throw new TypeError("Expected a string but received a ".concat(invalidType));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
node_modules/validator/lib/util/multilineRegex.js
generated
vendored
3
node_modules/validator/lib/util/multilineRegex.js
generated
vendored
@@ -13,8 +13,7 @@ exports.default = multilineRegexp;
|
||||
* @param {string} flags
|
||||
* @return {object} - RegExp object
|
||||
*/
|
||||
function multilineRegexp(parts) {
|
||||
var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||
function multilineRegexp(parts, flags) {
|
||||
var regexpAsStringLiteral = parts.join('');
|
||||
return new RegExp(regexpAsStringLiteral, flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user