Skip to content

Commit

Permalink
chore: sync compiled versions after running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jan 25, 2020
1 parent 33b4446 commit e8107af
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 144 deletions.
4 changes: 2 additions & 2 deletions es/lib/alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export var alpha = {
'nn-NO': /^[A-ZÆØÅ]+$/i,
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
'ru-RU': /^[А-ЯЁ]+$/i,
'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
Expand Down Expand Up @@ -42,7 +42,7 @@ export var alphanumeric = {
'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
'ru-RU': /^[0-9А-ЯЁ]+$/i,
'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
Expand Down
2 changes: 1 addition & 1 deletion es/lib/isHexColor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assertString from './util/assertString';
var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;
var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
export default function isHexColor(str) {
assertString(str);
return hexcolor.test(str);
Expand Down
5 changes: 4 additions & 1 deletion es/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import assertString from './util/assertString';
/* eslint-disable max-len */

var phones = {
'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
Expand All @@ -24,7 +25,8 @@ var phones = {
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
Expand Down Expand Up @@ -94,6 +96,7 @@ var phones = {
phones['en-CA'] = phones['en-US'];
phones['fr-BE'] = phones['nl-BE'];
phones['zh-HK'] = phones['en-HK'];
phones['zh-MO'] = phones['en-MO'];
export default function isMobilePhone(str, locale, options) {
assertString(str);

Expand Down
2 changes: 1 addition & 1 deletion es/lib/isPostalCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ export default function (str, locale) {
}

throw new Error("Invalid locale '".concat(locale, "'"));
}
}
11 changes: 11 additions & 0 deletions es/lib/isURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import assertString from './util/assertString';
import isFQDN from './isFQDN';
import isIP from './isIP';
import merge from './util/merge';
/*
options for isURL method
require_protocol - if set as true isURL will return false if protocol is not present in the URL
require_valid_protocol - isURL will check if the URL's protocol is present in the protocols option
protocols - valid protocols can be modified with this option
require_host - if set as false isURL will not check if host is present in the URL
allow_protocol_relative_urls - if set as true protocol relative URLs will be allowed
*/

var default_url_options = {
protocols: ['http', 'https', 'ftp'],
require_tld: true,
Expand Down
4 changes: 2 additions & 2 deletions es/lib/toFloat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assertString from './util/assertString';
import isFloat from './isFloat';
export default function toFloat(str) {
assertString(str);
if (!isFloat(str)) return NaN;
return parseFloat(str);
}
4 changes: 2 additions & 2 deletions lib/alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var alpha = {
'nn-NO': /^[A-ZÆØÅ]+$/i,
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
'ru-RU': /^[А-ЯЁ]+$/i,
'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
Expand Down Expand Up @@ -49,7 +49,7 @@ var alphanumeric = {
'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
'ru-RU': /^[0-9А-ЯЁ]+$/i,
'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
Expand Down
2 changes: 1 addition & 1 deletion lib/isHexColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;
var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;

function isHexColor(str) {
(0, _assertString.default)(str);
Expand Down
5 changes: 4 additions & 1 deletion lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de

/* eslint-disable max-len */
var phones = {
'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
Expand All @@ -34,7 +35,8 @@ var phones = {
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
Expand Down Expand Up @@ -104,6 +106,7 @@ var phones = {
phones['en-CA'] = phones['en-US'];
phones['fr-BE'] = phones['nl-BE'];
phones['zh-HK'] = phones['en-HK'];
phones['zh-MO'] = phones['en-MO'];

function isMobilePhone(str, locale, options) {
(0, _assertString.default)(str);
Expand Down
2 changes: 1 addition & 1 deletion lib/isPostalCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ function _default(str, locale) {
}

throw new Error("Invalid locale '".concat(locale, "'"));
}
}
4 changes: 2 additions & 2 deletions lib/toFloat.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = toFloat;

var _assertString = _interopRequireDefault(require("./util/assertString"));
var _isFloat = _interopRequireDefault(require("./isFloat"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function toFloat(str) {
(0, _assertString.default)(str);
if (!(0, _isFloat.default)(str)) return NaN;
return parseFloat(str);
}

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
"assert"
],
"author": "Chris O'Hara <cohara87@gmail.com>",
"contributors": [{
"name": "Anthony Nandaa",
"url": "https://github.com/profnandaa"
}],
"contributors": [
{
"name": "Anthony Nandaa",
"url": "https://github.com/profnandaa"
}
],
"main": "index.js",
"bugs": {
"url": "https://github.com/chriso/validator.js/issues"
Expand Down
Loading

0 comments on commit e8107af

Please sign in to comment.