Cleanup
This commit is contained in:
17
node_modules/validator/es/lib/util/assertString.js
generated
vendored
17
node_modules/validator/es/lib/util/assertString.js
generated
vendored
@@ -4,20 +4,9 @@ export default 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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user