Skip to content

Commit

Permalink
Update eslint and fix new violations
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jun 22, 2017
1 parent 8f2b0ac commit 468a35f
Show file tree
Hide file tree
Showing 19 changed files with 2,707 additions and 2,531 deletions.
6 changes: 3 additions & 3 deletions lib/escape.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.default = escape;

Expand All @@ -12,7 +12,7 @@ var _assertString2 = _interopRequireDefault(_assertString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function escape(str) {
(0, _assertString2.default)(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;');
(0, _assertString2.default)(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'];
5 changes: 1 addition & 4 deletions lib/isCurrency.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ function currencyRegex(options) {
}
}

/* eslint-disable prefer-template */
return new RegExp('^' +
// ensure there's a dollar and/or decimal amount, and that
// it doesn't start with a space or a negative sign followed by a space
'(?!-? )(?=.*\\d)' + pattern + '$');
/* eslint-enable prefer-template */
return new RegExp('^(?!-? )(?=.*\\d)' + pattern + '$');
}

var default_currency_options = {
Expand Down
2 changes: 1 addition & 1 deletion lib/isFQDN.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function isFDQN(str, options) {
if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) {
return false;
}
// disallow full-width chars
if (/[\uff01-\uff5e]/.test(part)) {
// disallow full-width chars
return false;
}
if (part[0] === '-' || part[part.length - 1] === '-') {
Expand Down
3 changes: 2 additions & 1 deletion lib/isURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ function isURL(url, options) {
}
hostname = split.join('@');

port_str = ipv6 = null;
port_str = null;
ipv6 = null;
var ipv6_match = hostname.match(wrapped_ipv6);
if (ipv6_match) {
host = '';
Expand Down
6 changes: 3 additions & 3 deletions lib/unescape.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.default = unescape;

Expand All @@ -12,7 +12,7 @@ var _assertString2 = _interopRequireDefault(_assertString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function unescape(str) {
(0, _assertString2.default)(str);
return str.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#x2F;/g, '/').replace(/&#96;/g, '`');
(0, _assertString2.default)(str);
return str.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#x2F;/g, '/').replace(/&#96;/g, '`');
}
module.exports = exports['default'];
Loading

0 comments on commit 468a35f

Please sign in to comment.