Comparing version 2.5.0 to 2.5.2
{ | ||
"name": "luxon", | ||
"version": "2.5.0", | ||
"version": "2.5.2", | ||
"description": "Immutable date wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Cambron", |
@@ -8,3 +8,3 @@ import { | ||
isUndefined, | ||
parseFloating, | ||
parseFloating | ||
} from "./util.js"; | ||
@@ -31,3 +31,3 @@ import * as English from "./english.js"; | ||
function combineExtractors(...extractors) { | ||
return (m) => | ||
return m => | ||
extractors | ||
@@ -96,3 +96,3 @@ .reduce( | ||
month: int(match, cursor + 1, 1), | ||
day: int(match, cursor + 2, 1), | ||
day: int(match, cursor + 2, 1) | ||
}; | ||
@@ -108,3 +108,3 @@ | ||
seconds: int(match, cursor + 2, 0), | ||
milliseconds: parseMillis(match[cursor + 3]), | ||
milliseconds: parseMillis(match[cursor + 3]) | ||
}; | ||
@@ -133,8 +133,16 @@ | ||
const isoDuration = | ||
/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; | ||
const isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; | ||
function extractISODuration(match) { | ||
const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = | ||
match; | ||
const [ | ||
s, | ||
yearStr, | ||
monthStr, | ||
weekStr, | ||
dayStr, | ||
hourStr, | ||
minuteStr, | ||
secondStr, | ||
millisecondsStr | ||
] = match; | ||
@@ -156,4 +164,4 @@ const hasNegativePrefix = s[0] === "-"; | ||
seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), | ||
milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds), | ||
}, | ||
milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) | ||
} | ||
]; | ||
@@ -174,3 +182,3 @@ } | ||
PDT: -7 * 60, | ||
PST: -8 * 60, | ||
PST: -8 * 60 | ||
}; | ||
@@ -184,3 +192,3 @@ | ||
hour: parseInteger(hourStr), | ||
minute: parseInteger(minuteStr), | ||
minute: parseInteger(minuteStr) | ||
}; | ||
@@ -200,4 +208,3 @@ | ||
// RFC 2822/5322 | ||
const rfc2822 = | ||
/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; | ||
const rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; | ||
@@ -217,3 +224,3 @@ function extractRFC2822(match) { | ||
offHourStr, | ||
offMinuteStr, | ||
offMinuteStr | ||
] = match, | ||
@@ -237,3 +244,3 @@ result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); | ||
return s | ||
.replace(/\([^)]*\)|[\n\t]/g, " ") | ||
.replace(/\([^()]*\)|[\n\t]/g, " ") | ||
.replace(/(\s\s+)/g, " ") | ||
@@ -245,8 +252,5 @@ .trim(); | ||
const rfc1123 = | ||
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, | ||
rfc850 = | ||
/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, | ||
ascii = | ||
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; | ||
const rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, | ||
rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, | ||
ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; | ||
@@ -253,0 +257,0 @@ function extractRFC1123Or850(match) { |
@@ -12,3 +12,3 @@ import DateTime from "./datetime.js"; | ||
const VERSION = "2.5.0"; | ||
const VERSION = "2.5.2"; | ||
@@ -15,0 +15,0 @@ export { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3871360
41045