@formkit/tempo 0.1.2 → 1.1.0
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/README.md +22 -1
- package/dist/add.d.ts +11 -0
- package/dist/add.mjs +50 -0
- package/dist/add.mjs.map +1 -0
- package/dist/addDay.d.ts +4 -3
- package/dist/addDay.mjs.map +1 -1
- package/dist/addHour.d.ts +4 -3
- package/dist/addHour.mjs.map +1 -1
- package/dist/addMillisecond.d.ts +10 -0
- package/dist/addMillisecond.mjs +11 -0
- package/dist/addMillisecond.mjs.map +1 -0
- package/dist/addMinute.d.ts +5 -4
- package/dist/addMinute.mjs.map +1 -1
- package/dist/addMonth.d.ts +5 -5
- package/dist/addMonth.mjs +2 -12
- package/dist/addMonth.mjs.map +1 -1
- package/dist/addSecond.d.ts +4 -3
- package/dist/addSecond.mjs.map +1 -1
- package/dist/addYear.d.ts +5 -5
- package/dist/addYear.mjs +6 -12
- package/dist/addYear.mjs.map +1 -1
- package/dist/ap.mjs +1 -2
- package/dist/ap.mjs.map +1 -1
- package/dist/applyOffset.d.ts +5 -5
- package/dist/applyOffset.mjs +5 -11
- package/dist/applyOffset.mjs.map +1 -1
- package/dist/bundle.d.ts +365 -115
- package/dist/bundle.mjs +364 -180
- package/dist/bundle.mjs.map +1 -1
- package/dist/common.d.ts +27 -7
- package/dist/common.mjs +47 -42
- package/dist/common.mjs.map +1 -1
- package/dist/date.d.ts +2 -2
- package/dist/date.mjs +1 -3
- package/dist/date.mjs.map +1 -1
- package/dist/dayEnd.d.ts +3 -3
- package/dist/dayEnd.mjs.map +1 -1
- package/dist/dayOfYear.d.ts +3 -3
- package/dist/dayOfYear.mjs.map +1 -1
- package/dist/dayStart.d.ts +3 -3
- package/dist/dayStart.mjs +1 -1
- package/dist/dayStart.mjs.map +1 -1
- package/dist/diff.d.ts +38 -0
- package/dist/diff.mjs +86 -0
- package/dist/diff.mjs.map +1 -0
- package/dist/diffDays.d.ts +12 -5
- package/dist/diffDays.mjs +1 -0
- package/dist/diffDays.mjs.map +1 -1
- package/dist/diffHours.d.ts +12 -5
- package/dist/diffHours.mjs +1 -0
- package/dist/diffHours.mjs.map +1 -1
- package/dist/diffMilliseconds.d.ts +10 -4
- package/dist/diffMilliseconds.mjs.map +1 -1
- package/dist/diffMinutes.d.ts +11 -3
- package/dist/diffMinutes.mjs +5 -1
- package/dist/diffMinutes.mjs.map +1 -1
- package/dist/diffMonths.d.ts +10 -4
- package/dist/diffMonths.mjs.map +1 -1
- package/dist/diffSeconds.d.ts +12 -5
- package/dist/diffSeconds.mjs +5 -1
- package/dist/diffSeconds.mjs.map +1 -1
- package/dist/diffWeeks.d.ts +10 -3
- package/dist/diffWeeks.mjs.map +1 -1
- package/dist/diffYears.d.ts +10 -4
- package/dist/diffYears.mjs +4 -1
- package/dist/diffYears.mjs.map +1 -1
- package/dist/format.mjs +2 -3
- package/dist/format.mjs.map +1 -1
- package/dist/handleDateOverflow.d.ts +12 -0
- package/dist/handleDateOverflow.mjs +18 -0
- package/dist/handleDateOverflow.mjs.map +1 -0
- package/dist/hourEnd.d.ts +3 -3
- package/dist/hourEnd.mjs.map +1 -1
- package/dist/hourStart.d.ts +3 -3
- package/dist/hourStart.mjs +1 -1
- package/dist/hourStart.mjs.map +1 -1
- package/dist/index.cjs +380 -183
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +365 -115
- package/dist/index.d.ts +14 -1
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -1
- package/dist/isAfter.d.ts +6 -6
- package/dist/isAfter.mjs.map +1 -1
- package/dist/isBefore.d.ts +5 -5
- package/dist/isBefore.mjs.map +1 -1
- package/dist/isEqual.d.ts +13 -4
- package/dist/isEqual.mjs.map +1 -1
- package/dist/isFuture.d.ts +10 -0
- package/dist/isFuture.mjs +9 -0
- package/dist/isFuture.mjs.map +1 -0
- package/dist/isPast.d.ts +10 -0
- package/dist/isPast.mjs +9 -0
- package/dist/isPast.mjs.map +1 -0
- package/dist/iso8601.d.ts +1 -1
- package/dist/iso8601.mjs +4 -7
- package/dist/iso8601.mjs.map +1 -1
- package/dist/minuteEnd.d.ts +3 -3
- package/dist/minuteEnd.mjs.map +1 -1
- package/dist/minuteStart.d.ts +3 -3
- package/dist/minuteStart.mjs +1 -1
- package/dist/minuteStart.mjs.map +1 -1
- package/dist/monthDays.d.ts +3 -3
- package/dist/monthDays.mjs.map +1 -1
- package/dist/monthEnd.d.ts +3 -3
- package/dist/monthEnd.mjs.map +1 -1
- package/dist/monthStart.d.ts +3 -3
- package/dist/monthStart.mjs +1 -1
- package/dist/monthStart.mjs.map +1 -1
- package/dist/nearestDay.d.ts +3 -3
- package/dist/nearestDay.mjs +2 -4
- package/dist/nearestDay.mjs.map +1 -1
- package/dist/offset.d.ts +5 -5
- package/dist/offset.mjs +16 -16
- package/dist/offset.mjs.map +1 -1
- package/dist/parse.mjs +33 -23
- package/dist/parse.mjs.map +1 -1
- package/dist/parts.mjs +14 -24
- package/dist/parts.mjs.map +1 -1
- package/dist/range.mjs +1 -2
- package/dist/range.mjs.map +1 -1
- package/dist/removeOffset.d.ts +4 -4
- package/dist/removeOffset.mjs.map +1 -1
- package/dist/sameDay.d.ts +8 -2
- package/dist/sameDay.mjs.map +1 -1
- package/dist/sameHour.d.ts +8 -2
- package/dist/sameHour.mjs.map +1 -1
- package/dist/sameMillisecond.d.ts +16 -0
- package/dist/sameMillisecond.mjs +11 -0
- package/dist/sameMillisecond.mjs.map +1 -0
- package/dist/sameMinute.d.ts +8 -2
- package/dist/sameMinute.mjs.map +1 -1
- package/dist/sameMonth.d.ts +16 -0
- package/dist/sameMonth.mjs +11 -0
- package/dist/sameMonth.mjs.map +1 -0
- package/dist/sameSecond.d.ts +8 -2
- package/dist/sameSecond.mjs.map +1 -1
- package/dist/sameYear.d.ts +8 -2
- package/dist/sameYear.mjs.map +1 -1
- package/dist/setDayOfMonth.d.ts +11 -0
- package/dist/setDayOfMonth.mjs +16 -0
- package/dist/setDayOfMonth.mjs.map +1 -0
- package/dist/setHour.d.ts +10 -0
- package/dist/setHour.mjs +11 -0
- package/dist/setHour.mjs.map +1 -0
- package/dist/setMilliseconds.d.ts +10 -0
- package/dist/setMilliseconds.mjs +11 -0
- package/dist/setMilliseconds.mjs.map +1 -0
- package/dist/setMinutes.d.ts +10 -0
- package/dist/setMinutes.mjs +11 -0
- package/dist/setMinutes.mjs.map +1 -0
- package/dist/setMonth.d.ts +11 -0
- package/dist/setMonth.mjs +9 -0
- package/dist/setMonth.mjs.map +1 -0
- package/dist/setSeconds.d.ts +10 -0
- package/dist/setSeconds.mjs +11 -0
- package/dist/setSeconds.mjs.map +1 -0
- package/dist/setYear.d.ts +11 -0
- package/dist/setYear.mjs +9 -0
- package/dist/setYear.mjs.map +1 -0
- package/dist/types.d.ts +29 -7
- package/dist/tzDate.d.ts +5 -3
- package/dist/tzDate.mjs.map +1 -1
- package/dist/weekEnd.d.ts +4 -4
- package/dist/weekEnd.mjs +1 -1
- package/dist/weekEnd.mjs.map +1 -1
- package/dist/weekStart.d.ts +4 -4
- package/dist/weekStart.mjs +2 -3
- package/dist/weekStart.mjs.map +1 -1
- package/dist/yearDays.d.ts +3 -3
- package/dist/yearDays.mjs.map +1 -1
- package/dist/yearEnd.d.ts +3 -3
- package/dist/yearEnd.mjs +1 -2
- package/dist/yearEnd.mjs.map +1 -1
- package/dist/yearStart.d.ts +3 -3
- package/dist/yearStart.mjs +2 -3
- package/dist/yearStart.mjs.map +1 -1
- package/package.json +32 -23
package/dist/sameSecond.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sameSecond.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { DateInput } from \"./types\"\n\n/**\n * Checks if two date objects refer to the same time seconds. Ignores date.\n * @param inputDateA - First date to compare\n * @param inputDateB - Second date to compare\n */\nexport function sameSecond(inputDateA: DateInput, inputDateB: DateInput) {\n const a = date(inputDateA)\n const b = date(inputDateB)\n return a.getSeconds() === b.getSeconds()\n}\n"],"mappings":";AAAA,SAAS,YAAY;
|
|
1
|
+
{"version":3,"sources":["../src/sameSecond.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { DateInput, MaybeDateInput } from \"./types\"\n\n/**\n * Checks if two date objects refer to the same time seconds. Ignores date.\n * @param inputDateA - First date to compare\n * @param [inputDateB] - Second date to compare or the current time if nothing given\n */\nexport function sameSecond(inputDateA: DateInput, inputDateB?: MaybeDateInput): boolean\n/**\n * Checks if two date objects refer to the same time seconds. Ignores date.\n * @param [inputDateA] - First date to compare or the current time if null given\n * @param inputDateB - Second date to compare\n */\nexport function sameSecond(inputDateA: MaybeDateInput, inputDateB: DateInput): boolean\nexport function sameSecond(\n inputDateA: MaybeDateInput,\n inputDateB?: MaybeDateInput\n): boolean {\n const a = date(inputDateA)\n const b = date(inputDateB)\n return a.getSeconds() === b.getSeconds()\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAed,SAAS,WACd,YACA,YACS;AACT,QAAM,IAAI,KAAK,UAAU;AACzB,QAAM,IAAI,KAAK,UAAU;AACzB,SAAO,EAAE,WAAW,MAAM,EAAE,WAAW;AACzC;","names":[]}
|
package/dist/sameYear.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { DateInput } from './types.js';
|
|
1
|
+
import { DateInput, MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if two date objects refer to the same year.
|
|
5
5
|
* @param inputDateA - First date to compare
|
|
6
|
+
* @param [inputDateB] - Second date to compare or the current time if null given
|
|
7
|
+
*/
|
|
8
|
+
declare function sameYear(inputDateA: DateInput, inputDateB?: MaybeDateInput): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if two date objects refer to the same year.
|
|
11
|
+
* @param [inputDateA] - First date to compare or the current time if null given
|
|
6
12
|
* @param inputDateB - Second date to compare
|
|
7
13
|
*/
|
|
8
|
-
declare function sameYear(inputDateA:
|
|
14
|
+
declare function sameYear(inputDateA: MaybeDateInput, inputDateB: DateInput): boolean;
|
|
9
15
|
|
|
10
16
|
export { sameYear };
|
package/dist/sameYear.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sameYear.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { DateInput } from \"./types\"\n\n/**\n * Checks if two date objects refer to the same year.\n * @param inputDateA - First date to compare\n * @param inputDateB - Second date to compare\n */\nexport function sameYear(inputDateA: DateInput, inputDateB: DateInput) {\n const a = date(inputDateA)\n const b = date(inputDateB)\n return a.getFullYear() === b.getFullYear()\n}\n"],"mappings":";AAAA,SAAS,YAAY;
|
|
1
|
+
{"version":3,"sources":["../src/sameYear.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { DateInput, MaybeDateInput } from \"./types\"\n\n/**\n * Checks if two date objects refer to the same year.\n * @param inputDateA - First date to compare\n * @param [inputDateB] - Second date to compare or the current time if null given\n */\nexport function sameYear(inputDateA: DateInput, inputDateB?: MaybeDateInput): boolean\n/**\n * Checks if two date objects refer to the same year.\n * @param [inputDateA] - First date to compare or the current time if null given\n * @param inputDateB - Second date to compare\n */\nexport function sameYear(inputDateA: MaybeDateInput, inputDateB: DateInput): boolean\nexport function sameYear(\n inputDateA: MaybeDateInput,\n inputDateB?: MaybeDateInput\n): boolean {\n const a = date(inputDateA)\n const b = date(inputDateB)\n return a.getFullYear() === b.getFullYear()\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAed,SAAS,SACd,YACA,YACS;AACT,QAAM,IAAI,KAAK,UAAU;AACzB,QAAM,IAAI,KAAK,UAAU;AACzB,SAAO,EAAE,YAAY,MAAM,EAAE,YAAY;AAC3C;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the day of the month in a date object
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param day - the day of the month you want the date set to (1-28/29/30/31) (can over/underflow)
|
|
7
|
+
* @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the given day isn't in the current month
|
|
8
|
+
*/
|
|
9
|
+
declare function setDayOfMonth(inputDate: MaybeDateInput, day: number, dateOverflow?: boolean): Date;
|
|
10
|
+
|
|
11
|
+
export { setDayOfMonth };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/setDayOfMonth.ts
|
|
2
|
+
import { date } from "./date.mjs";
|
|
3
|
+
import { monthDays } from "./monthDays.mjs";
|
|
4
|
+
function setDayOfMonth(inputDate, day, dateOverflow = false) {
|
|
5
|
+
const d = date(inputDate);
|
|
6
|
+
const daysInMonth = monthDays(d);
|
|
7
|
+
if (!dateOverflow) {
|
|
8
|
+
day = day > daysInMonth ? daysInMonth : day;
|
|
9
|
+
}
|
|
10
|
+
d.setDate(day);
|
|
11
|
+
return d;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
setDayOfMonth
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=setDayOfMonth.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setDayOfMonth.ts"],"sourcesContent":["import { date } from \"./date\"\nimport { monthDays } from \"./monthDays\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the day of the month in a date object\n * @param [inputDate] - a date or null for current time\n * @param day - the day of the month you want the date set to (1-28/29/30/31) (can over/underflow)\n * @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the given day isn't in the current month\n */\nexport function setDayOfMonth(\n inputDate: MaybeDateInput,\n day: number,\n dateOverflow = false\n): Date {\n const d = date(inputDate)\n const daysInMonth = monthDays(d)\n if (!dateOverflow) {\n day = day > daysInMonth ? daysInMonth : day\n }\n d.setDate(day)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,iBAAiB;AASnB,SAAS,cACd,WACA,KACA,eAAe,OACT;AACN,QAAM,IAAI,KAAK,SAAS;AACxB,QAAM,cAAc,UAAU,CAAC;AAC/B,MAAI,CAAC,cAAc;AACjB,UAAM,MAAM,cAAc,cAAc;AAAA,EAC1C;AACA,IAAE,QAAQ,GAAG;AACb,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the hour of a date object
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param hour - the hour you want the date set to (0 - 23) (can over/underflow)
|
|
7
|
+
*/
|
|
8
|
+
declare function setHour(inputDate: MaybeDateInput, hour: number): Date;
|
|
9
|
+
|
|
10
|
+
export { setHour };
|
package/dist/setHour.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setHour.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the hour of a date object\n * @param [inputDate] - a date or null for current time\n * @param hour - the hour you want the date set to (0 - 23) (can over/underflow)\n */\nexport function setHour(inputDate: MaybeDateInput, hour: number): Date {\n const d = date(inputDate)\n d.setHours(hour)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAQd,SAAS,QAAQ,WAA2B,MAAoB;AACrE,QAAM,IAAI,KAAK,SAAS;AACxB,IAAE,SAAS,IAAI;AACf,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the millisecond of a date object
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param ms - the milliseconds you want the date set to (0 - 999) (can over/underflow)
|
|
7
|
+
*/
|
|
8
|
+
declare function setMilliseconds(inputDate: MaybeDateInput, ms: number): Date;
|
|
9
|
+
|
|
10
|
+
export { setMilliseconds };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/setMilliseconds.ts
|
|
2
|
+
import { date } from "./date.mjs";
|
|
3
|
+
function setMilliseconds(inputDate, ms) {
|
|
4
|
+
const d = date(inputDate);
|
|
5
|
+
d.setMilliseconds(ms);
|
|
6
|
+
return d;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
setMilliseconds
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=setMilliseconds.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setMilliseconds.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the millisecond of a date object\n * @param [inputDate] - a date or null for current time\n * @param ms - the milliseconds you want the date set to (0 - 999) (can over/underflow)\n */\nexport function setMilliseconds(inputDate: MaybeDateInput, ms: number): Date {\n const d = date(inputDate)\n d.setMilliseconds(ms)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAQd,SAAS,gBAAgB,WAA2B,IAAkB;AAC3E,QAAM,IAAI,KAAK,SAAS;AACxB,IAAE,gBAAgB,EAAE;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the minute of a date object
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param minute - the minute you want the date set to (0 - 59) (can over/underflow)
|
|
7
|
+
*/
|
|
8
|
+
declare function setMinutes(inputDate: MaybeDateInput, minute: number): Date;
|
|
9
|
+
|
|
10
|
+
export { setMinutes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setMinutes.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the minute of a date object\n * @param [inputDate] - a date or null for current time\n * @param minute - the minute you want the date set to (0 - 59) (can over/underflow)\n */\nexport function setMinutes(inputDate: MaybeDateInput, minute: number): Date {\n const d = date(inputDate)\n d.setMinutes(minute)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAQd,SAAS,WAAW,WAA2B,QAAsB;AAC1E,QAAM,IAAI,KAAK,SAAS;AACxB,IAAE,WAAW,MAAM;AACnB,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the month of a date
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param month - the zero-based month to set (0-11, where 0 is January) (can over/underflow)
|
|
7
|
+
* @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.
|
|
8
|
+
*/
|
|
9
|
+
declare function setMonth(inputDate: MaybeDateInput, month: number, dateOverflow?: boolean): Date;
|
|
10
|
+
|
|
11
|
+
export { setMonth };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/setMonth.ts
|
|
2
|
+
import { handleOverflow } from "./handleDateOverflow.mjs";
|
|
3
|
+
function setMonth(inputDate, month, dateOverflow = false) {
|
|
4
|
+
return handleOverflow(inputDate, (d) => d.setMonth(month), dateOverflow);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
setMonth
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=setMonth.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setMonth.ts"],"sourcesContent":["import { handleOverflow } from \"./handleDateOverflow\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the month of a date\n * @param [inputDate] - a date or null for current time\n * @param month - the zero-based month to set (0-11, where 0 is January) (can over/underflow)\n * @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.\n */\nexport function setMonth(\n inputDate: MaybeDateInput,\n month: number,\n dateOverflow = false\n): Date {\n return handleOverflow(inputDate, (d) => d.setMonth(month), dateOverflow)\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AASxB,SAAS,SACd,WACA,OACA,eAAe,OACT;AACN,SAAO,eAAe,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,GAAG,YAAY;AACzE;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the second of a date object
|
|
5
|
+
* @param [inputDate] - a date or null for current time
|
|
6
|
+
* @param second - the second you want the date set to (0 - 59) (can over/underflow)
|
|
7
|
+
*/
|
|
8
|
+
declare function setSeconds(inputDate: MaybeDateInput, second: number): Date;
|
|
9
|
+
|
|
10
|
+
export { setSeconds };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setSeconds.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * set the second of a date object\n * @param [inputDate] - a date or null for current time\n * @param second - the second you want the date set to (0 - 59) (can over/underflow)\n */\nexport function setSeconds(inputDate: MaybeDateInput, second: number): Date {\n const d = date(inputDate)\n d.setSeconds(second)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAQd,SAAS,WAAW,WAA2B,QAAsB;AAC1E,QAAM,IAAI,KAAK,SAAS;AACxB,IAAE,WAAW,MAAM;AACnB,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* set the year of a date object
|
|
5
|
+
* @param inputDate - a date or null for current time
|
|
6
|
+
* @param year - the full year you want the date to be set to
|
|
7
|
+
* @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.
|
|
8
|
+
*/
|
|
9
|
+
declare function setYear(inputDate: MaybeDateInput, year: number, dateOverflow?: boolean): Date;
|
|
10
|
+
|
|
11
|
+
export { setYear };
|
package/dist/setYear.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/setYear.ts
|
|
2
|
+
import { handleOverflow } from "./handleDateOverflow.mjs";
|
|
3
|
+
function setYear(inputDate, year, dateOverflow = false) {
|
|
4
|
+
return handleOverflow(inputDate, (d) => d.setFullYear(year), dateOverflow);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
setYear
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=setYear.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/setYear.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\nimport { handleOverflow } from \"./handleDateOverflow\"\n\n/**\n * set the year of a date object\n * @param inputDate - a date or null for current time\n * @param year - the full year you want the date to be set to\n * @param [dateOverflow] - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.\n */\nexport function setYear(\n inputDate: MaybeDateInput,\n year: number,\n dateOverflow = false\n): Date {\n return handleOverflow(inputDate, (d) => d.setFullYear(year), dateOverflow)\n}\n"],"mappings":";AAEA,SAAS,sBAAsB;AAQxB,SAAS,QACd,WACA,MACA,eAAe,OACT;AACN,SAAO,eAAe,WAAW,CAAC,MAAM,EAAE,YAAY,IAAI,GAAG,YAAY;AAC3E;","names":[]}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
* The date format used as an input value. Either a date or an ISO8601 string.
|
|
3
3
|
*/
|
|
4
4
|
type DateInput = Date | string;
|
|
5
|
+
/**
|
|
6
|
+
* The date format used as a maybe input value. Either a date, ISO8601 string or null for current time
|
|
7
|
+
*/
|
|
8
|
+
type MaybeDateInput = DateInput | null;
|
|
5
9
|
/**
|
|
6
10
|
* Format parts with text names use these descriptors:
|
|
7
11
|
*/
|
|
8
12
|
type NamedFormatOption = "long" | "short" | "narrow";
|
|
13
|
+
/**
|
|
14
|
+
* Extended part types that include custom tokens not in Intl.DateTimeFormatPartTypes.
|
|
15
|
+
*/
|
|
16
|
+
type ExtendedPartTypes = Intl.DateTimeFormatPartTypes | "fractionalSecond";
|
|
9
17
|
/**
|
|
10
18
|
* A registry of named format parts. Each type of part has every option.
|
|
11
19
|
*/
|
|
@@ -28,11 +36,11 @@ interface Part {
|
|
|
28
36
|
option: FormatPattern[1];
|
|
29
37
|
/**
|
|
30
38
|
* The name of the part, these must be valid parts of a date format as
|
|
31
|
-
* specified in Intl.DateTimeFormatPartTypes
|
|
32
|
-
* day, dayPeriod, era, hour, literal, minute, month,
|
|
33
|
-
* weekday, year
|
|
39
|
+
* specified in Intl.DateTimeFormatPartTypes, plus custom extensions.
|
|
40
|
+
* Valid values are: day, dayPeriod, era, hour, literal, minute, month,
|
|
41
|
+
* second, timeZoneName, weekday, year, fractionalSecond
|
|
34
42
|
*/
|
|
35
|
-
partName:
|
|
43
|
+
partName: ExtendedPartTypes;
|
|
36
44
|
/**
|
|
37
45
|
* The value of a given part. For example "2-digit", or "narrow".
|
|
38
46
|
*/
|
|
@@ -61,7 +69,7 @@ type FilledPart = Part & {
|
|
|
61
69
|
*/
|
|
62
70
|
type FormatPattern = [
|
|
63
71
|
pattern: FormatToken | string,
|
|
64
|
-
option: Partial<Record<
|
|
72
|
+
option: Partial<Record<ExtendedPartTypes, string>>,
|
|
65
73
|
exp?: RegExp
|
|
66
74
|
];
|
|
67
75
|
/**
|
|
@@ -83,7 +91,7 @@ type Format = FormatStyle | FormatStyleObj | (string & {});
|
|
|
83
91
|
/**
|
|
84
92
|
* A union of all available formatting tokens.
|
|
85
93
|
*/
|
|
86
|
-
type FormatToken = "YYYY" | "YY" | "MMMM" | "MMM" | "MM" | "M" | "DD" | "D" | "dddd" | "ddd" | "d" | "mm" | "m" | "ss" | "s" | "HH" | "H" | "hh" | "h" | "a" | "A" | "ZZ" | "Z";
|
|
94
|
+
type FormatToken = "YYYY" | "YY" | "MMMM" | "MMM" | "MM" | "M" | "DD" | "D" | "dddd" | "ddd" | "d" | "mm" | "m" | "ss" | "s" | "SSS" | "HH" | "H" | "hh" | "h" | "a" | "A" | "ZZ" | "Z";
|
|
87
95
|
interface ParseOptions {
|
|
88
96
|
/**
|
|
89
97
|
* A string representing a date.
|
|
@@ -139,5 +147,19 @@ interface FormatOptions {
|
|
|
139
147
|
*/
|
|
140
148
|
partFilter?: (part: Part) => boolean;
|
|
141
149
|
}
|
|
150
|
+
interface Duration {
|
|
151
|
+
years?: number;
|
|
152
|
+
months?: number;
|
|
153
|
+
weeks?: number;
|
|
154
|
+
days?: number;
|
|
155
|
+
hours?: number;
|
|
156
|
+
minutes?: number;
|
|
157
|
+
seconds?: number;
|
|
158
|
+
milliseconds?: number;
|
|
159
|
+
}
|
|
160
|
+
interface DurationObj extends Duration {
|
|
161
|
+
microseconds?: number;
|
|
162
|
+
nanoseconds?: number;
|
|
163
|
+
}
|
|
142
164
|
|
|
143
|
-
export type { DateInput, FilledPart, Format, FormatOptions, FormatPattern, FormatStyle, FormatStyleObj, FormatToken, NamedFormatOption, NamedFormats, ParseOptions, Part };
|
|
165
|
+
export type { DateInput, Duration, DurationObj, ExtendedPartTypes, FilledPart, Format, FormatOptions, FormatPattern, FormatStyle, FormatStyleObj, FormatToken, MaybeDateInput, NamedFormatOption, NamedFormats, ParseOptions, Part };
|
package/dist/tzDate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Creates a date object for the input date at the given timezone. For example
|
|
@@ -7,9 +7,11 @@ import { DateInput } from './types.js';
|
|
|
7
7
|
*
|
|
8
8
|
* If given a Date object it will use local time and convert it to the given
|
|
9
9
|
* timezone, thus "changing" the date.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* if given no string or date object, it'll use the current locale time and convert to the given timezone
|
|
12
|
+
* @param [inputDate] - An iso8601 date string with no timezone
|
|
11
13
|
* @param tz - A timezone string
|
|
12
14
|
*/
|
|
13
|
-
declare function tzDate(inputDate:
|
|
15
|
+
declare function tzDate(inputDate: MaybeDateInput, tz: string): Date;
|
|
14
16
|
|
|
15
17
|
export { tzDate };
|
package/dist/tzDate.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tzDate.ts"],"sourcesContent":["import { offset } from \"./offset\"\nimport { applyOffset } from \"./applyOffset\"\nimport { date } from \"./date\"\nimport { DateInput } from \"./types\"\n\n/**\n * Creates a date object for the input date at the given timezone. For example\n * `tzDate(\"2017-05-06T12:00\", \"Europe/Amsterdam\")` will return a date object\n * for 2017-05-06T10:00:00Z since 12:00 in Amsterdam is 10:00Z.\n *\n * If given a Date object it will use local time and convert it to the given\n * timezone, thus \"changing\" the date.\n * @param inputDate - An iso8601 date string with no timezone\n * @param tz - A timezone string\n */\nexport function tzDate(inputDate:
|
|
1
|
+
{"version":3,"sources":["../src/tzDate.ts"],"sourcesContent":["import { offset } from \"./offset\"\nimport { applyOffset } from \"./applyOffset\"\nimport { date } from \"./date\"\nimport { DateInput, MaybeDateInput } from \"./types\"\n\n/**\n * Creates a date object for the input date at the given timezone. For example\n * `tzDate(\"2017-05-06T12:00\", \"Europe/Amsterdam\")` will return a date object\n * for 2017-05-06T10:00:00Z since 12:00 in Amsterdam is 10:00Z.\n *\n * If given a Date object it will use local time and convert it to the given\n * timezone, thus \"changing\" the date.\n *\n * if given no string or date object, it'll use the current locale time and convert to the given timezone\n * @param [inputDate] - An iso8601 date string with no timezone\n * @param tz - A timezone string\n */\nexport function tzDate(inputDate: MaybeDateInput, tz: string) {\n const d = date(inputDate)\n return applyOffset(d, offset(d, tz))\n}\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AAed,SAAS,OAAO,WAA2B,IAAY;AAC5D,QAAM,IAAI,KAAK,SAAS;AACxB,SAAO,YAAY,GAAG,OAAO,GAAG,EAAE,CAAC;AACrC;","names":[]}
|
package/dist/weekEnd.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a Date object for the last day at the last second of the given week.
|
|
5
5
|
* Defaults to Sunday as the first day of the week:
|
|
6
6
|
* 0 = Sunday ... 6 = Saturday
|
|
7
|
-
* @param inputDate - Gets the last day of the week
|
|
8
|
-
* @param startOfWeekDay - The first day of the week
|
|
7
|
+
* @param [inputDate] - Gets the last day of the week
|
|
8
|
+
* @param [startOfWeekDay] - The first day of the week
|
|
9
9
|
*/
|
|
10
|
-
declare function weekEnd(inputDate
|
|
10
|
+
declare function weekEnd(inputDate?: MaybeDateInput, startOfWeekDay?: number): Date;
|
|
11
11
|
|
|
12
12
|
export { weekEnd };
|
package/dist/weekEnd.mjs
CHANGED
package/dist/weekEnd.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weekEnd.ts"],"sourcesContent":["import { weekStart } from \"./weekStart\"\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/weekEnd.ts"],"sourcesContent":["import { weekStart } from \"./weekStart\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * Returns a Date object for the last day at the last second of the given week.\n * Defaults to Sunday as the first day of the week:\n * 0 = Sunday ... 6 = Saturday\n * @param [inputDate] - Gets the last day of the week\n * @param [startOfWeekDay] - The first day of the week\n */\nexport function weekEnd(inputDate?: MaybeDateInput, startOfWeekDay = 0): Date {\n const d = weekStart(inputDate, startOfWeekDay)\n d.setDate(d.getDate() + 6)\n d.setHours(23, 59, 59, 999)\n return d\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAUnB,SAAS,QAAQ,WAA4B,iBAAiB,GAAS;AAC5E,QAAM,IAAI,UAAU,WAAW,cAAc;AAC7C,IAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC;AACzB,IAAE,SAAS,IAAI,IAAI,IAAI,GAAG;AAC1B,SAAO;AACT;","names":[]}
|
package/dist/weekStart.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a Date object for start of the given week. Defaults to Sunday as the
|
|
5
5
|
* first day of the week:
|
|
6
6
|
* 0 = Sunday ... 6 = Saturday
|
|
7
|
-
* @param inputDate - A string or
|
|
8
|
-
* @param startOfWeekDay - Determines which day of the week is the first
|
|
7
|
+
* @param [inputDate] - A string, Date object or nothing for current week
|
|
8
|
+
* @param [startOfWeekDay] - Determines which day of the week is the first
|
|
9
9
|
*/
|
|
10
|
-
declare function weekStart(inputDate
|
|
10
|
+
declare function weekStart(inputDate?: MaybeDateInput, startOfWeekDay?: number): Date;
|
|
11
11
|
|
|
12
12
|
export { weekStart };
|
package/dist/weekStart.mjs
CHANGED
|
@@ -3,10 +3,9 @@ import { date } from "./date.mjs";
|
|
|
3
3
|
function weekStart(inputDate, startOfWeekDay = 0) {
|
|
4
4
|
const d = date(inputDate);
|
|
5
5
|
let diff = startOfWeekDay - d.getDay();
|
|
6
|
-
if (diff > 0)
|
|
7
|
-
diff = diff - 7;
|
|
6
|
+
if (diff > 0) diff = diff - 7;
|
|
8
7
|
d.setDate(d.getDate() + diff);
|
|
9
|
-
d.setHours(0, 0, 0);
|
|
8
|
+
d.setHours(0, 0, 0, 0);
|
|
10
9
|
return d;
|
|
11
10
|
}
|
|
12
11
|
export {
|
package/dist/weekStart.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weekStart.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/weekStart.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * Returns a Date object for start of the given week. Defaults to Sunday as the\n * first day of the week:\n * 0 = Sunday ... 6 = Saturday\n * @param [inputDate] - A string, Date object or nothing for current week\n * @param [startOfWeekDay] - Determines which day of the week is the first\n */\nexport function weekStart(inputDate?: MaybeDateInput, startOfWeekDay = 0): Date {\n const d = date(inputDate)\n let diff = startOfWeekDay - d.getDay()\n if (diff > 0) diff = diff - 7\n d.setDate(d.getDate() + diff)\n d.setHours(0, 0, 0, 0)\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAUd,SAAS,UAAU,WAA4B,iBAAiB,GAAS;AAC9E,QAAM,IAAI,KAAK,SAAS;AACxB,MAAI,OAAO,iBAAiB,EAAE,OAAO;AACrC,MAAI,OAAO,EAAG,QAAO,OAAO;AAC5B,IAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI;AAC5B,IAAE,SAAS,GAAG,GAAG,GAAG,CAAC;AACrB,SAAO;AACT;","names":[]}
|
package/dist/yearDays.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get the number of days in the given date’s year.
|
|
5
|
-
* @param inputDate -
|
|
5
|
+
* @param [inputDate] - A string, Date object or nothing for the current year
|
|
6
6
|
*/
|
|
7
|
-
declare function yearDays(inputDate
|
|
7
|
+
declare function yearDays(inputDate?: MaybeDateInput): number;
|
|
8
8
|
|
|
9
9
|
export { yearDays };
|
package/dist/yearDays.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/yearDays.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/yearDays.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * Get the number of days in the given date’s year.\n * @param [inputDate] - A string, Date object or nothing for the current year\n */\nexport function yearDays(inputDate?: MaybeDateInput): number {\n const d = date(inputDate)\n return (\n (new Date(d.getFullYear() + 1, 0, 0).getTime() -\n new Date(d.getFullYear(), 0, 0).getTime()) /\n 86400000\n )\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAOd,SAAS,SAAS,WAAoC;AAC3D,QAAM,IAAI,KAAK,SAAS;AACxB,UACG,IAAI,KAAK,EAAE,YAAY,IAAI,GAAG,GAAG,CAAC,EAAE,QAAQ,IAC3C,IAAI,KAAK,EAAE,YAAY,GAAG,GAAG,CAAC,EAAE,QAAQ,KAC1C;AAEJ;","names":[]}
|
package/dist/yearEnd.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a Date object for the with the input date set to the end of the current year.
|
|
5
|
-
* @param inputDate - A string or
|
|
5
|
+
* @param [inputDate] - A string, Date object or nothing for the current year
|
|
6
6
|
*/
|
|
7
|
-
declare function yearEnd(inputDate
|
|
7
|
+
declare function yearEnd(inputDate?: MaybeDateInput): Date;
|
|
8
8
|
|
|
9
9
|
export { yearEnd };
|
package/dist/yearEnd.mjs
CHANGED
package/dist/yearEnd.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/yearEnd.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/yearEnd.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * Returns a Date object for the with the input date set to the end of the current year.\n * @param [inputDate] - A string, Date object or nothing for the current year\n */\nexport function yearEnd(inputDate?: MaybeDateInput): Date {\n const d = date(inputDate)\n\n d.setMonth(11, 31)\n d.setHours(23, 59, 59, 999)\n\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAOd,SAAS,QAAQ,WAAkC;AACxD,QAAM,IAAI,KAAK,SAAS;AAExB,IAAE,SAAS,IAAI,EAAE;AACjB,IAAE,SAAS,IAAI,IAAI,IAAI,GAAG;AAE1B,SAAO;AACT;","names":[]}
|
package/dist/yearStart.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaybeDateInput } from './types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a Date object for the with the input date set to the start of the current year.
|
|
5
|
-
* @param inputDate - A string or
|
|
5
|
+
* @param [inputDate] - A string, Date object or nothing for the current year
|
|
6
6
|
*/
|
|
7
|
-
declare function yearStart(inputDate
|
|
7
|
+
declare function yearStart(inputDate?: MaybeDateInput): Date;
|
|
8
8
|
|
|
9
9
|
export { yearStart };
|
package/dist/yearStart.mjs
CHANGED
package/dist/yearStart.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/yearStart.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/yearStart.ts"],"sourcesContent":["import { date } from \"./date\"\nimport type { MaybeDateInput } from \"./types\"\n\n/**\n * Returns a Date object for the with the input date set to the start of the current year.\n * @param [inputDate] - A string, Date object or nothing for the current year\n */\nexport function yearStart(inputDate?: MaybeDateInput): Date {\n const d = date(inputDate)\n\n d.setMonth(0, 1)\n d.setHours(0, 0, 0, 0)\n\n return d\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAOd,SAAS,UAAU,WAAkC;AAC1D,QAAM,IAAI,KAAK,SAAS;AAExB,IAAE,SAAS,GAAG,CAAC;AACf,IAAE,SAAS,GAAG,GAAG,GAAG,CAAC;AAErB,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formkit/tempo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"packageManager": "pnpm@10.11.0",
|
|
4
5
|
"description": "The easiest way to work with dates in JavaScript and TypeScript.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "dist/index.cjs",
|
|
@@ -23,6 +24,24 @@
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
"homepage": "https://github.com/formkit/tempo",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/formkit/tempo.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/formkit/tempo/issues"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "npm --prefix ./docs run dev",
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"post:build": "node scripts/size-limit/index.js || echo 'Size limit check skipped'",
|
|
39
|
+
"test": "TZ=\"America/New_York\" vitest",
|
|
40
|
+
"docs-build": "npm --prefix ./docs run build",
|
|
41
|
+
"publint": "publint",
|
|
42
|
+
"release": "pnpm build && bumpp --push",
|
|
43
|
+
"size": "npm run build && size-limit"
|
|
44
|
+
},
|
|
26
45
|
"files": [
|
|
27
46
|
"dist",
|
|
28
47
|
"docs/public/read-the-docs.png",
|
|
@@ -37,27 +56,17 @@
|
|
|
37
56
|
"author": "Justin Schroeder <justin@formkit.com>",
|
|
38
57
|
"license": "MIT",
|
|
39
58
|
"devDependencies": {
|
|
40
|
-
"@size-limit/esbuild": "^
|
|
41
|
-
"@size-limit/file": "^
|
|
42
|
-
"@size-limit/preset-small-lib": "^
|
|
43
|
-
"@types/node": "^
|
|
44
|
-
"bumpp": "^
|
|
59
|
+
"@size-limit/esbuild": "^12.0.0",
|
|
60
|
+
"@size-limit/file": "^12.0.0",
|
|
61
|
+
"@size-limit/preset-small-lib": "^12.0.0",
|
|
62
|
+
"@types/node": "^25.0.3",
|
|
63
|
+
"bumpp": "^10.3.2",
|
|
45
64
|
"bytes-iec": "^3.1.1",
|
|
46
|
-
"esbuild-plugin-file-path-extensions": "^2.
|
|
47
|
-
"publint": "^0.
|
|
48
|
-
"size-limit": "^
|
|
49
|
-
"tsup": "^8.
|
|
50
|
-
"typescript": "^5.
|
|
51
|
-
"vitest": "^
|
|
52
|
-
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"dev": "cd ./docs && pnpm nuxt dev",
|
|
55
|
-
"build": "tsup",
|
|
56
|
-
"post:build": "node scripts/size-limit/index.js",
|
|
57
|
-
"test": "TZ=\"America/New_York\" vitest",
|
|
58
|
-
"docs-build": "cd ./docs && pnpm run build",
|
|
59
|
-
"publint": "publint",
|
|
60
|
-
"release": "pnpm build && bumpp && pnpm publish",
|
|
61
|
-
"size": "npm run build && size-limit"
|
|
65
|
+
"esbuild-plugin-file-path-extensions": "^2.1.4",
|
|
66
|
+
"publint": "^0.3.16",
|
|
67
|
+
"size-limit": "^12.0.0",
|
|
68
|
+
"tsup": "^8.5.1",
|
|
69
|
+
"typescript": "^5.9.3",
|
|
70
|
+
"vitest": "^4.0.16"
|
|
62
71
|
}
|
|
63
|
-
}
|
|
72
|
+
}
|