This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -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));
}
}

View File

@@ -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);
}