node_modules: update
This commit is contained in:
parent
c4ea5b96e9
commit
7c68f31a28
30 changed files with 673 additions and 856 deletions
24
node_modules/luxon/src/impl/regexParser.js
generated
vendored
24
node_modules/luxon/src/impl/regexParser.js
generated
vendored
|
@ -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))
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue