@bereasoftware/time-guard 2.6.0 → 2.6.1
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/calendars/index.cjs.map +1 -1
- package/dist/calendars/index.es.js +1 -1
- package/dist/calendars/index.es.js.map +1 -1
- package/dist/locales/index.cjs +1 -2
- package/dist/locales/index.es.js +3 -2797
- package/dist/locales-DSBvgSaw.js +2798 -0
- package/dist/locales-DSBvgSaw.js.map +1 -0
- package/dist/locales-ybx7jS8G.cjs +2 -0
- package/dist/locales-ybx7jS8G.cjs.map +1 -0
- package/dist/plugins/advanced-format.cjs.map +1 -1
- package/dist/plugins/advanced-format.es.js +1 -1
- package/dist/plugins/advanced-format.es.js.map +1 -1
- package/dist/plugins/duration.cjs.map +1 -1
- package/dist/plugins/duration.es.js +1 -1
- package/dist/plugins/duration.es.js.map +1 -1
- package/dist/plugins/relative-time.cjs.map +1 -1
- package/dist/plugins/relative-time.es.js +1 -1
- package/dist/plugins/relative-time.es.js.map +1 -1
- package/dist/time-guard.cjs +2 -2
- package/dist/time-guard.cjs.map +1 -1
- package/dist/time-guard.es.js +20 -8
- package/dist/time-guard.es.js.map +1 -1
- package/dist/time-guard.iife.js +2 -2
- package/dist/time-guard.iife.js.map +1 -1
- package/dist/time-guard.umd.js +2 -2
- package/dist/time-guard.umd.js.map +1 -1
- package/dist/types/adapters/temporal.adapter.d.ts +4 -9
- package/dist/types/index.d.ts +9 -10
- package/dist/types/plugins/index.d.ts +5 -5
- package/dist/types/time-guard.d.ts +2 -0
- package/dist/types/types/index.d.ts +67 -12
- package/package.json +20 -6
- package/dist/locales/index.cjs.map +0 -1
- package/dist/locales/index.es.js.map +0 -1
package/dist/time-guard.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! time-guard v2.6.
|
|
1
|
+
/*! time-guard v2.6.1 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, i, o, s) => {
|
|
3
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
|
|
4
4
|
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
5
5
|
get: ((e) => i[e]).bind(null, d),
|
|
6
6
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
@@ -7127,7 +7127,7 @@ for (let e of Ro) {
|
|
|
7127
7127
|
var zo = null;
|
|
7128
7128
|
function Bo() {
|
|
7129
7129
|
if (zo) return zo;
|
|
7130
|
-
let e = globalThis.Temporal
|
|
7130
|
+
let e = globalThis.Temporal ?? Lo;
|
|
7131
7131
|
if (!e) throw Error("Temporal API not loaded. Make sure @js-temporal/polyfill is imported in your app.");
|
|
7132
7132
|
return zo = e, e;
|
|
7133
7133
|
}
|
|
@@ -7214,7 +7214,7 @@ var $ = class {
|
|
|
7214
7214
|
"millisecond"
|
|
7215
7215
|
]) {
|
|
7216
7216
|
let n = e[t];
|
|
7217
|
-
if (typeof n != "number" || !Number.isFinite(n) || !Number.isInteger(n)) throw Error(`Temporal error: Expected finite integer for ${t}, got ${n}`);
|
|
7217
|
+
if (typeof n != "number" || !Number.isFinite(n) || !Number.isInteger(n)) throw typeof console < "u" && typeof console.error == "function" && console.error("TemporalAdapter.validatePlainDateTime: campo inválido", t, n, e), Error(`Temporal error: Expected finite integer for ${t}, got ${n}`);
|
|
7218
7218
|
}
|
|
7219
7219
|
}
|
|
7220
7220
|
static now() {
|
|
@@ -10759,7 +10759,7 @@ var ls = 40, us = class {
|
|
|
10759
10759
|
return;
|
|
10760
10760
|
}
|
|
10761
10761
|
try {
|
|
10762
|
-
e.install(t, n), this.plugins.set(e.name, e), console.
|
|
10762
|
+
e.install(t, n), this.plugins.set(e.name, e), process.env.NODE_ENV !== "production" && console.warn(`Plugin "${e.name}" v${e.version} registered successfully`);
|
|
10763
10763
|
} catch (t) {
|
|
10764
10764
|
throw console.error(`Failed to register plugin "${e.name}":`, t), Error(`Failed to register plugin "${e.name}": ${t instanceof Error ? t.message : String(t)}`);
|
|
10765
10765
|
}
|
|
@@ -11340,7 +11340,8 @@ var Rs = class {
|
|
|
11340
11340
|
timezone: t?.timezone || "UTC",
|
|
11341
11341
|
strict: t?.strict ?? !1
|
|
11342
11342
|
}, this.temporal = $.parseToPlainDateTime(e), this.config.timezone && this.config.timezone !== "UTC") try {
|
|
11343
|
-
|
|
11343
|
+
let e = this.temporal.toZonedDateTime(this.config.timezone);
|
|
11344
|
+
this.temporal = e;
|
|
11344
11345
|
} catch {}
|
|
11345
11346
|
}
|
|
11346
11347
|
static now(t) {
|
|
@@ -11426,7 +11427,18 @@ var Rs = class {
|
|
|
11426
11427
|
}[e]];
|
|
11427
11428
|
}
|
|
11428
11429
|
add(t) {
|
|
11429
|
-
let n = $.toPlainDateTime(this.temporal), r = {
|
|
11430
|
+
let n = $.toPlainDateTime(this.temporal), r = {
|
|
11431
|
+
year: 0,
|
|
11432
|
+
month: 0,
|
|
11433
|
+
week: 0,
|
|
11434
|
+
day: 0,
|
|
11435
|
+
hour: 0,
|
|
11436
|
+
minute: 0,
|
|
11437
|
+
second: 0,
|
|
11438
|
+
millisecond: 0,
|
|
11439
|
+
microsecond: 0,
|
|
11440
|
+
nanosecond: 0
|
|
11441
|
+
}, i = !1;
|
|
11430
11442
|
return Object.entries(t).forEach(([e, t]) => {
|
|
11431
11443
|
if (t !== void 0 && t !== 0) {
|
|
11432
11444
|
let n = Number(t);
|
|
@@ -11788,7 +11800,7 @@ var Rs = class {
|
|
|
11788
11800
|
function Hs(e, t) {
|
|
11789
11801
|
return new Vs(e, t);
|
|
11790
11802
|
}
|
|
11791
|
-
var Us = "2.6.
|
|
11803
|
+
var Us = "2.6.1";
|
|
11792
11804
|
Uo.getInstance().loadLocales(os);
|
|
11793
11805
|
//#endregion
|
|
11794
11806
|
export { os as ALL_LOCALES, Es as AdvancedFormatPlugin, _s as BuddhistCalendar, ds as CalendarManager, hs as ChineseCalendar, Wo as DateFormatter, Cs as Duration, ws as DurationPlugin, zs as DurationResult, Vo as EN_LOCALE, Ho as ES_LOCALE, us as GregorianCalendar, ms as HebrewCalendar, ps as IslamicCalendar, gs as JapaneseCalendar, ls as LOCALES_COUNT, Uo as LocaleManager, vs as PluginManager, xs as RelativeTimePlugin, $ as TemporalAdapter, Vs as TimeGuard, Bs as TimeRange, Ds as advancedFormatPlugin, fs as calendarManager, Ts as durationPlugin, cs as getAvailableLocales, ss as registerAllLocales, Ss as relativeTimePlugin, Hs as timeGuard, Us as version };
|