node_modules: update

This commit is contained in:
Dawid Dziurla 2020-07-25 12:21:44 +02:00
parent c4ea5b96e9
commit 7c68f31a28
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
30 changed files with 673 additions and 856 deletions

View file

@ -120,11 +120,11 @@ function extractIANAZone(match, cursor) {
// ISO duration parsing
const isoDuration = /^P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
const isoDuration = /^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;
function extractISODuration(match) {
const [
,
s,
yearStr,
monthStr,
weekStr,
@ -135,16 +135,20 @@ function extractISODuration(match) {
millisecondsStr
] = match;
const hasNegativePrefix = s[0] === "-";
const maybeNegate = num => (num && hasNegativePrefix ? -num : num);
return [
{
years: parseInteger(yearStr),
months: parseInteger(monthStr),
weeks: parseInteger(weekStr),
days: parseInteger(dayStr),
hours: parseInteger(hourStr),
minutes: parseInteger(minuteStr),
seconds: parseInteger(secondStr),
milliseconds: parseMillis(millisecondsStr)
years: maybeNegate(parseInteger(yearStr)),
months: maybeNegate(parseInteger(monthStr)),
weeks: maybeNegate(parseInteger(weekStr)),
days: maybeNegate(parseInteger(dayStr)),
hours: maybeNegate(parseInteger(hourStr)),
minutes: maybeNegate(parseInteger(minuteStr)),
seconds: maybeNegate(parseInteger(secondStr)),
milliseconds: maybeNegate(parseMillis(millisecondsStr))
}
];
}