toolbox-x 1.2.1 → 2.0.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/{Color-Dsut0Bex.d.cts → Color-BCsnSEmt.d.cts} +1 -1
- package/dist/{Color-DCfoQk_-.d.mts → Color-CKmhtXdG.d.mts} +1 -1
- package/dist/{Stylog-DXZtHAbp.d.mts → Stylog-CXpN-oeY.d.mts} +5 -5
- package/dist/{Stylog-TyLCTRtT.d.cts → Stylog-DJOVxym_.d.cts} +5 -5
- package/dist/{area-CcRQ6TfR.d.cts → area-CHhwLR12.d.cts} +3 -3
- package/dist/{area-CvSC96va.d.mts → area-DOqFLNcr.d.mts} +3 -3
- package/dist/{array-B6jWzJ4F.d.mts → array-BNbTIBni.d.mts} +1 -1
- package/dist/{array-CqDu610k.d.cts → array-CL3apdfa.d.cts} +1 -1
- package/dist/{basics-KobRNhV-.d.cts → basics-B9aytOct.d.cts} +5 -5
- package/dist/{basics-V5M2oltn.d.mts → basics-BNQqY5WD.d.mts} +5 -5
- package/dist/{basics-K8BDSYD6.cjs → basics-CJmdhXoo.cjs} +567 -14
- package/dist/{basics-1_M7UvCn.mjs → basics-CebgkY-n.mjs} +449 -16
- package/dist/{case-uKFzt5TY.cjs → case-Bd7QLHYw.cjs} +3 -3
- package/dist/{case-KdrBKjjK.d.mts → case-Bkkm6Mqi.d.mts} +12 -12
- package/dist/{case-BQwn5N-k.mjs → case-DBC4Rj0h.mjs} +3 -3
- package/dist/{case--Vjea9DS.d.cts → case-DFD3Ml1p.d.cts} +12 -12
- package/dist/change-case.cjs +1 -1
- package/dist/change-case.d.cts +1 -1
- package/dist/change-case.d.mts +1 -1
- package/dist/change-case.mjs +1 -1
- package/dist/colors.d.cts +2 -2
- package/dist/colors.d.mts +2 -2
- package/dist/{constants-C4RW7Lei.cjs → constants-Dz5vxNQ9.cjs} +37 -0
- package/dist/{constants-rNhoy4DH.mjs → constants-j-iXjwDl.mjs} +32 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/converter.cjs +2 -2
- package/dist/converter.d.cts +2 -2
- package/dist/converter.d.mts +2 -2
- package/dist/converter.mjs +2 -2
- package/dist/date.cjs +51 -10
- package/dist/date.d.cts +22 -5
- package/dist/date.d.mts +22 -5
- package/dist/date.mjs +49 -11
- package/dist/dom.cjs +5 -6
- package/dist/dom.d.cts +3 -3
- package/dist/dom.d.mts +3 -3
- package/dist/dom.mjs +4 -5
- package/dist/{form-DoQGMTOc.d.mts → form-CC9T9WnX.d.cts} +2 -2
- package/dist/{form-mP-nl8EC.d.cts → form-CheKmgjj.d.mts} +2 -2
- package/dist/guards-B2s2wlVN.mjs +425 -0
- package/dist/{guards-C0smSAKC.mjs → guards-BK1QuvFZ.mjs} +2 -2
- package/dist/{guards-ClGDJrQp.cjs → guards-Bsh6Bfdq.cjs} +2 -2
- package/dist/{guards-0VjySrPM.cjs → guards-DMJcjPDt.cjs} +279 -3
- package/dist/guards.cjs +9 -8
- package/dist/guards.d.cts +6 -5
- package/dist/guards.d.mts +6 -5
- package/dist/guards.mjs +5 -5
- package/dist/{hash-BcoFHSu1.d.cts → hash-C0Wr7H8v.d.mts} +1 -1
- package/dist/{hash-GYRx2ee_.d.mts → hash-DJ8b9VHB.d.cts} +1 -1
- package/dist/hash.cjs +8 -8
- package/dist/hash.d.cts +8 -8
- package/dist/hash.d.mts +8 -8
- package/dist/hash.mjs +4 -5
- package/dist/{http-status-xrlR-LlB.d.mts → http-status-BSee6mB5.d.mts} +1 -1
- package/dist/{http-status-C0DOpCDf.d.cts → http-status-DJn87B_Y.d.cts} +1 -1
- package/dist/http-status.cjs +4 -4
- package/dist/http-status.d.cts +6 -6
- package/dist/http-status.d.mts +6 -6
- package/dist/http-status.mjs +4 -4
- package/dist/index-01oaUuP6.d.mts +292 -0
- package/dist/index-CgwlWrZM.d.cts +292 -0
- package/dist/index.cjs +67 -248
- package/dist/index.d.cts +25 -280
- package/dist/index.d.mts +25 -280
- package/dist/index.mjs +11 -194
- package/dist/{object-ChFVh95z.d.cts → object-Mglyg4AW.d.cts} +28 -1
- package/dist/{object-ChFVh95z.d.mts → object-Mglyg4AW.d.mts} +28 -1
- package/dist/{objectify-DEnFpPt1.mjs → objectify-CQa8gQib.mjs} +3 -4
- package/dist/{objectify-DewBSJP_.cjs → objectify-xQvZS3UI.cjs} +5 -6
- package/dist/paginator.d.cts +1 -1
- package/dist/paginator.d.mts +1 -1
- package/dist/{parse-DovagZFA.cjs → parse-BWu3UbOk.cjs} +4 -4
- package/dist/{parse-BhZ6-tKg.mjs → parse-CNDdS-sy.mjs} +4 -4
- package/dist/{pluralizer-CdG-VJ6t.d.cts → pluralizer-BGMC8LLz.d.cts} +1 -1
- package/dist/{pluralizer-D2Lh8CdU.d.mts → pluralizer-CQNzRhwR.d.mts} +1 -1
- package/dist/pluralizer.cjs +6 -6
- package/dist/pluralizer.d.cts +6 -6
- package/dist/pluralizer.d.mts +6 -6
- package/dist/pluralizer.mjs +6 -6
- package/dist/{specials-Cye93-uo.mjs → specials-Hq5Ncd6y.mjs} +2 -2
- package/dist/{specials-BM6cx43o.cjs → specials-dkYP1Nh2.cjs} +2 -2
- package/dist/{string-Dq2b8rcN.d.cts → string-BDwBuik3.d.cts} +4 -2
- package/dist/{string-CkwTVFeL.d.mts → string-_1ImwUJT.d.mts} +4 -2
- package/dist/stylog.cjs +5 -5
- package/dist/stylog.d.cts +2 -2
- package/dist/stylog.d.mts +2 -2
- package/dist/stylog.mjs +5 -5
- package/dist/types/array.d.cts +1 -1
- package/dist/types/array.d.mts +1 -1
- package/dist/types/colors.d.cts +1 -1
- package/dist/types/colors.d.mts +1 -1
- package/dist/types/converter.d.cts +1 -1
- package/dist/types/converter.d.mts +1 -1
- package/dist/types/date.d.cts +2 -2
- package/dist/types/date.d.mts +2 -2
- package/dist/types/form.d.cts +1 -1
- package/dist/types/form.d.mts +1 -1
- package/dist/types/hash.d.cts +1 -1
- package/dist/types/hash.d.mts +1 -1
- package/dist/types/http-status.d.cts +1 -1
- package/dist/types/http-status.d.mts +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/number.d.cts +1 -1
- package/dist/types/number.d.mts +1 -1
- package/dist/types/object.d.cts +2 -2
- package/dist/types/object.d.mts +2 -2
- package/dist/types/pluralizer.d.cts +1 -1
- package/dist/types/pluralizer.d.mts +1 -1
- package/dist/types/string.d.cts +2 -2
- package/dist/types/string.d.mts +2 -2
- package/dist/types/stylog.d.cts +1 -1
- package/dist/types/stylog.d.mts +1 -1
- package/dist/types/utils.d.cts +1 -1
- package/dist/types/utils.d.mts +1 -1
- package/dist/{utilities-CzyXCRHM.cjs → utilities-CWV1GPGY.cjs} +1 -1
- package/dist/{utilities-B9axOvOX.mjs → utilities-DPscNbS1.mjs} +1 -1
- package/dist/{uuid-DgTBxcVu.d.cts → uuid-CiJtSUbo.d.cts} +3 -3
- package/dist/{uuid-Yc3Uu8qr.d.mts → uuid-D-gjPs4Q.d.mts} +3 -3
- package/dist/verbalizer.cjs +3 -3
- package/dist/verbalizer.d.cts +3 -3
- package/dist/verbalizer.d.mts +3 -3
- package/dist/verbalizer.mjs +3 -3
- package/package.json +7 -6
- package/dist/guards-DeO4ukiK.mjs +0 -221
- package/dist/utils-BxguWSoa.cjs +0 -568
- package/dist/utils-DXovsTKs.mjs +0 -449
package/dist/date.d.mts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Dn as UTCOffset, Gt as GreetingConfigs, Jt as ISODateFormat, Kt as HourMinutes, Mt as DateArgs, Nt as DateFormatOptions, Tn as TimestampOptions, Yt as ISODateTimeString, _n as TimeWithUnit, ct as Numeric, jt as ClockTime, ln as RelativeDateFormatOptions, nt as Maybe, pn as TimeOnlyFormat, un as SafeFormat, wt as $TimeZoneIdentifier, xn as TimeZoneIdNative, yn as TimeZoneDetails } from "./object-Mglyg4AW.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/date/greet.d.ts
|
|
20
20
|
/**
|
|
@@ -129,8 +129,8 @@ declare function getTimeZoneIds(offset: UTCOffset): TimeZoneIdNative[];
|
|
|
129
129
|
* - The default format is `'dd, mmm DD, YYYY HH:mm:ss'` (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
|
|
130
130
|
* - By default, local time is used; set `useUTC` to `true` to format in UTC.
|
|
131
131
|
* - The format string supports various tokens for date and time components, as well as literal text enclosed in square brackets.
|
|
132
|
-
* - See {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
133
|
-
* - For more complex date/time manipulations, consider using the {@link https://
|
|
132
|
+
* - See {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/date-time/format-date#format-tokens format tokens} for details on supported tokens.
|
|
133
|
+
* - For more complex date/time manipulations, consider using the {@link https://chronos.nazmul-nhb.dev/docs/ chronos-date} library.
|
|
134
134
|
*
|
|
135
135
|
* @returns Date/time string in specified format.
|
|
136
136
|
*/
|
|
@@ -157,7 +157,7 @@ declare function formatDate(options?: DateFormatOptions): string;
|
|
|
157
157
|
*/
|
|
158
158
|
declare function formatTimePart(time: string, format?: TimeOnlyFormat): string;
|
|
159
159
|
/**
|
|
160
|
-
* * Formats a date as a relative time string (e.g., "5m ago"
|
|
160
|
+
* * Formats a date as a relative time string (e.g., `"5m ago"`, `"2h from now"`).
|
|
161
161
|
*
|
|
162
162
|
* @param date - The date to format, which can be a `Date` object, a date string, or a timestamp number.
|
|
163
163
|
* @param format - Optional format string for dates older than 7 days. Defaults to `'mmm D, yyyy hh:mm a'`.
|
|
@@ -175,6 +175,23 @@ declare function formatTimePart(time: string, format?: TimeOnlyFormat): string;
|
|
|
175
175
|
* formatDateRelative(Date.now() - 10 * 86400000); // "Apr 6, 2026 04:11 PM" (formatted date string)
|
|
176
176
|
*/
|
|
177
177
|
declare function formatDateRelative(date: Maybe<DateArgs>, format?: SafeFormat): string;
|
|
178
|
+
/**
|
|
179
|
+
* * Formats a date as a relative time string using {@link Intl.RelativeTimeFormat} native method.
|
|
180
|
+
*
|
|
181
|
+
* @param toDate - The date to format, which can be a `Date` object, a date string, or a timestamp number.
|
|
182
|
+
* @param options - Optional configuration for relative date formatting.
|
|
183
|
+
* @returns A relative time string.
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* - If `toDate` is provided but `undefined`, current date and time will be used.
|
|
187
|
+
* - If `fromDate` is provided but `undefined`, current date and time will be used.
|
|
188
|
+
* - If any of the provided date value (`toDate` or `fromDate`) is invalid, the function will return `'Invalid Date!'`.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* formatRelativeDateNative(Date.now() - 5 * 60000); // "5m ago"
|
|
192
|
+
* formatRelativeDateNative(Date.now() + 2 * 3600000); // "in 2 hours"
|
|
193
|
+
*/
|
|
194
|
+
declare function formatRelativeDateNative(toDate: DateArgs, options?: RelativeDateFormatOptions): string;
|
|
178
195
|
/**
|
|
179
196
|
* * Get timestamp in ISO 8601 format for the current date and time.
|
|
180
197
|
*
|
|
@@ -210,4 +227,4 @@ declare function getTimestamp<F extends ISODateFormat>(value: DateArgs, format?:
|
|
|
210
227
|
*/
|
|
211
228
|
declare function getTimestamp<F extends ISODateFormat>(options: TimestampOptions<F>): ISODateTimeString<F>;
|
|
212
229
|
//#endregion
|
|
213
|
-
export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, convertMinutesToTime as getHourMinutesFromMinutes, convertMinutesToTime as getTimeFromMinutes, formatUTCOffset as convertMinutesToUTCOffset, formatUTCOffset, formatUTCOffset as minutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractMinutesFromUTC as getMinutesFromUTC, extractMinutesFromUTC as getTotalMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, formatDate, formatDate as formatDateTime, formatDateRelative, formatDateRelative as formatRelativeDate, formatDateRelative as formatRelativeTime, formatTimePart, getGreeting as generateGreeting, getGreeting, getGreeting as greet, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getNativeTimeZoneId, getTimeZoneDetails, getTimeZoneIds, getTimestamp, parseMSec, parseMSec as parseMs };
|
|
230
|
+
export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, convertMinutesToTime as getHourMinutesFromMinutes, convertMinutesToTime as getTimeFromMinutes, formatUTCOffset as convertMinutesToUTCOffset, formatUTCOffset, formatUTCOffset as minutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractMinutesFromUTC as getMinutesFromUTC, extractMinutesFromUTC as getTotalMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, formatDate, formatDate as formatDateTime, formatDateRelative, formatDateRelative as formatRelativeDate, formatDateRelative as formatRelativeTime, formatRelativeDateNative as formatDateRelativeNative, formatRelativeDateNative, formatRelativeDateNative as formatRelativeTimeNative, formatTimePart, getGreeting as generateGreeting, getGreeting, getGreeting as greet, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getNativeTimeZoneId, getTimeZoneDetails, getTimeZoneIds, getTimestamp, parseMSec, parseMSec as parseMs };
|
package/dist/date.mjs
CHANGED
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { m as isUndefined } from "./primitives-Djsevc69.mjs";
|
|
18
|
+
import { i as RELATIVE_TIME_DIVISIONS } from "./constants-j-iXjwDl.mjs";
|
|
18
19
|
import { n as NATIVE_TZ_IDS } from "./timezone-avZ4TvDx.mjs";
|
|
19
|
-
import { T as isObject } from "./specials-
|
|
20
|
-
import { a as normalizeNumber } from "./utilities-
|
|
21
|
-
import { a as isValidTime, s as isValidUTCOffset } from "./guards-
|
|
22
|
-
import { a as _normalizeOffset, i as _gmtToUtcOffset, n as _dateArgsToDate, o as _resolveNativeTzName, r as _formatDate, t as parseMSec } from "./parse-
|
|
20
|
+
import { T as isObject } from "./specials-Hq5Ncd6y.mjs";
|
|
21
|
+
import { a as normalizeNumber } from "./utilities-DPscNbS1.mjs";
|
|
22
|
+
import { a as isValidTime, s as isValidUTCOffset } from "./guards-BK1QuvFZ.mjs";
|
|
23
|
+
import { a as _normalizeOffset, i as _gmtToUtcOffset, n as _dateArgsToDate, o as _resolveNativeTzName, r as _formatDate, t as parseMSec } from "./parse-CNDdS-sy.mjs";
|
|
23
24
|
|
|
24
25
|
//#region src/date/utils.ts
|
|
25
26
|
/**
|
|
@@ -161,15 +162,15 @@ function getTimeZoneIds(offset) {
|
|
|
161
162
|
* - The default format is `'dd, mmm DD, YYYY HH:mm:ss'` (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
|
|
162
163
|
* - By default, local time is used; set `useUTC` to `true` to format in UTC.
|
|
163
164
|
* - The format string supports various tokens for date and time components, as well as literal text enclosed in square brackets.
|
|
164
|
-
* - See {@link https://toolbox-x.nazmul-nhb.dev/docs/
|
|
165
|
-
* - For more complex date/time manipulations, consider using the {@link https://
|
|
165
|
+
* - See {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/date-time/format-date#format-tokens format tokens} for details on supported tokens.
|
|
166
|
+
* - For more complex date/time manipulations, consider using the {@link https://chronos.nazmul-nhb.dev/docs/ chronos-date} library.
|
|
166
167
|
*
|
|
167
168
|
* @returns Date/time string in specified format.
|
|
168
169
|
*/
|
|
169
170
|
function formatDate(options) {
|
|
170
171
|
const { date = /* @__PURE__ */ new Date(), format = "dd, mmm DD, YYYY HH:mm:ss", useUTC = false } = options ?? {};
|
|
171
172
|
const $date = _dateArgsToDate(date);
|
|
172
|
-
if (isNaN($date.getTime())) return "Invalid Date!";
|
|
173
|
+
if (Number.isNaN($date.getTime())) return "Invalid Date!";
|
|
173
174
|
/** Get unit value for {@link $date} for specific unit in local or UTC time */
|
|
174
175
|
const _getUnitValue = (suffix) => {
|
|
175
176
|
return useUTC ? $date[`getUTC${suffix}`]() : $date[`get${suffix}`]();
|
|
@@ -203,7 +204,7 @@ function formatTimePart(time, format) {
|
|
|
203
204
|
});
|
|
204
205
|
}
|
|
205
206
|
/**
|
|
206
|
-
* * Formats a date as a relative time string (e.g., "5m ago"
|
|
207
|
+
* * Formats a date as a relative time string (e.g., `"5m ago"`, `"2h from now"`).
|
|
207
208
|
*
|
|
208
209
|
* @param date - The date to format, which can be a `Date` object, a date string, or a timestamp number.
|
|
209
210
|
* @param format - Optional format string for dates older than 7 days. Defaults to `'mmm D, yyyy hh:mm a'`.
|
|
@@ -222,7 +223,7 @@ function formatTimePart(time, format) {
|
|
|
222
223
|
*/
|
|
223
224
|
function formatDateRelative(date, format) {
|
|
224
225
|
const $date = _dateArgsToDate(date);
|
|
225
|
-
if (isNaN($date.getTime())) return "Invalid Date!";
|
|
226
|
+
if (Number.isNaN($date.getTime())) return "Invalid Date!";
|
|
226
227
|
const now = Date.now();
|
|
227
228
|
const then = $date.getTime();
|
|
228
229
|
const diff = Math.abs(now - then);
|
|
@@ -239,6 +240,43 @@ function formatDateRelative(date, format) {
|
|
|
239
240
|
format: format || "mmm D, yyyy hh:mm a"
|
|
240
241
|
});
|
|
241
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* * Formats a date as a relative time string using {@link Intl.RelativeTimeFormat} native method.
|
|
245
|
+
*
|
|
246
|
+
* @param toDate - The date to format, which can be a `Date` object, a date string, or a timestamp number.
|
|
247
|
+
* @param options - Optional configuration for relative date formatting.
|
|
248
|
+
* @returns A relative time string.
|
|
249
|
+
*
|
|
250
|
+
* @remarks
|
|
251
|
+
* - If `toDate` is provided but `undefined`, current date and time will be used.
|
|
252
|
+
* - If `fromDate` is provided but `undefined`, current date and time will be used.
|
|
253
|
+
* - If any of the provided date value (`toDate` or `fromDate`) is invalid, the function will return `'Invalid Date!'`.
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* formatRelativeDateNative(Date.now() - 5 * 60000); // "5m ago"
|
|
257
|
+
* formatRelativeDateNative(Date.now() + 2 * 3600000); // "in 2 hours"
|
|
258
|
+
*/
|
|
259
|
+
function formatRelativeDateNative(toDate, options) {
|
|
260
|
+
const { fromDate = /* @__PURE__ */ new Date(), locale = "en", localeMatcher, numeric = "always", style } = options ?? {};
|
|
261
|
+
const to = _dateArgsToDate(toDate).getTime();
|
|
262
|
+
const from = _dateArgsToDate(fromDate).getTime();
|
|
263
|
+
if (Number.isNaN(to) || Number.isNaN(from)) return "Invalid Date!";
|
|
264
|
+
let duration = (to - from) / 1e3;
|
|
265
|
+
const RELATIVE_DATE_FORMATTER = new Intl.RelativeTimeFormat(locale, {
|
|
266
|
+
localeMatcher,
|
|
267
|
+
numeric,
|
|
268
|
+
style
|
|
269
|
+
});
|
|
270
|
+
let formatted = "Just now";
|
|
271
|
+
for (const division of RELATIVE_TIME_DIVISIONS) {
|
|
272
|
+
if (Math.abs(duration) < division.amount) {
|
|
273
|
+
formatted = RELATIVE_DATE_FORMATTER.format(Math.round(duration), division.name);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
duration /= division.amount;
|
|
277
|
+
}
|
|
278
|
+
return formatted;
|
|
279
|
+
}
|
|
242
280
|
/** Get timestamp in ISO 8601 format. */
|
|
243
281
|
function getTimestamp(args, format) {
|
|
244
282
|
let $value;
|
|
@@ -254,7 +292,7 @@ function getTimestamp(args, format) {
|
|
|
254
292
|
$format = format || "utc";
|
|
255
293
|
}
|
|
256
294
|
let date = _dateArgsToDate($value);
|
|
257
|
-
if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
295
|
+
if (Number.isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
|
|
258
296
|
if ($format === "local") {
|
|
259
297
|
const offsetMins = date.getTimezoneOffset();
|
|
260
298
|
const localDate = /* @__PURE__ */ new Date(date.getTime() - offsetMins * 6e4);
|
|
@@ -295,4 +333,4 @@ function getGreeting(configs) {
|
|
|
295
333
|
}
|
|
296
334
|
|
|
297
335
|
//#endregion
|
|
298
|
-
export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, convertMinutesToTime as getHourMinutesFromMinutes, convertMinutesToTime as getTimeFromMinutes, formatUTCOffset as convertMinutesToUTCOffset, formatUTCOffset, formatUTCOffset as minutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractMinutesFromUTC as getMinutesFromUTC, extractMinutesFromUTC as getTotalMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, formatDate, formatDate as formatDateTime, formatDateRelative, formatDateRelative as formatRelativeDate, formatDateRelative as formatRelativeTime, formatTimePart, getGreeting as generateGreeting, getGreeting, getGreeting as greet, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getNativeTimeZoneId, getTimeZoneDetails, getTimeZoneIds, getTimestamp, parseMSec, parseMSec as parseMs };
|
|
336
|
+
export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, convertMinutesToTime as getHourMinutesFromMinutes, convertMinutesToTime as getTimeFromMinutes, formatUTCOffset as convertMinutesToUTCOffset, formatUTCOffset, formatUTCOffset as minutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractMinutesFromUTC as getMinutesFromUTC, extractMinutesFromUTC as getTotalMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, formatDate, formatDate as formatDateTime, formatDateRelative, formatDateRelative as formatRelativeDate, formatDateRelative as formatRelativeTime, formatRelativeDateNative as formatDateRelativeNative, formatRelativeDateNative, formatRelativeDateNative as formatRelativeTimeNative, formatTimePart, getGreeting as generateGreeting, getGreeting, getGreeting as greet, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getNativeTimeZoneId, getTimeZoneDetails, getTimeZoneIds, getTimestamp, parseMSec, parseMSec as parseMs };
|
package/dist/dom.cjs
CHANGED
|
@@ -16,11 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
19
|
-
const require_specials = require('./specials-
|
|
20
|
-
const require_guards = require('./guards-
|
|
21
|
-
const require_basics = require('./basics-
|
|
22
|
-
const require_objectify = require('./objectify-
|
|
23
|
-
const require_utils = require('./utils-BxguWSoa.cjs');
|
|
19
|
+
const require_specials = require('./specials-dkYP1Nh2.cjs');
|
|
20
|
+
const require_guards = require('./guards-Bsh6Bfdq.cjs');
|
|
21
|
+
const require_basics = require('./basics-CJmdhXoo.cjs');
|
|
22
|
+
const require_objectify = require('./objectify-xQvZS3UI.cjs');
|
|
24
23
|
|
|
25
24
|
//#region src/dom/query.ts
|
|
26
25
|
/**
|
|
@@ -80,7 +79,7 @@ function parseQueryString(query, parsePrimitives = true) {
|
|
|
80
79
|
for (const [key, value] of params.entries()) if (key in entries) {
|
|
81
80
|
const current = entries[key];
|
|
82
81
|
const array = Array.isArray(current) ? [...current, value] : [current, value];
|
|
83
|
-
entries[key] = parsePrimitives ?
|
|
82
|
+
entries[key] = parsePrimitives ? require_basics.deepParsePrimitives(array) : array;
|
|
84
83
|
} else entries[key] = value;
|
|
85
84
|
return parsePrimitives ? require_objectify.parseObjectValues(entries) : entries;
|
|
86
85
|
}
|
package/dist/dom.d.cts
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-
|
|
17
|
+
import { J as Deserializer, M as ParsedQueryGeneric, N as QueryObject, ft as Serializer, j as ParsedQuery, y as GenericObject } from "./object-Mglyg4AW.cjs";
|
|
18
|
+
import { F as QueryString } from "./string-BDwBuik3.cjs";
|
|
19
|
+
import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-CC9T9WnX.cjs";
|
|
20
20
|
|
|
21
21
|
//#region src/dom/query.d.ts
|
|
22
22
|
/**
|
package/dist/dom.d.mts
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-
|
|
17
|
+
import { J as Deserializer, M as ParsedQueryGeneric, N as QueryObject, ft as Serializer, j as ParsedQuery, y as GenericObject } from "./object-Mglyg4AW.mjs";
|
|
18
|
+
import { F as QueryString } from "./string-_1ImwUJT.mjs";
|
|
19
|
+
import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-CheKmgjj.mjs";
|
|
20
20
|
|
|
21
21
|
//#region src/dom/query.d.ts
|
|
22
22
|
/**
|
package/dist/dom.mjs
CHANGED
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString, d as isString } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import { j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-
|
|
19
|
-
import { t as isDateLike } from "./guards-
|
|
20
|
-
import { n as trimString } from "./basics-
|
|
21
|
-
import { _ as isOriginFileObj, a as flattenObjectKeyValue, d as isCustomFile, f as isCustomFileArray, g as isFileUpload, h as isFileOrBlob, l as parseObjectValues, m as isFileList, p as isFileArray, v as isValidFormData } from "./objectify-
|
|
22
|
-
import { a as deepParsePrimitives } from "./utils-DXovsTKs.mjs";
|
|
18
|
+
import { j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-Hq5Ncd6y.mjs";
|
|
19
|
+
import { t as isDateLike } from "./guards-BK1QuvFZ.mjs";
|
|
20
|
+
import { I as deepParsePrimitives, n as trimString } from "./basics-CebgkY-n.mjs";
|
|
21
|
+
import { _ as isOriginFileObj, a as flattenObjectKeyValue, d as isCustomFile, f as isCustomFileArray, g as isFileUpload, h as isFileOrBlob, l as parseObjectValues, m as isFileList, p as isFileArray, v as isValidFormData } from "./objectify-CQa8gQib.mjs";
|
|
23
22
|
|
|
24
23
|
//#region src/dom/query.ts
|
|
25
24
|
/**
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { S as KeyForObject, T as NestedKeyString, ii as RequireExactly, u as DotNotationKey, x as KeyForArray } from "./object-Mglyg4AW.cjs";
|
|
18
|
+
import { F as QueryString } from "./string-BDwBuik3.cjs";
|
|
19
19
|
|
|
20
20
|
//#region src/types/form.d.ts
|
|
21
21
|
/** - Configuration options to control FormData generation behavior. */
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { S as KeyForObject, T as NestedKeyString, ii as RequireExactly, u as DotNotationKey, x as KeyForArray } from "./object-Mglyg4AW.mjs";
|
|
18
|
+
import { F as QueryString } from "./string-_1ImwUJT.mjs";
|
|
19
19
|
|
|
20
20
|
//#region src/types/form.d.ts
|
|
21
21
|
/** - Configuration options to control FormData generation behavior. */
|