neramjs 0.0.0-stage → 0.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/CHANGELOG.md +39 -0
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/dist/calendar.d.ts +25 -0
- package/dist/calendar.js +59 -0
- package/dist/cjs/neram.cjs +3136 -0
- package/dist/duration.d.ts +69 -0
- package/dist/duration.js +271 -0
- package/dist/format.d.ts +13 -0
- package/dist/format.js +115 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -0
- package/dist/intl.d.ts +15 -0
- package/dist/intl.js +72 -0
- package/dist/locale.d.ts +53 -0
- package/dist/locale.js +107 -0
- package/dist/neram.d.ts +287 -0
- package/dist/neram.global.js +2 -0
- package/dist/neram.js +910 -0
- package/dist/neram.min.js +2 -0
- package/dist/neram.recur.global.js +3 -0
- package/dist/parse.d.ts +14 -0
- package/dist/parse.js +278 -0
- package/dist/recur/cron.d.ts +41 -0
- package/dist/recur/cron.js +275 -0
- package/dist/recur/index.cjs +2 -0
- package/dist/recur/index.d.cts +24 -0
- package/dist/recur/index.d.ts +6 -0
- package/dist/recur/index.js +3 -0
- package/dist/recur/rrule.d.ts +108 -0
- package/dist/recur/rrule.js +731 -0
- package/dist/recur/schedule.d.ts +85 -0
- package/dist/recur/schedule.js +169 -0
- package/dist/recur.min.js +3 -0
- package/dist/relative.d.ts +17 -0
- package/dist/relative.js +26 -0
- package/dist/units.d.ts +13 -0
- package/dist/units.js +44 -0
- package/dist/weekdata.d.ts +22 -0
- package/dist/weekdata.js +58 -0
- package/dist/zone.d.ts +48 -0
- package/dist/zone.js +247 -0
- package/package.json +89 -4
package/dist/zone.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-zone math. Every zone is handled the same way: find the UTC offset in force at an
|
|
3
|
+
* instant, then read wall-clock fields from (instant + offset) with UTC getters.
|
|
4
|
+
*
|
|
5
|
+
* Zone ids: 'local' — the runtime's zone
|
|
6
|
+
* 'UTC'
|
|
7
|
+
* '+05:30' — a fixed offset
|
|
8
|
+
* any IANA name ('Asia/Kolkata', 'America/New_York', ...)
|
|
9
|
+
*/
|
|
10
|
+
export interface Wall {
|
|
11
|
+
y: number;
|
|
12
|
+
M: number;
|
|
13
|
+
D: number;
|
|
14
|
+
h: number;
|
|
15
|
+
m: number;
|
|
16
|
+
s: number;
|
|
17
|
+
ms: number;
|
|
18
|
+
}
|
|
19
|
+
/** Epoch ms for a proleptic-Gregorian wall time read as UTC. Handles years 0-99 and overflow. */
|
|
20
|
+
export declare function utcFromParts(y: number, M: number, D: number, h?: number, m?: number, s?: number, ms?: number): number;
|
|
21
|
+
export declare function wallToUtcMs(w: Wall): number;
|
|
22
|
+
export declare function parseOffset(str: string): number | undefined;
|
|
23
|
+
export declare function formatOffset(mins: number, sep?: string): string;
|
|
24
|
+
export declare function isFixedZone(zone: string): boolean;
|
|
25
|
+
/** The current IANA name for a zone, if this runtime knows it (older runtimes may not know "Europe/Kyiv"). */
|
|
26
|
+
export declare function modernZoneName(zone: string): string;
|
|
27
|
+
/** Canonicalise a zone id, throwing RangeError for unknown zones. */
|
|
28
|
+
export declare function normalizeZone(zone: string | undefined | null): string;
|
|
29
|
+
/** @internal For tests: the offset straight from Intl, bypassing the cache. */
|
|
30
|
+
export declare function offsetAtUncached(ms: number, zone: string): number;
|
|
31
|
+
/** UTC offset in minutes in force in `zone` at instant `ms`. */
|
|
32
|
+
export declare function offsetAt(ms: number, zone: string): number;
|
|
33
|
+
/**
|
|
34
|
+
* Convert a wall-clock time in `zone` to an instant.
|
|
35
|
+
* Disambiguation follows Temporal's "compatible" rule:
|
|
36
|
+
* - repeated hour (DST ends) → the earlier instant
|
|
37
|
+
* - skipped hour (DST starts) → shifted forward by the gap length
|
|
38
|
+
*/
|
|
39
|
+
export declare function wallToEpoch(w: Wall, zone: string): number;
|
|
40
|
+
/** Wall-clock fields of a UTC-ms value (instant + offset), without allocating a Date. */
|
|
41
|
+
export declare function wallOfMs(t: number): Wall & {
|
|
42
|
+
dow: number;
|
|
43
|
+
};
|
|
44
|
+
export declare function wallFromEpoch(ms: number, offset: number): Wall & {
|
|
45
|
+
dow: number;
|
|
46
|
+
};
|
|
47
|
+
/** The runtime's IANA zone, e.g. "Asia/Kolkata". */
|
|
48
|
+
export declare function guessZone(): string;
|
package/dist/zone.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { civilFromDays } from './calendar.js';
|
|
2
|
+
/** Epoch ms for a proleptic-Gregorian wall time read as UTC. Handles years 0-99 and overflow. */
|
|
3
|
+
export function utcFromParts(y, M, D, h = 0, m = 0, s = 0, ms = 0) {
|
|
4
|
+
// Fast path: Date.UTC normalises overflow itself; it only misreads years 0-99 as 1900-1999.
|
|
5
|
+
if (y >= 100)
|
|
6
|
+
return Date.UTC(y, M, D, h, m, s, ms);
|
|
7
|
+
const d = new Date(0);
|
|
8
|
+
d.setUTCFullYear(y, M, D);
|
|
9
|
+
d.setUTCHours(h, m, s, ms);
|
|
10
|
+
return d.getTime();
|
|
11
|
+
}
|
|
12
|
+
export function wallToUtcMs(w) {
|
|
13
|
+
return utcFromParts(w.y, w.M, w.D, w.h, w.m, w.s, w.ms);
|
|
14
|
+
}
|
|
15
|
+
const FIXED_RE = /^([+-])(\d{2}):?(\d{2})$/;
|
|
16
|
+
export function parseOffset(str) {
|
|
17
|
+
if (str === 'Z' || str === 'z')
|
|
18
|
+
return 0;
|
|
19
|
+
const m = FIXED_RE.exec(str) ?? /^([+-])(\d{2})$/.exec(str);
|
|
20
|
+
if (!m)
|
|
21
|
+
return undefined;
|
|
22
|
+
const h = Number(m[2]);
|
|
23
|
+
const min = Number(m[3] ?? 0);
|
|
24
|
+
if (h > 23 || min > 59)
|
|
25
|
+
return undefined; // RFC 9557 / Temporal limit: ±23:59
|
|
26
|
+
const mins = h * 60 + min;
|
|
27
|
+
return m[1] === '-' ? -mins : mins;
|
|
28
|
+
}
|
|
29
|
+
export function formatOffset(mins, sep = ':') {
|
|
30
|
+
const sign = mins < 0 ? '-' : '+';
|
|
31
|
+
const abs = Math.abs(mins);
|
|
32
|
+
return `${sign}${String(Math.floor(abs / 60)).padStart(2, '0')}${sep}${String(abs % 60).padStart(2, '0')}`;
|
|
33
|
+
}
|
|
34
|
+
export function isFixedZone(zone) {
|
|
35
|
+
return FIXED_RE.test(zone);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Old zone names some runtimes still report (V8 and ICU say "Asia/Calcutta", Firefox says "Asia/Kolkata").
|
|
39
|
+
* neram always uses the current IANA name, so a server and a browser store the same string.
|
|
40
|
+
*/
|
|
41
|
+
// prettier-ignore
|
|
42
|
+
const MODERN = {
|
|
43
|
+
'Asia/Calcutta': 'Asia/Kolkata', 'Asia/Saigon': 'Asia/Ho_Chi_Minh', 'Asia/Katmandu': 'Asia/Kathmandu',
|
|
44
|
+
'Asia/Rangoon': 'Asia/Yangon', 'Europe/Kiev': 'Europe/Kyiv', 'Atlantic/Faeroe': 'Atlantic/Faroe',
|
|
45
|
+
'America/Godthab': 'America/Nuuk', 'Pacific/Enderbury': 'Pacific/Kanton', 'Pacific/Truk': 'Pacific/Chuuk',
|
|
46
|
+
'Pacific/Ponape': 'Pacific/Pohnpei', 'Africa/Asmera': 'Africa/Asmara',
|
|
47
|
+
'America/Buenos_Aires': 'America/Argentina/Buenos_Aires', 'America/Catamarca': 'America/Argentina/Catamarca',
|
|
48
|
+
'America/Cordoba': 'America/Argentina/Cordoba', 'America/Jujuy': 'America/Argentina/Jujuy',
|
|
49
|
+
'America/Mendoza': 'America/Argentina/Mendoza', 'America/Indianapolis': 'America/Indiana/Indianapolis',
|
|
50
|
+
'America/Louisville': 'America/Kentucky/Louisville',
|
|
51
|
+
};
|
|
52
|
+
function zoneExists(zone) {
|
|
53
|
+
try {
|
|
54
|
+
new Intl.DateTimeFormat('en-US', { timeZone: zone });
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** The current IANA name for a zone, if this runtime knows it (older runtimes may not know "Europe/Kyiv"). */
|
|
62
|
+
export function modernZoneName(zone) {
|
|
63
|
+
const m = MODERN[zone];
|
|
64
|
+
return m && zoneExists(m) ? m : zone;
|
|
65
|
+
}
|
|
66
|
+
const validZones = new Map();
|
|
67
|
+
/** Canonicalise a zone id, throwing RangeError for unknown zones. */
|
|
68
|
+
export function normalizeZone(zone) {
|
|
69
|
+
if (zone == null || zone === 'local')
|
|
70
|
+
return 'local';
|
|
71
|
+
if (typeof zone !== 'string' || zone.trim() === '')
|
|
72
|
+
throw new RangeError(`neram: unknown time zone ${JSON.stringify(zone)}`);
|
|
73
|
+
const cached = validZones.get(zone);
|
|
74
|
+
if (cached)
|
|
75
|
+
return cached;
|
|
76
|
+
let out;
|
|
77
|
+
const upper = zone.toUpperCase();
|
|
78
|
+
if (upper === 'UTC' || upper === 'Z' || upper === 'GMT' || upper === 'ETC/UTC' || upper === 'ETC/GMT') {
|
|
79
|
+
out = 'UTC';
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const off = parseOffset(zone);
|
|
83
|
+
if (off !== undefined) {
|
|
84
|
+
out = off === 0 ? 'UTC' : formatOffset(off);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
try {
|
|
88
|
+
// Validate, but keep the caller's spelling: V8 resolves "Asia/Kolkata" to the
|
|
89
|
+
// legacy "Asia/Calcutta". Only fix casing ("asia/tokyo" → "Asia/Tokyo").
|
|
90
|
+
const resolved = new Intl.DateTimeFormat('en-US', { timeZone: zone }).resolvedOptions().timeZone;
|
|
91
|
+
out = modernZoneName(resolved.toLowerCase() === zone.toLowerCase() ? resolved : zone);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
throw new RangeError(`neram: unknown time zone "${zone}"`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
validZones.set(zone, out);
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
const dtfCache = new Map();
|
|
102
|
+
function zoneFormatter(zone) {
|
|
103
|
+
let f = dtfCache.get(zone);
|
|
104
|
+
if (!f) {
|
|
105
|
+
f = new Intl.DateTimeFormat('en-US', {
|
|
106
|
+
timeZone: zone,
|
|
107
|
+
hourCycle: 'h23',
|
|
108
|
+
era: 'short',
|
|
109
|
+
year: 'numeric',
|
|
110
|
+
month: 'numeric',
|
|
111
|
+
day: 'numeric',
|
|
112
|
+
hour: 'numeric',
|
|
113
|
+
minute: 'numeric',
|
|
114
|
+
second: 'numeric',
|
|
115
|
+
});
|
|
116
|
+
dtfCache.set(zone, f);
|
|
117
|
+
}
|
|
118
|
+
return f;
|
|
119
|
+
}
|
|
120
|
+
function ianaOffset(ms, zone) {
|
|
121
|
+
const parts = zoneFormatter(zone).formatToParts(new Date(ms));
|
|
122
|
+
let y = 0, M = 0, D = 0, h = 0, m = 0, s = 0, bc = false;
|
|
123
|
+
for (const p of parts) {
|
|
124
|
+
switch (p.type) {
|
|
125
|
+
case 'year':
|
|
126
|
+
y = Number(p.value);
|
|
127
|
+
break;
|
|
128
|
+
case 'month':
|
|
129
|
+
M = Number(p.value) - 1;
|
|
130
|
+
break;
|
|
131
|
+
case 'day':
|
|
132
|
+
D = Number(p.value);
|
|
133
|
+
break;
|
|
134
|
+
case 'hour':
|
|
135
|
+
h = Number(p.value) % 24;
|
|
136
|
+
break;
|
|
137
|
+
case 'minute':
|
|
138
|
+
m = Number(p.value);
|
|
139
|
+
break;
|
|
140
|
+
case 'second':
|
|
141
|
+
s = Number(p.value);
|
|
142
|
+
break;
|
|
143
|
+
case 'era':
|
|
144
|
+
bc = /^b/i.test(p.value);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (bc)
|
|
149
|
+
y = 1 - y;
|
|
150
|
+
const floored = ms - (((ms % 1000) + 1000) % 1000);
|
|
151
|
+
return Math.round((utcFromParts(y, M, D, h, m, s) - floored) / 60000);
|
|
152
|
+
}
|
|
153
|
+
const DAY_MS = 86400000;
|
|
154
|
+
const MAX_BUCKETS = 50000;
|
|
155
|
+
const TRANSITION = -1e9; // marker: the offset changes during this UTC day
|
|
156
|
+
const offsetCache = new Map();
|
|
157
|
+
/**
|
|
158
|
+
* IANA offsets, cached per UTC day. Intl lookups cost microseconds and one zoned operation needs several,
|
|
159
|
+
* so this is the library's hottest path. A day whose offset is the same at its first and last second
|
|
160
|
+
* holds no transition (zones never change offset and change back within a day), so the whole day is
|
|
161
|
+
* cached; days that contain a transition are always computed exactly.
|
|
162
|
+
*/
|
|
163
|
+
function ianaOffsetCached(ms, zone) {
|
|
164
|
+
let zc = offsetCache.get(zone);
|
|
165
|
+
if (!zc) {
|
|
166
|
+
zc = new Map();
|
|
167
|
+
offsetCache.set(zone, zc);
|
|
168
|
+
}
|
|
169
|
+
const bucket = Math.floor(ms / DAY_MS);
|
|
170
|
+
const hit = zc.get(bucket);
|
|
171
|
+
if (hit !== undefined)
|
|
172
|
+
return hit === TRANSITION ? ianaOffset(ms, zone) : hit;
|
|
173
|
+
const start = ianaOffset(bucket * DAY_MS, zone);
|
|
174
|
+
const end = ianaOffset(bucket * DAY_MS + DAY_MS - 1000, zone);
|
|
175
|
+
if (zc.size >= MAX_BUCKETS)
|
|
176
|
+
zc.clear();
|
|
177
|
+
zc.set(bucket, start === end ? start : TRANSITION);
|
|
178
|
+
return start === end ? start : ianaOffset(ms, zone);
|
|
179
|
+
}
|
|
180
|
+
/** @internal For tests: the offset straight from Intl, bypassing the cache. */
|
|
181
|
+
export function offsetAtUncached(ms, zone) {
|
|
182
|
+
return ianaOffset(ms, zone);
|
|
183
|
+
}
|
|
184
|
+
const fixedOffsets = new Map();
|
|
185
|
+
/** UTC offset in minutes in force in `zone` at instant `ms`. */
|
|
186
|
+
export function offsetAt(ms, zone) {
|
|
187
|
+
if (zone === 'UTC')
|
|
188
|
+
return 0;
|
|
189
|
+
if (zone === 'local')
|
|
190
|
+
return -new Date(ms).getTimezoneOffset() || 0;
|
|
191
|
+
let fixed = fixedOffsets.get(zone);
|
|
192
|
+
if (fixed === undefined && !fixedOffsets.has(zone)) {
|
|
193
|
+
fixed = parseOffset(zone);
|
|
194
|
+
fixedOffsets.set(zone, fixed);
|
|
195
|
+
}
|
|
196
|
+
if (fixed !== undefined)
|
|
197
|
+
return fixed;
|
|
198
|
+
return ianaOffsetCached(ms, zone);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Convert a wall-clock time in `zone` to an instant.
|
|
202
|
+
* Disambiguation follows Temporal's "compatible" rule:
|
|
203
|
+
* - repeated hour (DST ends) → the earlier instant
|
|
204
|
+
* - skipped hour (DST starts) → shifted forward by the gap length
|
|
205
|
+
*/
|
|
206
|
+
export function wallToEpoch(w, zone) {
|
|
207
|
+
// The Date constructor resolves skipped and repeated local times the same way (ECMAScript spec);
|
|
208
|
+
// verified against the generic path below in zones with 30-minute and midnight DST changes.
|
|
209
|
+
if (zone === 'local' && w.y >= 100)
|
|
210
|
+
return new Date(w.y, w.M, w.D, w.h, w.m, w.s, w.ms).getTime();
|
|
211
|
+
const local = wallToUtcMs(w);
|
|
212
|
+
if (zone === 'UTC')
|
|
213
|
+
return local;
|
|
214
|
+
const fixed = parseOffset(zone);
|
|
215
|
+
if (fixed !== undefined)
|
|
216
|
+
return local - fixed * 60000;
|
|
217
|
+
const before = offsetAt(local - 86400000, zone);
|
|
218
|
+
const after = offsetAt(local + 86400000, zone);
|
|
219
|
+
const candidates = new Set([offsetAt(local, zone), before, after]);
|
|
220
|
+
const valid = [];
|
|
221
|
+
for (const off of candidates) {
|
|
222
|
+
if (offsetAt(local - off * 60000, zone) === off)
|
|
223
|
+
valid.push(off);
|
|
224
|
+
}
|
|
225
|
+
if (valid.length)
|
|
226
|
+
return local - Math.max(...valid) * 60000;
|
|
227
|
+
return local - before * 60000;
|
|
228
|
+
}
|
|
229
|
+
/** Wall-clock fields of a UTC-ms value (instant + offset), without allocating a Date. */
|
|
230
|
+
export function wallOfMs(t) {
|
|
231
|
+
const day = Math.floor(t / 86400000);
|
|
232
|
+
let rem = t - day * 86400000;
|
|
233
|
+
const c = civilFromDays(day);
|
|
234
|
+
const h = Math.floor(rem / 3600000);
|
|
235
|
+
rem -= h * 3600000;
|
|
236
|
+
const m = Math.floor(rem / 60000);
|
|
237
|
+
rem -= m * 60000;
|
|
238
|
+
const s = Math.floor(rem / 1000);
|
|
239
|
+
return { y: c.y, M: c.M, D: c.D, h, m, s, ms: rem - s * 1000, dow: c.dow };
|
|
240
|
+
}
|
|
241
|
+
export function wallFromEpoch(ms, offset) {
|
|
242
|
+
return wallOfMs(ms + offset * 60000);
|
|
243
|
+
}
|
|
244
|
+
/** The runtime's IANA zone, e.g. "Asia/Kolkata". */
|
|
245
|
+
export function guessZone() {
|
|
246
|
+
return modernZoneName(new Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC');
|
|
247
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neramjs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tiny, immutable, timezone-aware dates with a Day.js-compatible API, plus RFC 5545 recurrence rules and cron schedules in any time zone. Zero dependencies.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"date",
|
|
7
|
+
"time",
|
|
8
|
+
"timezone",
|
|
9
|
+
"dayjs",
|
|
10
|
+
"moment",
|
|
11
|
+
"intl",
|
|
12
|
+
"temporal",
|
|
13
|
+
"duration",
|
|
14
|
+
"business-days",
|
|
15
|
+
"i18n",
|
|
16
|
+
"rfc9557",
|
|
17
|
+
"rrule",
|
|
18
|
+
"rfc5545",
|
|
19
|
+
"icalendar",
|
|
20
|
+
"recurrence",
|
|
21
|
+
"cron",
|
|
22
|
+
"calendar"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/varksh05/neramjs.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://varksh05.github.io/neramjs/",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/varksh05/neramjs/issues"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"main": "./dist/index.cjs",
|
|
35
|
+
"module": "./dist/index.js",
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"unpkg": "./dist/neram.global.js",
|
|
38
|
+
"jsdelivr": "./dist/neram.global.js",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/index.d.cts",
|
|
47
|
+
"default": "./dist/index.cjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"./recur": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/recur/index.d.ts",
|
|
53
|
+
"default": "./dist/recur/index.js"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/recur/index.d.cts",
|
|
57
|
+
"default": "./dist/recur/index.cjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./min": "./dist/neram.min.js",
|
|
61
|
+
"./recur/min": "./dist/recur.min.js",
|
|
62
|
+
"./global": "./dist/neram.global.js",
|
|
63
|
+
"./recur/global": "./dist/neram.recur.global.js",
|
|
64
|
+
"./package.json": "./package.json"
|
|
65
|
+
},
|
|
66
|
+
"files": [
|
|
67
|
+
"dist",
|
|
68
|
+
"README.md",
|
|
69
|
+
"LICENSE",
|
|
70
|
+
"CHANGELOG.md"
|
|
71
|
+
],
|
|
72
|
+
"sideEffects": false,
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=20.19"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "node scripts/build.mjs",
|
|
78
|
+
"test": "node scripts/run-tests.mjs",
|
|
79
|
+
"test:dist": "npm run build && node scripts/run-tests.mjs --dist",
|
|
80
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
81
|
+
"prepublishOnly": "npm run typecheck && npm run test:dist",
|
|
82
|
+
"bench": "node bench/bench.ts",
|
|
83
|
+
"test:coverage": "node scripts/run-tests.mjs --coverage",
|
|
84
|
+
"test:package": "npm run build && node scripts/check-package.mjs"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@types/node": "^26.6.11",
|
|
88
|
+
"esbuild": "^0.28.2",
|
|
89
|
+
"typescript": "^7.0.2"
|
|
90
|
+
}
|
|
91
|
+
}
|