Skip to content

Commit

Permalink
Rerun prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
marwahaha committed Feb 21, 2021
1 parent 04a46f2 commit 7ddb3a3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 44 deletions.
15 changes: 6 additions & 9 deletions src/lib/parse/regex.js
Expand Up @@ -65,15 +65,12 @@ function unescapeFormat(s) {
return regexEscape(
s
.replace('\\', '')
.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
matched,
p1,
p2,
p3,
p4
) {
return p1 || p2 || p3 || p4;
})
.replace(
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}
)
);
}

Expand Down
22 changes: 10 additions & 12 deletions src/lib/units/era.js
Expand Up @@ -24,19 +24,17 @@ addRegexToken('NNN', matchEraAbbr);
addRegexToken('NNNN', matchEraName);
addRegexToken('NNNNN', matchEraNarrow);

addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
input,
array,
config,
token
) {
var era = config._locale.erasParse(input, token, config._strict);
if (era) {
getParsingFlags(config).era = era;
} else {
getParsingFlags(config).invalidEra = input;
addParseToken(
['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
function (input, array, config, token) {
var era = config._locale.erasParse(input, token, config._strict);
if (era) {
getParsingFlags(config).era = era;
} else {
getParsingFlags(config).invalidEra = input;
}
}
});
);

addRegexToken('y', matchUnsigned);
addRegexToken('yy', matchUnsigned);
Expand Down
14 changes: 6 additions & 8 deletions src/lib/units/week-year.js
Expand Up @@ -61,14 +61,12 @@ addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);

addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
input,
week,
config,
token
) {
week[token.substr(0, 2)] = toInt(input);
});
addWeekParseToken(
['gggg', 'ggggg', 'GGGG', 'GGGGG'],
function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
}
);

addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = hooks.parseTwoDigitYear(input);
Expand Down
14 changes: 6 additions & 8 deletions src/lib/units/week.js
Expand Up @@ -28,14 +28,12 @@ addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);

addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
input,
week,
config,
token
) {
week[token.substr(0, 1)] = toInt(input);
});
addWeekParseToken(
['w', 'ww', 'W', 'WW'],
function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
}
);

// HELPERS

Expand Down
13 changes: 6 additions & 7 deletions src/locale/ka.js
Expand Up @@ -38,13 +38,12 @@ export default moment.defineLocale('ka', {
},
relativeTime: {
future: function (s) {
return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function (
$0,
$1,
$2
) {
return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
});
return s.replace(
/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,
function ($0, $1, $2) {
return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
}
);
},
past: function (s) {
if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
Expand Down

0 comments on commit 7ddb3a3

Please sign in to comment.