node_modules: update

This commit is contained in:
Dawid Dziurla 2020-11-12 16:37:43 +01:00
parent 4a21c51f2f
commit b91baffed3
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
107 changed files with 3886 additions and 2943 deletions

29
node_modules/luxon/src/datetime.js generated vendored
View file

@ -122,22 +122,23 @@ function objToTS(obj, offset, zone) {
// create a new DT instance by adding a duration, adjusting for DSTs
function adjustTime(inst, dur) {
const keys = Object.keys(dur.values);
if (keys.indexOf("milliseconds") === -1) {
keys.push("milliseconds");
}
dur = dur.shiftTo(...keys);
const oPre = inst.o,
year = inst.c.year + dur.years,
month = inst.c.month + dur.months + dur.quarters * 3,
year = inst.c.year + Math.trunc(dur.years),
month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,
c = Object.assign({}, inst.c, {
year,
month,
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
day:
Math.min(inst.c.day, daysInMonth(year, month)) +
Math.trunc(dur.days) +
Math.trunc(dur.weeks) * 7
}),
millisToAdd = Duration.fromObject({
years: dur.years - Math.trunc(dur.years),
quarters: dur.quarters - Math.trunc(dur.quarters),
months: dur.months - Math.trunc(dur.months),
weeks: dur.weeks - Math.trunc(dur.weeks),
days: dur.days - Math.trunc(dur.days),
hours: dur.hours,
minutes: dur.minutes,
seconds: dur.seconds,
@ -1943,6 +1944,14 @@ export default class DateTime {
return Formats.DATE_MED;
}
/**
* {@link toLocaleString} format like 'Fri, Oct 14, 1983'
* @type {Object}
*/
static get DATE_MED_WITH_WEEKDAY() {
return Formats.DATE_MED_WITH_WEEKDAY;
}
/**
* {@link toLocaleString} format like 'October 14, 1983'
* @type {Object}

5
node_modules/luxon/src/duration.js generated vendored
View file

@ -37,6 +37,7 @@ const lowOrderMatrix = {
casualMatrix = Object.assign(
{
years: {
quarters: 4,
months: 12,
weeks: 52,
days: 365,
@ -51,6 +52,7 @@ const lowOrderMatrix = {
days: 91,
hours: 91 * 24,
minutes: 91 * 24 * 60,
seconds: 91 * 24 * 60 * 60,
milliseconds: 91 * 24 * 60 * 60 * 1000
},
months: {
@ -69,6 +71,7 @@ const lowOrderMatrix = {
accurateMatrix = Object.assign(
{
years: {
quarters: 4,
months: 12,
weeks: daysInYearAccurate / 7,
days: daysInYearAccurate,
@ -588,8 +591,6 @@ export default class Duration {
vals = this.toObject();
let lastUnit;
normalizeValues(this.matrix, vals);
for (const k of orderedUnits) {
if (units.indexOf(k) >= 0) {
lastUnit = k;

View file

@ -187,6 +187,8 @@ export function formatString(knownFormat) {
return "M/d/yyyy";
case stringify(Formats.DATE_MED):
return "LLL d, yyyy";
case stringify(Formats.DATE_MED_WITH_WEEKDAY):
return "EEE, LLL d, yyyy";
case stringify(Formats.DATE_FULL):
return "LLLL d, yyyy";
case stringify(Formats.DATE_HUGE):

View file

@ -18,6 +18,13 @@ export const DATE_MED = {
day: n
};
export const DATE_MED_WITH_WEEKDAY = {
year: n,
month: s,
day: n,
weekday: s
};
export const DATE_FULL = {
year: n,
month: l,

View file

@ -66,7 +66,7 @@ function simpleParse(...keys) {
// ISO and SQL parsing
const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,
isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,
isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${offsetRegex.source}?`),
isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`),
isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,
@ -120,7 +120,7 @@ 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,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
function extractISODuration(match) {
const [

View file

@ -12,13 +12,21 @@ function intUnit(regex, post = i => i) {
return { regex, deser: ([s]) => post(parseDigits(s)) };
}
const NBSP = String.fromCharCode(160);
const spaceOrNBSP = `( |${NBSP})`;
const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
function fixListRegex(s) {
// make dots optional and also make them literal
return s.replace(/\./, "\\.?");
// make space and non breakable space characters interchangeable
return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
}
function stripInsensitivities(s) {
return s.replace(/\./, "").toLowerCase();
return s
.replace(/\./g, "") // ignore dots that were made optional
.replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp
.toLowerCase();
}
function oneOf(strings, startIndex) {

13
node_modules/luxon/src/impl/util.js generated vendored
View file

@ -263,18 +263,17 @@ export function normalizeObject(obj, normalizer, nonUnitKeys) {
}
export function formatOffset(offset, format) {
const hours = Math.trunc(offset / 60),
minutes = Math.abs(offset % 60),
sign = hours >= 0 && !Object.is(hours, -0) ? "+" : "-",
base = `${sign}${Math.abs(hours)}`;
const hours = Math.trunc(Math.abs(offset / 60)),
minutes = Math.trunc(Math.abs(offset % 60)),
sign = offset >= 0 ? "+" : "-";
switch (format) {
case "short":
return `${sign}${padStart(Math.abs(hours), 2)}:${padStart(minutes, 2)}`;
return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
case "narrow":
return minutes > 0 ? `${base}:${minutes}` : base;
return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
case "techie":
return `${sign}${padStart(Math.abs(hours), 2)}${padStart(minutes, 2)}`;
return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
default:
throw new RangeError(`Value format ${format} is out of range for property format`);
}

4
node_modules/luxon/src/info.js generated vendored
View file

@ -95,7 +95,7 @@ export default class Info {
/**
* Return an array of standalone week names.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system
@ -114,7 +114,7 @@ export default class Info {
* Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that
* changes the string.
* See {@link weekdays}
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
* @param {Object} opts - options
* @param {string} [opts.locale=null] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system

27
node_modules/luxon/src/interval.js generated vendored
View file

@ -31,7 +31,7 @@ function validateStartEnd(start, end) {
* * **Accessors** Use {@link start} and {@link end} to get the start and end.
* * **Interrogation** To analyze the Interval, use {@link count}, {@link length}, {@link hasSame}, {@link contains}, {@link isAfter}, or {@link isBefore}.
* * **Transformation** To create other Intervals out of this one, use {@link set}, {@link splitAt}, {@link splitBy}, {@link divideEqually}, {@link merge}, {@link xor}, {@link union}, {@link intersection}, or {@link difference}.
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}
* * **Comparison** To compare this Interval to another one, use {@link equals}, {@link overlaps}, {@link abutsStart}, {@link abutsEnd}, {@link engulfs}.
* * **Output** To convert the Interval into other representations, see {@link toString}, {@link toISO}, {@link toISODate}, {@link toISOTime}, {@link toFormat}, and {@link toDuration}.
*/
export default class Interval {
@ -134,19 +134,32 @@ export default class Interval {
static fromISO(text, opts) {
const [s, e] = (text || "").split("/", 2);
if (s && e) {
const start = DateTime.fromISO(s, opts),
end = DateTime.fromISO(e, opts);
let start, startIsValid;
try {
start = DateTime.fromISO(s, opts);
startIsValid = start.isValid;
} catch (e) {
startIsValid = false;
}
if (start.isValid && end.isValid) {
let end, endIsValid;
try {
end = DateTime.fromISO(e, opts);
endIsValid = end.isValid;
} catch (e) {
endIsValid = false;
}
if (startIsValid && endIsValid) {
return Interval.fromDateTimes(start, end);
}
if (start.isValid) {
if (startIsValid) {
const dur = Duration.fromISO(e, opts);
if (dur.isValid) {
return Interval.after(start, dur);
}
} else if (end.isValid) {
} else if (endIsValid) {
const dur = Duration.fromISO(s, opts);
if (dur.isValid) {
return Interval.before(end, dur);
@ -234,7 +247,7 @@ export default class Interval {
* @return {boolean}
*/
hasSame(unit) {
return this.isValid ? this.e.minus(1).hasSame(this.s, unit) : false;
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
}
/**