From dcdd9303a8bb8c4cc85f214926ee00754609c3b9 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Thu, 2 Jun 2022 17:50:02 +0300 Subject: [PATCH] refactor: lint --- src/cldr/currency.js | 2 +- src/dates/parse-date.js | 2 +- src/format.js | 2 +- src/numbers/custom-number-format.js | 2 +- src/numbers/parse-number.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cldr/currency.js b/src/cldr/currency.js index fe26d1fe..fab71fce 100644 --- a/src/cldr/currency.js +++ b/src/cldr/currency.js @@ -114,7 +114,7 @@ export function currencyDisplay(locale, options) { if (currencyDisplay === SYMBOL) { result = currencyInfo["symbol-alt-narrow"] || currencyInfo[SYMBOL]; } else { - if (typeof value === undefined || value !== 1) { + if (typeof value === "undefined" || value !== 1) { result = currencyInfo["displayName-count-other"]; } else { result = currencyInfo["displayName-count-one"]; diff --git a/src/dates/parse-date.js b/src/dates/parse-date.js index a2763a26..7a2ea9d4 100644 --- a/src/dates/parse-date.js +++ b/src/dates/parse-date.js @@ -7,7 +7,7 @@ import datePattern from './date-pattern'; import round from '../common/round'; import isDate from '../common/is-date'; -const timeZoneOffsetRegExp = /([+|\-]\d{1,2})(:?)(\d{2})?/; +const timeZoneOffsetRegExp = /([+|-]\d{1,2})(:?)(\d{2})?/; const dateRegExp = /^\/Date\((.*?)\)\/$/; const offsetRegExp = /[+-]\d*/; const numberRegExp = { diff --git a/src/format.js b/src/format.js index 25459801..2ec8a29f 100644 --- a/src/format.js +++ b/src/format.js @@ -4,7 +4,7 @@ import { EMPTY } from './common/constants'; import isDate from './common/is-date'; import isNumber from './common/is-number'; -const formatRegExp = /\{(\d+)(:[^\}]+)?\}/g; +const formatRegExp = /\{(\d+)(:[^}]+)?\}/g; export function toString(value, format, locale) { if (format) { diff --git a/src/numbers/custom-number-format.js b/src/numbers/custom-number-format.js index 2343b160..6ade8871 100644 --- a/src/numbers/custom-number-format.js +++ b/src/numbers/custom-number-format.js @@ -9,7 +9,7 @@ const ZERO = "0"; const trailingZerosRegExp = /(\.(?:[0-9]*[1-9])?)0+$/g; const trailingPointRegExp = /\.$/; -const commaRegExp = /\,/g; +const commaRegExp = /,/g; function trimTrailingZeros(value, lastZero) { let trimRegex; diff --git a/src/numbers/parse-number.js b/src/numbers/parse-number.js index 99c97a10..9fe00bff 100644 --- a/src/numbers/parse-number.js +++ b/src/numbers/parse-number.js @@ -6,7 +6,7 @@ import isCurrencyStyle from './is-currency-style'; import formatOptions from './format-options'; import isString from '../common/is-string'; -const exponentRegExp = /[eE][\-+]?[0-9]+/; +const exponentRegExp = /[eE][-+]?[0-9]+/; const nonBreakingSpaceRegExp = /\u00A0/g; function cleanNegativePattern(number, patterns) {