@fedify/relay 2.4.0-dev.1668 → 2.4.0-dev.1740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/litepub.test.js +1 -1
- package/dist/mastodon.test.js +1 -1
- package/dist/mod.cjs +108 -102
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/{types-CNX8Y335.js → types-CKf6hRcx.js} +195 -357
- package/package.json +4 -4
package/dist/litepub.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-
|
|
4
|
+
import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-CKf6hRcx.js";
|
|
5
5
|
import { MemoryKvStore, signRequest } from "@fedify/fedify";
|
|
6
6
|
import { createRelay } from "@fedify/relay";
|
|
7
7
|
import { Accept, Announce, Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
|
package/dist/mastodon.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-
|
|
4
|
+
import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-CKf6hRcx.js";
|
|
5
5
|
import { MemoryKvStore, signRequest } from "@fedify/fedify";
|
|
6
6
|
import { createRelay } from "@fedify/relay";
|
|
7
7
|
import { Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
|
package/dist/mod.cjs
CHANGED
|
@@ -245,7 +245,7 @@ function parseInt0(s) {
|
|
|
245
245
|
function padNumber(digits, num) {
|
|
246
246
|
return String(num).padStart(digits, "0");
|
|
247
247
|
}
|
|
248
|
-
const padNumber2 =
|
|
248
|
+
const padNumber2 = /*@__PURE__*/ bindArgs(padNumber, 2);
|
|
249
249
|
function compareNumbers(a, b) {
|
|
250
250
|
return Math.sign(a - b);
|
|
251
251
|
}
|
|
@@ -313,7 +313,7 @@ const unitNameMap = {
|
|
|
313
313
|
month: 8,
|
|
314
314
|
year: 9
|
|
315
315
|
};
|
|
316
|
-
const unitNamesAsc =
|
|
316
|
+
const unitNamesAsc = /*@__PURE__*/ Object.keys(unitNameMap);
|
|
317
317
|
const nanoInMicro = nanoInMicro$1;
|
|
318
318
|
const nanoInMilli = nanoInMilli$1;
|
|
319
319
|
const nanoInSec = nanoInSec$1;
|
|
@@ -329,19 +329,19 @@ const unitNanoMap = [
|
|
|
329
329
|
nanoInHour,
|
|
330
330
|
nanoInUtcDay
|
|
331
331
|
];
|
|
332
|
-
const bigNanoInMicro =
|
|
333
|
-
const bigNanoInMilli =
|
|
334
|
-
const bigNanoInSec =
|
|
335
|
-
const bigNanoInMinute =
|
|
336
|
-
const bigNanoInHour =
|
|
337
|
-
const bigNanoInUtcDay =
|
|
332
|
+
const bigNanoInMicro = /*@__PURE__*/ BigInt(nanoInMicro);
|
|
333
|
+
const bigNanoInMilli = /*@__PURE__*/ BigInt(nanoInMilli);
|
|
334
|
+
const bigNanoInSec = /*@__PURE__*/ BigInt(nanoInSec);
|
|
335
|
+
const bigNanoInMinute = /*@__PURE__*/ BigInt(nanoInMinute);
|
|
336
|
+
const bigNanoInHour = /*@__PURE__*/ BigInt(nanoInHour);
|
|
337
|
+
const bigNanoInUtcDay = /*@__PURE__*/ BigInt(nanoInUtcDay);
|
|
338
338
|
function divideBigNanoToExactNumber(bigNano, divisorNano) {
|
|
339
339
|
const days = Number(bigNano / bigNanoInUtcDay);
|
|
340
340
|
const timeNano = Number(bigNano % bigNanoInUtcDay);
|
|
341
341
|
return days * (nanoInUtcDay / divisorNano) + (Math.trunc(timeNano / divisorNano) + timeNano % divisorNano / divisorNano);
|
|
342
342
|
}
|
|
343
|
-
const timeFieldNamesAsc =
|
|
344
|
-
const timeGetters =
|
|
343
|
+
const timeFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.slice(0, 6);
|
|
344
|
+
const timeGetters = /*@__PURE__*/ createPropGetters(timeFieldNamesAsc);
|
|
345
345
|
const yearFieldNamesAsc = ["year"];
|
|
346
346
|
const dayFieldNamesAsc = ["day"];
|
|
347
347
|
const calendarDateFieldNamesAsc = [
|
|
@@ -363,24 +363,24 @@ const monthDayFieldNames = [
|
|
|
363
363
|
"month",
|
|
364
364
|
"monthCode"
|
|
365
365
|
];
|
|
366
|
-
const timeFieldNamesAlpha =
|
|
367
|
-
const yearFieldNamesWithEraAlpha =
|
|
368
|
-
const yearMonthFieldNamesAlpha =
|
|
369
|
-
const yearMonthFieldNamesWithEraAlpha =
|
|
370
|
-
const yearMonthCodeFieldNamesAlpha =
|
|
371
|
-
const yearMonthCodeFieldNamesWithEraAlpha =
|
|
372
|
-
const monthCodeDayFieldNamesAlpha =
|
|
373
|
-
const dateFieldNamesAlpha =
|
|
374
|
-
const dateFieldNamesWithEraAlpha =
|
|
375
|
-
const dateTimeFieldNamesAlpha =
|
|
376
|
-
const dateTimeFieldNamesWithEraAlpha =
|
|
377
|
-
const dateTimeAndOffsetFieldNamesAlpha =
|
|
378
|
-
const dateTimeAndOffsetFieldNamesWithEraAlpha =
|
|
379
|
-
const dateTimeAndZoneFieldNamesAlpha =
|
|
380
|
-
const dateTimeAndZoneFieldNamesWithEraAlpha =
|
|
381
|
-
const yearMonthCodeDayFieldNamesAlpha =
|
|
382
|
-
const yearMonthCodeDayFieldNamesWithEraAlpha =
|
|
383
|
-
const timeFieldDefaults =
|
|
366
|
+
const timeFieldNamesAlpha = /*@__PURE__*/ sortStrings(timeFieldNamesAsc);
|
|
367
|
+
const yearFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearFieldNamesAsc);
|
|
368
|
+
const yearMonthFieldNamesAlpha = /*@__PURE__*/ sortStrings(monthFieldNames, yearFieldNamesAsc);
|
|
369
|
+
const yearMonthFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthFieldNamesAlpha);
|
|
370
|
+
const yearMonthCodeFieldNamesAlpha = /*@__PURE__*/ sortStrings(["monthCode"], yearFieldNamesAsc);
|
|
371
|
+
const yearMonthCodeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthCodeFieldNamesAlpha);
|
|
372
|
+
const monthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, ["monthCode"]);
|
|
373
|
+
const dateFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthFieldNamesAlpha);
|
|
374
|
+
const dateFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthFieldNamesAlpha);
|
|
375
|
+
const dateTimeFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc);
|
|
376
|
+
const dateTimeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc);
|
|
377
|
+
const dateTimeAndOffsetFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames);
|
|
378
|
+
const dateTimeAndOffsetFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames);
|
|
379
|
+
const dateTimeAndZoneFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);
|
|
380
|
+
const dateTimeAndZoneFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);
|
|
381
|
+
const yearMonthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthCodeFieldNamesAlpha);
|
|
382
|
+
const yearMonthCodeDayFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthCodeFieldNamesAlpha);
|
|
383
|
+
const timeFieldDefaults = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, 0);
|
|
384
384
|
function validateTimeFields(timeFields) {
|
|
385
385
|
return constrainTimeFields(timeFields, 1), timeFields;
|
|
386
386
|
}
|
|
@@ -609,20 +609,20 @@ function computeCalendarWeekOfYear(calendar, isoDate) {
|
|
|
609
609
|
function computeCalendarYearOfWeek(calendar, isoDate) {
|
|
610
610
|
return calendar === void 0 ? computeIsoWeekFields(isoDate).yearOfWeek : void 0;
|
|
611
611
|
}
|
|
612
|
-
const durationFieldNamesAsc =
|
|
613
|
-
const durationGetters =
|
|
614
|
-
const durationFieldNamesAlpha =
|
|
615
|
-
const durationTimeFieldNamesAsc =
|
|
616
|
-
const durationDateFieldNamesAsc =
|
|
617
|
-
const durationCalendarFieldNamesAsc =
|
|
618
|
-
const durationFieldIndexes =
|
|
619
|
-
const durationFieldDefaults =
|
|
620
|
-
const durationTimeFieldDefaults =
|
|
621
|
-
const clearDurationFields =
|
|
612
|
+
const durationFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.map((unitName) => unitName + "s");
|
|
613
|
+
const durationGetters = /*@__PURE__*/ createPropGetters(durationFieldNamesAsc);
|
|
614
|
+
const durationFieldNamesAlpha = /*@__PURE__*/ sortStrings(durationFieldNamesAsc);
|
|
615
|
+
const durationTimeFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(0, 6);
|
|
616
|
+
const durationDateFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(6);
|
|
617
|
+
const durationCalendarFieldNamesAsc = /*@__PURE__*/ durationDateFieldNamesAsc.slice(1);
|
|
618
|
+
const durationFieldIndexes = /*@__PURE__*/ durationFieldNamesAsc.reduce((indexes, fieldName, i) => (indexes[fieldName] = i, indexes), {});
|
|
619
|
+
const durationFieldDefaults = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, 0);
|
|
620
|
+
const durationTimeFieldDefaults = /*@__PURE__*/ zipPropsConst(durationTimeFieldNamesAsc, 0);
|
|
621
|
+
const clearDurationFields = /*@__PURE__*/ bindArgs(zeroOutProps, durationFieldNamesAsc);
|
|
622
622
|
function requirePropDefined(optionName, optionVal) {
|
|
623
623
|
return optionVal ?? throwRangeError(missingField(optionName)), optionVal;
|
|
624
624
|
}
|
|
625
|
-
const requireString =
|
|
625
|
+
const requireString = /*@__PURE__*/ bindArgs(requireType, "string");
|
|
626
626
|
function requireType(typeName, arg, entityName = typeName) {
|
|
627
627
|
return typeof arg !== typeName && throwTypeError(invalidEntity(entityName, arg)), arg;
|
|
628
628
|
}
|
|
@@ -734,17 +734,17 @@ function coerceChoiceOption(optionName, enumNameMap, options, defaultChoice = 0)
|
|
|
734
734
|
const enumNum = enumNameMap[enumStr];
|
|
735
735
|
return void 0 === enumNum && throwRangeError(invalidChoice(optionName, enumStr, enumNameMap)), enumNum;
|
|
736
736
|
}
|
|
737
|
-
const coerceSmallestUnit =
|
|
738
|
-
const coerceLargestUnit =
|
|
739
|
-
const coerceTotalUnit =
|
|
740
|
-
const coerceOverflow =
|
|
741
|
-
const coerceEpochDisambig =
|
|
742
|
-
const coerceOffsetDisambig =
|
|
743
|
-
const coerceCalendarDisplay =
|
|
744
|
-
const coerceTimeZoneDisplay =
|
|
745
|
-
const coerceOffsetDisplay =
|
|
746
|
-
const coerceRoundingMode =
|
|
747
|
-
const coerceDirection =
|
|
737
|
+
const coerceSmallestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, smallestUnitStr);
|
|
738
|
+
const coerceLargestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, "largestUnit");
|
|
739
|
+
const coerceTotalUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, "unit");
|
|
740
|
+
const coerceOverflow = /*@__PURE__*/ bindArgs(coerceChoiceOption, "overflow", overflowMap);
|
|
741
|
+
const coerceEpochDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, "disambiguation", epochDisambigMap);
|
|
742
|
+
const coerceOffsetDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, "offset", offsetDisambigMap);
|
|
743
|
+
const coerceCalendarDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, "calendarName", calendarDisplayMap);
|
|
744
|
+
const coerceTimeZoneDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, "timeZoneName", timeZoneDisplayMap);
|
|
745
|
+
const coerceOffsetDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, "offset", offsetDisplayMap);
|
|
746
|
+
const coerceRoundingMode = /*@__PURE__*/ bindArgs(coerceChoiceOption, "roundingMode", roundingModeMap);
|
|
747
|
+
const coerceDirection = /*@__PURE__*/ bindArgs(coerceChoiceOption, "direction", directionMap);
|
|
748
748
|
function validateRoundingInc(roundingInc, smallestUnit, allowManyLargeUnits, solarMode) {
|
|
749
749
|
const upUnitNano = solarMode ? nanoInUtcDay : unitNanoMap[smallestUnit + 1];
|
|
750
750
|
if (upUnitNano) {
|
|
@@ -798,8 +798,8 @@ function refineZonedFieldOptions(options, defaultOffsetDisambig = 0) {
|
|
|
798
798
|
epochDisambig
|
|
799
799
|
];
|
|
800
800
|
}
|
|
801
|
-
const epochNanoMax =
|
|
802
|
-
const epochNanoMin =
|
|
801
|
+
const epochNanoMax = /*@__PURE__*/ BigInt(1e8) * bigNanoInUtcDay;
|
|
802
|
+
const epochNanoMin = /*@__PURE__*/ BigInt(-1e8) * bigNanoInUtcDay;
|
|
803
803
|
const plainDateEpochNanoMin = epochNanoMin - bigNanoInUtcDay;
|
|
804
804
|
const isoYearMonthIndexMin = -3261848;
|
|
805
805
|
function checkIsoYearMonthInBounds(isoDate) {
|
|
@@ -1070,11 +1070,12 @@ function nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit,
|
|
|
1070
1070
|
}
|
|
1071
1071
|
function getTimeZoneTransitionEpochNanoseconds(slots, options) {
|
|
1072
1072
|
return slots.timeZone.U(slots.epochNanoseconds, ((options) => {
|
|
1073
|
-
const
|
|
1073
|
+
const normalizedOptions = normalizeOptionsOrString(options, "direction");
|
|
1074
|
+
const res = coerceDirection(normalizedOptions, 0);
|
|
1074
1075
|
return res || throwRangeError(invalidEntity("direction", res)), res;
|
|
1075
1076
|
})(options));
|
|
1076
1077
|
}
|
|
1077
|
-
const zonedEpochSlotsToIso =
|
|
1078
|
+
const zonedEpochSlotsToIso = /*@__PURE__*/ memoize(_zonedEpochSlotsToIso, WeakMap);
|
|
1078
1079
|
function _zonedEpochSlotsToIso(slots) {
|
|
1079
1080
|
const { epochNanoseconds, timeZone } = slots;
|
|
1080
1081
|
const offsetNanoseconds = timeZone.C(epochNanoseconds);
|
|
@@ -1640,7 +1641,7 @@ function resolveTimeFields(fields, overflow) {
|
|
|
1640
1641
|
...fields
|
|
1641
1642
|
}), overflow);
|
|
1642
1643
|
}
|
|
1643
|
-
const offsetRegExp =
|
|
1644
|
+
const offsetRegExp = /*@__PURE__*/ createRegExp("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");
|
|
1644
1645
|
function parseOffsetNano(s) {
|
|
1645
1646
|
const offsetNano = parseOffsetNanoMaybe(s);
|
|
1646
1647
|
return void 0 === offsetNano && throwRangeError(failedParse(s)), offsetNano;
|
|
@@ -1675,13 +1676,13 @@ const dateFieldRefiners = {
|
|
|
1675
1676
|
},
|
|
1676
1677
|
day: toPositiveIntegerWithTruncation
|
|
1677
1678
|
};
|
|
1678
|
-
const timeFieldRefiners =
|
|
1679
|
-
const durationFieldRefiners =
|
|
1679
|
+
const timeFieldRefiners = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, toIntegerWithTrunc);
|
|
1680
|
+
const durationFieldRefiners = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, toStrictInteger);
|
|
1680
1681
|
const offsetFieldRefiners = { offset(offsetString) {
|
|
1681
1682
|
return parseOffsetNano(toStringViaPrimitive(offsetString));
|
|
1682
1683
|
} };
|
|
1683
|
-
const dateTimeFieldRefiners =
|
|
1684
|
-
const zonedDateTimeFieldRefiners =
|
|
1684
|
+
const dateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateFieldRefiners, timeFieldRefiners);
|
|
1685
|
+
const zonedDateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateTimeFieldRefiners, offsetFieldRefiners);
|
|
1685
1686
|
function readAndRefineBagFields(bag, validFieldNames, fieldRefiners, requiredFieldNames, disallowEmpty = !requiredFieldNames) {
|
|
1686
1687
|
const res = {};
|
|
1687
1688
|
let anyMatching = 0;
|
|
@@ -1784,7 +1785,9 @@ const timeZonePeriodDaysByName = {
|
|
|
1784
1785
|
const minPossibleTransitionSec = -388152e4;
|
|
1785
1786
|
function refineTimeDisplayTuple(options, maxSmallestUnit = 4) {
|
|
1786
1787
|
const subsecDigits = coerceFractionalSecondDigits(options);
|
|
1787
|
-
|
|
1788
|
+
const roundingMode = coerceRoundingMode(options, 4);
|
|
1789
|
+
const smallestUnit = coerceSmallestUnit(options);
|
|
1790
|
+
return [roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, maxSmallestUnit), subsecDigits)];
|
|
1788
1791
|
}
|
|
1789
1792
|
function refineDateDisplayOptions(options) {
|
|
1790
1793
|
return coerceCalendarDisplay(normalizeOptions(options));
|
|
@@ -1959,15 +1962,17 @@ function resolveTimeZoneRecord(rawId) {
|
|
|
1959
1962
|
kind: "fixed",
|
|
1960
1963
|
...offsetRecord
|
|
1961
1964
|
};
|
|
1962
|
-
|
|
1965
|
+
const normId = "UTC" === upperRawId ? "UTC" : ((rawId) => (badCharactersRegExp.test(rawId) && throwRangeError(invalidTimeZone(rawId)), icuRegExp.test(rawId) && throwRangeError("Forbidden ICU TimeZone"), rawId.toLowerCase().split("/").map((part, partI) => (part.length <= 3 || /\d/.test(part)) && !/etc|yap/.test(part) ? part.toUpperCase() : part.replace(/baja|dumont|[a-z]+/g, (a, i) => a.length <= 2 && !partI || "in" === a || "chat" === a ? a.toUpperCase() : a.length > 2 || !i ? capitalize(a).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : a)).join("/")))(rawId);
|
|
1966
|
+
return queryNamedTimeZoneRecord(normId);
|
|
1963
1967
|
}
|
|
1964
|
-
const queryNamedTimeZoneRecord =
|
|
1968
|
+
const queryNamedTimeZoneRecord = /*@__PURE__*/ memoize((normId) => {
|
|
1965
1969
|
if ("UTC" === normId) return {
|
|
1966
1970
|
kind: "utc",
|
|
1967
1971
|
id: normId,
|
|
1968
1972
|
o: normId
|
|
1969
1973
|
};
|
|
1970
|
-
const
|
|
1974
|
+
const upperNormId = normId.toUpperCase();
|
|
1975
|
+
const format = queryTimeZoneIntlFormat(upperNormId);
|
|
1971
1976
|
return {
|
|
1972
1977
|
kind: "named",
|
|
1973
1978
|
id: normId,
|
|
@@ -1975,7 +1980,7 @@ const queryNamedTimeZoneRecord = /* @__PURE__ */ memoize((normId) => {
|
|
|
1975
1980
|
o: format.resolvedOptions().timeZone
|
|
1976
1981
|
};
|
|
1977
1982
|
});
|
|
1978
|
-
const queryTimeZoneIntlFormat =
|
|
1983
|
+
const queryTimeZoneIntlFormat = /*@__PURE__*/ memoize((upperNormId) => new RawDateTimeFormat("en-u-hc-h23", {
|
|
1979
1984
|
calendar: "iso8601",
|
|
1980
1985
|
timeZone: upperNormId,
|
|
1981
1986
|
era: "short",
|
|
@@ -1990,7 +1995,7 @@ function queryTimeZone(rawTimeZoneId) {
|
|
|
1990
1995
|
const record = resolveTimeZoneRecord(rawTimeZoneId);
|
|
1991
1996
|
return queryTimeZoneRecord(record.id, record);
|
|
1992
1997
|
}
|
|
1993
|
-
const queryTimeZoneRecord =
|
|
1998
|
+
const queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => "named" === record.kind ? new IntlTimeZone(normTimeZoneId, record.o, record.format) : new FixedTimeZone(normTimeZoneId, record.o, "fixed" === record.kind ? record._ : 0));
|
|
1994
1999
|
var FixedTimeZone = class {
|
|
1995
2000
|
constructor(id, compareKey, offsetNano) {
|
|
1996
2001
|
this.id = id, this.o = compareKey, this._ = offsetNano;
|
|
@@ -2072,7 +2077,8 @@ var IntlTimeZone = class {
|
|
|
2072
2077
|
return void 0 !== intlParts.era && "bce" === normalizeEraName(intlParts.era) ? 1 - year : year;
|
|
2073
2078
|
})(intlParts), parseInt(intlParts.month), parseInt(intlParts.day)) + 3600 * parseInt(intlParts.hour) + 60 * parseInt(intlParts.minute) + parseInt(intlParts.second) - epochSec;
|
|
2074
2079
|
})(format), ((timeZoneId) => {
|
|
2075
|
-
|
|
2080
|
+
const timeZoneName = timeZoneId.split("/").pop();
|
|
2081
|
+
return timeZonePeriodDaysByName[timeZoneName] || 60;
|
|
2076
2082
|
})(id));
|
|
2077
2083
|
}
|
|
2078
2084
|
C(epochNano) {
|
|
@@ -2296,12 +2302,12 @@ function offsetRegExpStr(separatorIndex) {
|
|
|
2296
2302
|
return "([+-])" + timeRegExpStr(separatorIndex);
|
|
2297
2303
|
}
|
|
2298
2304
|
const dateTimeRegExpStr = "(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]" + timeRegExpStr(8) + "(Z|" + offsetRegExpStr(15) + ")?)?";
|
|
2299
|
-
const yearMonthRegExp =
|
|
2300
|
-
const monthDayRegExp =
|
|
2301
|
-
const dateTimeRegExp =
|
|
2302
|
-
const timeRegExp =
|
|
2303
|
-
const annotationRegExp =
|
|
2304
|
-
const durationRegExp =
|
|
2305
|
+
const yearMonthRegExp = /*@__PURE__*/ createRegExp("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})");
|
|
2306
|
+
const monthDayRegExp = /*@__PURE__*/ createRegExp("(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})");
|
|
2307
|
+
const dateTimeRegExp = /*@__PURE__*/ createRegExp(dateTimeRegExpStr + "((?:\\[(!?)([^\\]]*)\\]){0,9})");
|
|
2308
|
+
const timeRegExp = /*@__PURE__*/ createRegExp("T?" + timeRegExpStr(2) + `(${offsetRegExpStr(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`);
|
|
2309
|
+
const annotationRegExp = /*@__PURE__*/ new RegExp("\\[(!?)([^\\]]*)\\]", "g");
|
|
2310
|
+
const durationRegExp = /*@__PURE__*/ createRegExp("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");
|
|
2305
2311
|
function parseDateTimeLike(s) {
|
|
2306
2312
|
const parts = dateTimeRegExp.exec(s);
|
|
2307
2313
|
return parts ? ((parts) => {
|
|
@@ -2579,8 +2585,8 @@ const timeDefaultShapeFields = {
|
|
|
2579
2585
|
minute: "numeric",
|
|
2580
2586
|
second: "numeric"
|
|
2581
2587
|
};
|
|
2582
|
-
const dateTimeDefaultShapeFields =
|
|
2583
|
-
const zonedDateTimeDefaultShapeFields =
|
|
2588
|
+
const dateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateDefaultShapeFields, timeDefaultShapeFields);
|
|
2589
|
+
const zonedDateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateTimeDefaultShapeFields, { timeZoneName: "short" });
|
|
2584
2590
|
const yearMonthDefaultShapeFields = {
|
|
2585
2591
|
year: "numeric",
|
|
2586
2592
|
month: "numeric"
|
|
@@ -2604,15 +2610,15 @@ const timeShapeFieldNames = [
|
|
|
2604
2610
|
"fractionalSecondDigits",
|
|
2605
2611
|
"timeStyle"
|
|
2606
2612
|
];
|
|
2607
|
-
const dateTimeShapeFieldNames =
|
|
2608
|
-
const yearMonthIgnoredFieldNames =
|
|
2609
|
-
const monthDayIgnoredFieldNames =
|
|
2610
|
-
const transformInstantOptions =
|
|
2611
|
-
const transformZonedOptions =
|
|
2612
|
-
const transformDateTimeOptions =
|
|
2613
|
-
const transformDateOptions =
|
|
2614
|
-
const transformTimeOptions =
|
|
2615
|
-
const transformYearMonthOptions =
|
|
2613
|
+
const dateTimeShapeFieldNames = /*@__PURE__*/ dateShapeFieldNames.concat(timeShapeFieldNames);
|
|
2614
|
+
const yearMonthIgnoredFieldNames = /*@__PURE__*/ ["weekday", "day"].concat(timeShapeFieldNames);
|
|
2615
|
+
const monthDayIgnoredFieldNames = /*@__PURE__*/ ["weekday", "year"].concat(timeShapeFieldNames);
|
|
2616
|
+
const transformInstantOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], dateTimeDefaultShapeFields);
|
|
2617
|
+
const transformZonedOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], zonedDateTimeDefaultShapeFields);
|
|
2618
|
+
const transformDateTimeOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], ["timeZoneName"], dateTimeDefaultShapeFields);
|
|
2619
|
+
const transformDateOptions = /*@__PURE__*/ createOptionsTransformer(dateShapeFieldNames, timeShapeFieldNames, ["timeZoneName"], dateDefaultShapeFields);
|
|
2620
|
+
const transformTimeOptions = /*@__PURE__*/ createOptionsTransformer(timeShapeFieldNames, dateShapeFieldNames, ["timeZoneName", "era"], timeDefaultShapeFields);
|
|
2621
|
+
const transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([
|
|
2616
2622
|
"year",
|
|
2617
2623
|
"month",
|
|
2618
2624
|
"dateStyle"
|
|
@@ -2634,7 +2640,7 @@ const transformYearMonthOptions = /* @__PURE__ */ createOptionsTransformer([
|
|
|
2634
2640
|
month: "numeric"
|
|
2635
2641
|
}
|
|
2636
2642
|
});
|
|
2637
|
-
const transformMonthDayOptions =
|
|
2643
|
+
const transformMonthDayOptions = /*@__PURE__*/ createOptionsTransformer([
|
|
2638
2644
|
"month",
|
|
2639
2645
|
"day",
|
|
2640
2646
|
"dateStyle"
|
|
@@ -2808,8 +2814,8 @@ function resolveBasicCalendarId(rawCalendarId) {
|
|
|
2808
2814
|
function resolveBasicCalendarArg(rawCalendarId = isoCalendarId) {
|
|
2809
2815
|
return resolveBasicCalendarId(rawCalendarId);
|
|
2810
2816
|
}
|
|
2811
|
-
const zonedDateTimeSlotsMap =
|
|
2812
|
-
const ZonedDateTime =
|
|
2817
|
+
const zonedDateTimeSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
2818
|
+
const ZonedDateTime = /*@__PURE__*/ defineTemporalClass(ZonedDateTimeBranding, class {
|
|
2813
2819
|
constructor(epochNanoseconds, timeZoneId, calendar = void 0) {
|
|
2814
2820
|
const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));
|
|
2815
2821
|
const timeZone = queryTimeZone(refineTimeZoneId(timeZoneId));
|
|
@@ -2957,8 +2963,8 @@ function refineTimeZoneArg(arg) {
|
|
|
2957
2963
|
}
|
|
2958
2964
|
return ((arg) => resolveTimeZoneId(parseTimeZoneId(requireString(arg))))(arg);
|
|
2959
2965
|
}
|
|
2960
|
-
const instantSlotsMap =
|
|
2961
|
-
const Instant =
|
|
2966
|
+
const instantSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
2967
|
+
const Instant = /*@__PURE__*/ defineTemporalClass(InstantBranding, class {
|
|
2962
2968
|
constructor(epochNanoseconds) {
|
|
2963
2969
|
const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));
|
|
2964
2970
|
initInstant(this, createEpochNanoSlots(epochNano));
|
|
@@ -3043,8 +3049,8 @@ const { toTemporalInstant: toTemporalInstant$1 } = { toTemporalInstant() {
|
|
|
3043
3049
|
function initInstant(instance, slots) {
|
|
3044
3050
|
return instantSlotsMap.set(instance, slots), attachDebugString(instance), instance;
|
|
3045
3051
|
}
|
|
3046
|
-
const plainMonthDaySlotsMap =
|
|
3047
|
-
const PlainMonthDay =
|
|
3052
|
+
const plainMonthDaySlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3053
|
+
const PlainMonthDay = /*@__PURE__*/ defineTemporalClass(PlainMonthDayBranding, class {
|
|
3048
3054
|
constructor(isoMonth, isoDay, calendar = void 0, referenceIsoYear) {
|
|
3049
3055
|
const isoMonthInt = toIntegerWithTrunc(isoMonth);
|
|
3050
3056
|
const isoDayInt = toIntegerWithTrunc(isoDay);
|
|
@@ -3108,8 +3114,8 @@ function toPlainMonthDaySlots(arg, options) {
|
|
|
3108
3114
|
function initPlainMonthDay(instance, slots) {
|
|
3109
3115
|
return plainMonthDaySlotsMap.set(instance, slots), attachDebugString(instance), instance;
|
|
3110
3116
|
}
|
|
3111
|
-
const plainYearMonthSlotsMap =
|
|
3112
|
-
const PlainYearMonth =
|
|
3117
|
+
const plainYearMonthSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3118
|
+
const PlainYearMonth = /*@__PURE__*/ defineTemporalClass(PlainYearMonthBranding, class {
|
|
3113
3119
|
constructor(isoYear, isoMonth, calendar = void 0, referenceIsoDay) {
|
|
3114
3120
|
const isoYearInt = toIntegerWithTrunc(isoYear);
|
|
3115
3121
|
const isoMonthInt = toIntegerWithTrunc(isoMonth);
|
|
@@ -3201,8 +3207,8 @@ function getTemporalBrandingAndSlots(obj) {
|
|
|
3201
3207
|
function validateBag(bag) {
|
|
3202
3208
|
return (getTemporalBrandingAndSlots(bag) || void 0 !== bag.calendar || void 0 !== bag.timeZone) && throwTypeError("Invalid bag"), bag;
|
|
3203
3209
|
}
|
|
3204
|
-
const plainTimeSlotsMap =
|
|
3205
|
-
const PlainTime =
|
|
3210
|
+
const plainTimeSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3211
|
+
const PlainTime = /*@__PURE__*/ defineTemporalClass(PlainTimeBranding, class {
|
|
3206
3212
|
constructor(hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0) {
|
|
3207
3213
|
const fields = validateTimeFields(mapProps(toIntegerWithTrunc, {
|
|
3208
3214
|
hour,
|
|
@@ -3284,8 +3290,8 @@ function optionalToPlainTimeFields(timeArg) {
|
|
|
3284
3290
|
function initPlainTime(instance, slots) {
|
|
3285
3291
|
return plainTimeSlotsMap.set(instance, slots), attachDebugString(instance), instance;
|
|
3286
3292
|
}
|
|
3287
|
-
const plainDateTimeSlotsMap =
|
|
3288
|
-
const PlainDateTime =
|
|
3293
|
+
const plainDateTimeSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3294
|
+
const PlainDateTime = /*@__PURE__*/ defineTemporalClass(PlainDateTimeBranding, class {
|
|
3289
3295
|
constructor(isoYear, isoMonth, isoDay, hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0, calendar = void 0) {
|
|
3290
3296
|
const fields = checkIsoDateTimeInBounds(validateIsoDateTimeFields(mapProps(toIntegerWithTrunc, {
|
|
3291
3297
|
year: isoYear,
|
|
@@ -3396,8 +3402,8 @@ function toPlainDateTimeSlots(arg, options) {
|
|
|
3396
3402
|
function initPlainDateTime(instance, slots) {
|
|
3397
3403
|
return plainDateTimeSlotsMap.set(instance, slots), attachDebugString(instance), instance;
|
|
3398
3404
|
}
|
|
3399
|
-
const plainDateSlotsMap =
|
|
3400
|
-
const PlainDate =
|
|
3405
|
+
const plainDateSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3406
|
+
const PlainDate = /*@__PURE__*/ defineTemporalClass(PlainDateBranding, class {
|
|
3401
3407
|
constructor(isoYear, isoMonth, isoDay, calendar = void 0) {
|
|
3402
3408
|
const fields = checkIsoDateInBounds(validateIsoDateFields(mapProps(toIntegerWithTrunc, {
|
|
3403
3409
|
year: isoYear,
|
|
@@ -3515,8 +3521,8 @@ function refineCalendarArg(arg) {
|
|
|
3515
3521
|
}
|
|
3516
3522
|
return ((arg) => resolveBasicCalendarId(parseCalendarId(requireString(arg))))(arg);
|
|
3517
3523
|
}
|
|
3518
|
-
const durationSlotsMap =
|
|
3519
|
-
const Duration =
|
|
3524
|
+
const durationSlotsMap = /*@__PURE__*/ new WeakMap();
|
|
3525
|
+
const Duration = /*@__PURE__*/ defineTemporalClass(DurationBranding, class {
|
|
3520
3526
|
constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0, microseconds = 0, nanoseconds = 0) {
|
|
3521
3527
|
const fields = validateDurationFields(mapProps(toStrictInteger, {
|
|
3522
3528
|
years,
|
|
@@ -3609,7 +3615,7 @@ function refinePublicRelativeTo(relativeTo) {
|
|
|
3609
3615
|
function initDuration(instance, slots) {
|
|
3610
3616
|
return durationSlotsMap.set(instance, slots), attachDebugString(instance), instance;
|
|
3611
3617
|
}
|
|
3612
|
-
const Now =
|
|
3618
|
+
const Now = /*@__PURE__*/ Object.defineProperties({}, {
|
|
3613
3619
|
...createStringTagDescriptors("Temporal.Now"),
|
|
3614
3620
|
...createPropDescriptors({
|
|
3615
3621
|
timeZoneId() {
|
|
@@ -3633,7 +3639,7 @@ const Now = /* @__PURE__ */ Object.defineProperties({}, {
|
|
|
3633
3639
|
}
|
|
3634
3640
|
})
|
|
3635
3641
|
});
|
|
3636
|
-
const Temporal$2 =
|
|
3642
|
+
const Temporal$2 = /*@__PURE__*/ Object.defineProperties({}, {
|
|
3637
3643
|
...createStringTagDescriptors("Temporal"),
|
|
3638
3644
|
...createPropDescriptors({
|
|
3639
3645
|
PlainYearMonth,
|
package/dist/mod.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Context, KvStore, MessageQueue } from "@fedify/fedify";
|
|
3
3
|
import { Actor } from "@fedify/vocab";
|
|
4
|
-
//#region ../vocab-runtime/dist/docloader-
|
|
4
|
+
//#region ../vocab-runtime/dist/docloader-BK627tQQ.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Options for making `User-Agent` string.
|
|
7
7
|
* @see {@link getUserAgent}
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Context, KvStore, MessageQueue } from "@fedify/fedify";
|
|
3
3
|
import { Actor } from "@fedify/vocab";
|
|
4
|
-
//#region ../vocab-runtime/dist/docloader-
|
|
4
|
+
//#region ../vocab-runtime/dist/docloader-BK627tQQ.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Options for making `User-Agent` string.
|
|
7
7
|
* @see {@link getUserAgent}
|