Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always add default property #961

Merged
merged 2 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
["@babel/preset-env", {"targets": {"node": "0.10"}}]
],
"plugins": [
"add-module-exports"
[
"add-module-exports",
{
"addDefaultProperty": true
}
]
]
}
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,5 @@ var validator = {
};
var _default = validator;
exports.default = _default;
module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ function blacklist(str, chars) {
return str.replace(new RegExp("[".concat(chars, "]+"), 'g'), '');
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/contains.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function contains(str, elem) {
return str.indexOf((0, _toString.default)(elem)) >= 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ function equals(str, comparison) {
return str === comparison;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ function escape(str) {
return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\//g, '&#x2F;').replace(/\\/g, '&#x5C;').replace(/`/g, '&#96;');
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isAfter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ function isAfter(str) {
return !!(original && comparison && original > comparison);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isAscii.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ function isAscii(str) {
return ascii.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isBase64.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ function isBase64(str) {
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isBefore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ function isBefore(str) {
return !!(original && comparison && original < comparison);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isBoolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ function isBoolean(str) {
return ['true', 'false', '1', '0'].indexOf(str) >= 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isByteLength.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ function isByteLength(str, options) {
return len >= min && (typeof max === 'undefined' || len <= max);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isCreditCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ function isCreditCard(str) {
return !!(sum % 10 === 0 ? sanitized : false);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isCurrency.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ function isCurrency(str, options) {
return currencyRegex(options).test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isDataURI.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ function isDataURI(str) {
return true;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isDecimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ function isDecimal(str, options) {
throw new Error("Invalid locale '".concat(options.locale, "'"));
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isDivisibleBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isDivisibleBy(str, num) {
return (0, _toFloat.default)(str) % parseInt(num, 10) === 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ function isEmail(str, options) {
return true;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isEmpty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ function isEmpty(str, options) {
return (options.ignore_whitespace ? str.trim().length : str.length) === 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isFQDN.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ function isFQDN(str, options) {
return true;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isHash.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ function isHash(str, algorithm) {
return hash.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isHexColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isHexColor(str) {
return hexcolor.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isHexadecimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isHexadecimal(str) {
return hexadecimal.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isIP.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ function isIP(str) {
return false;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isIPRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ function isIPRange(str) {
return (0, _isIP.default)(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISBN.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ function isISBN(str) {
return false;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISIN.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ function isISIN(str) {
return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISO31661Alpha2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ function isISO31661Alpha2(str) {
return (0, _includes.default)(validISO31661Alpha2CountriesCodes, str.toUpperCase());
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISO31661Alpha3.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ function isISO31661Alpha3(str) {
return (0, _includes.default)(validISO31661Alpha3CountriesCodes, str.toUpperCase());
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISO8601.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ function isISO8601(str, options) {
return check;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISRC.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ function isISRC(str) {
return isrc.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isISSN.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ function isISSN(str) {
return checksum % 11 === 0;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isIdentityCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ function isIdentityCard(str) {
throw new Error("Invalid locale '".concat(locale, "'"));
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ function isIn(str, options) {
return false;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ function isInt(str, options) {
return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ function isJSON(str) {
return false;
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isJWT.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isJWT(str) {
return jwt.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isLatLong.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ function _default(str) {
return lat.test(pair[0]) && long.test(pair[1]);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isLength.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ function isLength(str, options) {
return len >= min && (typeof max === 'undefined' || len <= max);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isLowercase.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ function isLowercase(str) {
return str === str.toLowerCase();
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isMACAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ function isMACAddress(str, options) {
return macAddress.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isMD5.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isMD5(str) {
return md5.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isMagnetURI.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ function isMagnetURI(url) {
return magnetURI.test(url.trim());
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
3 changes: 2 additions & 1 deletion lib/isMimeType.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ function isMimeType(str) {
return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
}

module.exports = exports.default;
module.exports = exports.default;
module.exports.default = exports.default;
Loading