opfs-mock 2.1.1 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # opfs-mock
2
2
 
3
3
  In-memory implementation of the [origin private file system](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system). Its main utility is for testing OPFS-dependent code in Node.js. It's tested
4
- on Node.js versions 20-23.
4
+ on Node.js versions 20-24.
5
5
 
6
6
  ## Installation
7
7
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
- declare const storageFactory: ({ usage, quota }?: StorageEstimate) => StorageManager;
1
+ //#region src/index.d.ts
2
+ declare const storageFactory: ({
3
+ usage,
4
+ quota
5
+ }?: StorageEstimate) => StorageManager;
2
6
  declare const mockOPFS: () => void;
3
7
  declare const resetMockOPFS: () => void;
4
8
 
5
- export { mockOPFS, resetMockOPFS, storageFactory };
9
+ //#endregion
10
+ export { mockOPFS, resetMockOPFS, storageFactory };
package/dist/index.js CHANGED
@@ -1,321 +1,272 @@
1
- // src/utils.ts
2
- var isFileHandle = (handle) => {
3
- return handle.kind === "file";
1
+ //#region src/utils.ts
2
+ const isFileHandle = (handle) => {
3
+ return handle.kind === "file";
4
4
  };
5
- var isDirectoryHandle = (handle) => {
6
- return handle.kind === "directory";
5
+ const isDirectoryHandle = (handle) => {
6
+ return handle.kind === "directory";
7
7
  };
8
- var getSizeOfDirectory = async (directory) => {
9
- let totalSize = 0;
10
- for await (const handle of directory.values()) {
11
- if (isFileHandle(handle)) {
12
- const file = await handle.getFile();
13
- totalSize += file.size;
14
- } else if (isDirectoryHandle(handle)) {
15
- totalSize += await getSizeOfDirectory(handle);
16
- }
17
- }
18
- return totalSize;
8
+ const getSizeOfDirectory = async (directory) => {
9
+ let totalSize = 0;
10
+ for await (const handle of directory.values()) if (isFileHandle(handle)) {
11
+ const file = await handle.getFile();
12
+ totalSize += file.size;
13
+ } else if (isDirectoryHandle(handle)) totalSize += await getSizeOfDirectory(handle);
14
+ return totalSize;
19
15
  };
20
16
 
21
- // src/opfs.ts
22
- var fileSystemFileHandleFactory = (name, fileData) => {
23
- return {
24
- kind: "file",
25
- name,
26
- isSameEntry: async (other) => {
27
- return other.name === name && other.kind === "file";
28
- },
29
- getFile: async () => new File([fileData.content], name),
30
- createWritable: async (options) => {
31
- const keepExistingData = options?.keepExistingData;
32
- let abortReason = "";
33
- let isAborted = false;
34
- let isClosed = false;
35
- let content = keepExistingData ? fileData.content : "";
36
- let cursorPosition = keepExistingData ? fileData.content.length : 0;
37
- const writableStream = new WritableStream({
38
- write: () => {
39
- },
40
- close: () => {
41
- },
42
- abort: () => {
43
- }
44
- });
45
- return Object.assign(writableStream, {
46
- getWriter: () => writableStream.getWriter(),
47
- write: async function(chunk) {
48
- if (isAborted) {
49
- throw new Error(abortReason);
50
- }
51
- if (isClosed) {
52
- throw new TypeError("Cannot write to a CLOSED writable stream");
53
- }
54
- if (chunk === void 0) {
55
- throw new TypeError("Cannot write undefined data to the stream");
56
- }
57
- let chunkText;
58
- if (typeof chunk === "string") {
59
- chunkText = chunk;
60
- } else if (chunk instanceof Blob) {
61
- chunkText = await chunk.text();
62
- } else if (ArrayBuffer.isView(chunk)) {
63
- chunkText = new TextDecoder().decode(new Uint8Array(chunk.buffer));
64
- } else if (typeof chunk === "object" && "data" in chunk) {
65
- if (chunk.position !== void 0 && (typeof chunk.position !== "number" || chunk.position < 0)) {
66
- throw new TypeError("Invalid position value in write parameters");
67
- }
68
- if (chunk.size !== void 0 && (typeof chunk.size !== "number" || chunk.size < 0)) {
69
- throw new TypeError("Invalid size value in write parameters");
70
- }
71
- if (chunk.position !== void 0 && chunk.position !== null) {
72
- cursorPosition = chunk.position;
73
- }
74
- if (chunk.data) {
75
- if (typeof chunk.data === "string") {
76
- chunkText = chunk.data;
77
- } else if (chunk.data instanceof Blob) {
78
- chunkText = await chunk.data.text();
79
- } else {
80
- chunkText = new TextDecoder().decode(new Uint8Array(chunk.data instanceof ArrayBuffer ? chunk.data : chunk.data.buffer));
81
- }
82
- } else {
83
- chunkText = "";
84
- }
85
- } else {
86
- throw new TypeError("Invalid data type written to the file. Data must be of type FileSystemWriteChunkType.");
87
- }
88
- content = content.slice(0, cursorPosition) + chunkText + content.slice(cursorPosition + chunkText.length);
89
- cursorPosition += chunkText.length;
90
- },
91
- close: async function() {
92
- if (isClosed) {
93
- throw new TypeError("Cannot close a CLOSED writable stream");
94
- }
95
- if (isAborted) {
96
- throw new TypeError("Cannot close a ERRORED writable stream");
97
- }
98
- isClosed = true;
99
- fileData.content = content;
100
- },
101
- abort: async function(reason) {
102
- if (isAborted) {
103
- return;
104
- }
105
- if (reason && !abortReason) {
106
- abortReason = reason;
107
- }
108
- isAborted = true;
109
- return Promise.resolve(void 0);
110
- },
111
- truncate: async function(size) {
112
- if (size < 0) {
113
- throw new DOMException("Invalid truncate size", "IndexSizeError");
114
- }
115
- if (size < content.length) {
116
- content = content.slice(0, size);
117
- } else {
118
- content = content.padEnd(size, "\0");
119
- }
120
- cursorPosition = Math.min(cursorPosition, size);
121
- },
122
- seek: async function(position) {
123
- if (position < 0 || position > content.length) {
124
- throw new DOMException("Invalid seek position", "IndexSizeError");
125
- }
126
- cursorPosition = position;
127
- }
128
- });
129
- },
130
- createSyncAccessHandle: async () => {
131
- let closed = false;
132
- return {
133
- getSize: () => {
134
- if (closed) {
135
- throw new DOMException("InvalidStateError", "The access handle is closed");
136
- }
137
- return fileData.content.length;
138
- },
139
- read: (buffer, { at = 0 } = {}) => {
140
- if (closed) {
141
- throw new DOMException("InvalidStateError", "The access handle is closed");
142
- }
143
- const text = new TextEncoder().encode(fileData.content);
144
- const bytesRead = Math.min(buffer.length, text.length - at);
145
- buffer.set(text.subarray(at, at + bytesRead));
146
- return bytesRead;
147
- },
148
- write: (data, options) => {
149
- const at = options?.at ?? 0;
150
- if (closed) {
151
- throw new DOMException("InvalidStateError", "The access handle is closed");
152
- }
153
- const newContent = new TextDecoder().decode(data);
154
- if (at < fileData.content.length) {
155
- fileData.content = fileData.content.slice(0, at) + newContent + fileData.content.slice(at + newContent.length);
156
- } else {
157
- fileData.content += newContent;
158
- }
159
- return data.byteLength;
160
- },
161
- truncate: (size) => {
162
- if (closed) {
163
- throw new DOMException("InvalidStateError", "The access handle is closed");
164
- }
165
- fileData.content = fileData.content.slice(0, size);
166
- },
167
- flush: async () => {
168
- if (closed) {
169
- throw new DOMException("InvalidStateError", "The access handle is closed");
170
- }
171
- },
172
- close: async () => {
173
- closed = true;
174
- }
175
- };
176
- }
177
- };
17
+ //#endregion
18
+ //#region src/opfs.ts
19
+ const fileSystemFileHandleFactory = (name, fileData) => {
20
+ return {
21
+ kind: "file",
22
+ name,
23
+ isSameEntry: async (other) => {
24
+ return other.name === name && other.kind === "file";
25
+ },
26
+ getFile: async () => new File([fileData.content], name),
27
+ createWritable: async (options) => {
28
+ const keepExistingData = options?.keepExistingData;
29
+ let abortReason = "";
30
+ let isAborted = false;
31
+ let isClosed = false;
32
+ let content = keepExistingData ? new Uint8Array(fileData.content) : new Uint8Array();
33
+ let cursorPosition = keepExistingData ? fileData.content.length : 0;
34
+ const writableStream = new WritableStream({
35
+ write: () => {},
36
+ close: () => {},
37
+ abort: () => {}
38
+ });
39
+ return Object.assign(writableStream, {
40
+ getWriter: () => writableStream.getWriter(),
41
+ write: async function(chunk) {
42
+ if (isAborted) throw new Error(abortReason);
43
+ if (isClosed) throw new TypeError("Cannot write to a CLOSED writable stream");
44
+ if (chunk === void 0) throw new TypeError("Cannot write undefined data to the stream");
45
+ if (typeof chunk === "object" && "type" in chunk && chunk.type === "truncate") {
46
+ if (typeof chunk.size !== "number" || chunk.size < 0) throw new TypeError("Invalid size value in truncate parameters");
47
+ if (chunk.size < content.length) content = content.slice(0, chunk.size);
48
+ else {
49
+ const extended = new Uint8Array(chunk.size);
50
+ extended.set(content);
51
+ content = extended;
52
+ }
53
+ cursorPosition = Math.min(cursorPosition, chunk.size);
54
+ return;
55
+ }
56
+ let encoded;
57
+ if (typeof chunk === "string") encoded = new TextEncoder().encode(chunk);
58
+ else if (chunk instanceof Blob) {
59
+ const text = await chunk.text();
60
+ encoded = new TextEncoder().encode(text);
61
+ } else if (ArrayBuffer.isView(chunk)) encoded = new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
62
+ else if (chunk instanceof ArrayBuffer) encoded = new Uint8Array(chunk);
63
+ else if (typeof chunk === "object" && "data" in chunk) {
64
+ if (chunk.position !== void 0 && (typeof chunk.position !== "number" || chunk.position < 0)) throw new TypeError("Invalid position value in write parameters");
65
+ if (chunk.size !== void 0 && (typeof chunk.size !== "number" || chunk.size < 0)) throw new TypeError("Invalid size value in write parameters");
66
+ if (chunk.position !== void 0 && chunk.position !== null) cursorPosition = chunk.position;
67
+ const data = chunk.data;
68
+ if (data === void 0 || data === null) encoded = new Uint8Array();
69
+ else if (typeof data === "string") encoded = new TextEncoder().encode(data);
70
+ else if (data instanceof Blob) {
71
+ const text = await data.text();
72
+ encoded = new TextEncoder().encode(text);
73
+ } else if (ArrayBuffer.isView(data)) encoded = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
74
+ else if (data instanceof ArrayBuffer) encoded = new Uint8Array(data);
75
+ else throw new TypeError("Invalid data in WriteParams");
76
+ } else throw new TypeError("Invalid data type written to the file. Data must be of type FileSystemWriteChunkType.");
77
+ const requiredSize = cursorPosition + encoded.length;
78
+ if (content.length < requiredSize) {
79
+ const extended = new Uint8Array(requiredSize);
80
+ extended.set(content);
81
+ content = extended;
82
+ }
83
+ content.set(encoded, cursorPosition);
84
+ cursorPosition += encoded.length;
85
+ },
86
+ close: async function() {
87
+ if (isClosed) throw new TypeError("Cannot close a CLOSED writable stream");
88
+ if (isAborted) throw new TypeError("Cannot close a ERRORED writable stream");
89
+ isClosed = true;
90
+ fileData.content = content;
91
+ },
92
+ abort: async function(reason) {
93
+ if (isAborted) return;
94
+ if (reason && !abortReason) abortReason = reason;
95
+ isAborted = true;
96
+ return Promise.resolve(void 0);
97
+ },
98
+ truncate: async function(size) {
99
+ if (size < 0) throw new DOMException("Invalid truncate size", "IndexSizeError");
100
+ if (size < content.length) content = content.slice(0, size);
101
+ else if (size > content.length) {
102
+ const newBuffer = new Uint8Array(size);
103
+ newBuffer.set(content);
104
+ content = newBuffer;
105
+ }
106
+ cursorPosition = Math.min(cursorPosition, size);
107
+ },
108
+ seek: async function(position) {
109
+ if (position < 0) throw new DOMException("Invalid seek position", "IndexSizeError");
110
+ cursorPosition = position;
111
+ }
112
+ });
113
+ },
114
+ createSyncAccessHandle: async () => {
115
+ let closed = false;
116
+ return {
117
+ getSize: () => {
118
+ if (closed) throw new DOMException("InvalidStateError", "The access handle is closed");
119
+ return fileData.content.byteLength;
120
+ },
121
+ read: (buffer, { at = 0 } = {}) => {
122
+ if (closed) throw new DOMException("InvalidStateError", "The access handle is closed");
123
+ const content = fileData.content;
124
+ if (at >= content.length) return 0;
125
+ const available = content.length - at;
126
+ const writable = buffer instanceof DataView ? buffer.byteLength : buffer.length;
127
+ const bytesToRead = Math.min(writable, available);
128
+ const slice = content.subarray(at, at + bytesToRead);
129
+ if (buffer instanceof DataView) for (let i = 0; i < slice.length; i++) buffer.setUint8(i, slice[i]);
130
+ else buffer.set(slice, 0);
131
+ return bytesToRead;
132
+ },
133
+ write: (data, { at = 0 } = {}) => {
134
+ if (closed) throw new DOMException("InvalidStateError", "The access handle is closed");
135
+ const writeLength = data instanceof DataView ? data.byteLength : data.length;
136
+ const requiredSize = at + writeLength;
137
+ if (fileData.content.length < requiredSize) {
138
+ const newBuffer = new Uint8Array(requiredSize);
139
+ newBuffer.set(fileData.content);
140
+ fileData.content = newBuffer;
141
+ }
142
+ if (data instanceof DataView) for (let i = 0; i < data.byteLength; i++) fileData.content[at + i] = data.getUint8(i);
143
+ else fileData.content.set(data, at);
144
+ return writeLength;
145
+ },
146
+ truncate: (size) => {
147
+ if (closed) throw new DOMException("InvalidStateError", "The access handle is closed");
148
+ if (size < fileData.content.length) fileData.content = fileData.content.slice(0, size);
149
+ else if (size > fileData.content.length) {
150
+ const newBuffer = new Uint8Array(size);
151
+ newBuffer.set(fileData.content);
152
+ fileData.content = newBuffer;
153
+ }
154
+ },
155
+ flush: async () => {
156
+ if (closed) throw new DOMException("InvalidStateError", "The access handle is closed");
157
+ },
158
+ close: async () => {
159
+ closed = true;
160
+ }
161
+ };
162
+ }
163
+ };
178
164
  };
179
- var fileSystemDirectoryHandleFactory = (name) => {
180
- const files = /* @__PURE__ */ new Map();
181
- const directories = /* @__PURE__ */ new Map();
182
- const getJoinedMaps = () => {
183
- return new Map([...files, ...directories]);
184
- };
185
- return {
186
- kind: "directory",
187
- name,
188
- isSameEntry: async (other) => {
189
- return other.name === name && other.kind === "directory";
190
- },
191
- getFileHandle: async (fileName, options) => {
192
- if (!files.has(fileName) && options?.create) {
193
- files.set(fileName, fileSystemFileHandleFactory(fileName, { content: "" }));
194
- }
195
- const fileHandle = files.get(fileName);
196
- if (!fileHandle) {
197
- throw new DOMException(`File not found: ${fileName}`, "NotFoundError");
198
- }
199
- return fileHandle;
200
- },
201
- getDirectoryHandle: async (dirName, options) => {
202
- if (!directories.has(dirName) && options?.create) {
203
- directories.set(dirName, fileSystemDirectoryHandleFactory(dirName));
204
- }
205
- const directoryHandle = directories.get(dirName);
206
- if (!directoryHandle) {
207
- throw new DOMException(`Directory not found: ${dirName}`, "NotFoundError");
208
- }
209
- return directoryHandle;
210
- },
211
- removeEntry: async (entryName, options) => {
212
- if (files.has(entryName)) {
213
- files.delete(entryName);
214
- } else if (directories.has(entryName)) {
215
- if (options?.recursive) {
216
- directories.delete(entryName);
217
- } else {
218
- throw new DOMException(`Failed to remove directory: $1${entryName}`, "InvalidModificationError");
219
- }
220
- } else {
221
- throw new DOMException(`No such file or directory: $1${entryName}`, "NotFoundError");
222
- }
223
- },
224
- [Symbol.asyncIterator]: async function* () {
225
- const entries = getJoinedMaps();
226
- for (const [name2, handle] of entries) {
227
- yield [name2, handle];
228
- }
229
- return void 0;
230
- },
231
- entries: async function* () {
232
- const joinedMaps = getJoinedMaps();
233
- yield* joinedMaps.entries();
234
- },
235
- keys: async function* () {
236
- const joinedMaps = getJoinedMaps();
237
- yield* joinedMaps.keys();
238
- },
239
- values: async function* () {
240
- const joinedMaps = getJoinedMaps();
241
- yield* joinedMaps.values();
242
- },
243
- resolve: async function(possibleDescendant) {
244
- const traverseDirectory = async (directory, target, path = []) => {
245
- if (await directory.isSameEntry(target)) {
246
- return path;
247
- }
248
- for await (const [name2, handle] of directory.entries()) {
249
- if (isDirectoryHandle(handle)) {
250
- const result = await traverseDirectory(handle, target, [...path, name2]);
251
- if (result) {
252
- return result;
253
- }
254
- } else if (isFileHandle(handle)) {
255
- if (await handle.isSameEntry(target)) {
256
- return [...path, name2];
257
- }
258
- }
259
- }
260
- return null;
261
- };
262
- return traverseDirectory(this, possibleDescendant);
263
- }
264
- };
165
+ const fileSystemDirectoryHandleFactory = (name) => {
166
+ const files = new Map();
167
+ const directories = new Map();
168
+ const getJoinedMaps = () => {
169
+ return new Map([...files, ...directories]);
170
+ };
171
+ return {
172
+ kind: "directory",
173
+ name,
174
+ isSameEntry: async (other) => {
175
+ return other.name === name && other.kind === "directory";
176
+ },
177
+ getFileHandle: async (fileName, options) => {
178
+ if (!files.has(fileName) && options?.create) files.set(fileName, fileSystemFileHandleFactory(fileName, { content: new Uint8Array() }));
179
+ const fileHandle = files.get(fileName);
180
+ if (!fileHandle) throw new DOMException(`File not found: ${fileName}`, "NotFoundError");
181
+ return fileHandle;
182
+ },
183
+ getDirectoryHandle: async (dirName, options) => {
184
+ if (!directories.has(dirName) && options?.create) directories.set(dirName, fileSystemDirectoryHandleFactory(dirName));
185
+ const directoryHandle = directories.get(dirName);
186
+ if (!directoryHandle) throw new DOMException(`Directory not found: ${dirName}`, "NotFoundError");
187
+ return directoryHandle;
188
+ },
189
+ removeEntry: async (entryName, options) => {
190
+ if (files.has(entryName)) files.delete(entryName);
191
+ else if (directories.has(entryName)) if (options?.recursive) directories.delete(entryName);
192
+ else throw new DOMException(`Failed to remove directory: $1${entryName}`, "InvalidModificationError");
193
+ else throw new DOMException(`No such file or directory: $1${entryName}`, "NotFoundError");
194
+ },
195
+ [Symbol.asyncIterator]: async function* () {
196
+ const entries = getJoinedMaps();
197
+ for (const [name$1, handle] of entries) yield [name$1, handle];
198
+ return void 0;
199
+ },
200
+ entries: async function* () {
201
+ const joinedMaps = getJoinedMaps();
202
+ yield* joinedMaps.entries();
203
+ },
204
+ keys: async function* () {
205
+ const joinedMaps = getJoinedMaps();
206
+ yield* joinedMaps.keys();
207
+ },
208
+ values: async function* () {
209
+ const joinedMaps = getJoinedMaps();
210
+ yield* joinedMaps.values();
211
+ },
212
+ resolve: async function(possibleDescendant) {
213
+ const traverseDirectory = async (directory, target, path = []) => {
214
+ if (await directory.isSameEntry(target)) return path;
215
+ for await (const [name$1, handle] of directory.entries()) if (isDirectoryHandle(handle)) {
216
+ const result = await traverseDirectory(handle, target, [...path, name$1]);
217
+ if (result) return result;
218
+ } else if (isFileHandle(handle)) {
219
+ if (await handle.isSameEntry(target)) return [...path, name$1];
220
+ }
221
+ return null;
222
+ };
223
+ return traverseDirectory(this, possibleDescendant);
224
+ }
225
+ };
265
226
  };
266
227
 
267
- // src/index.ts
268
- var storageFactory = ({ usage = 0, quota = 1024 ** 3 } = {}) => {
269
- const root = fileSystemDirectoryHandleFactory("root");
270
- return {
271
- estimate: async () => {
272
- const defaultUsage = usage;
273
- const calculatedUsage = await getSizeOfDirectory(root);
274
- return {
275
- usage: defaultUsage + calculatedUsage,
276
- quota
277
- };
278
- },
279
- getDirectory: async () => {
280
- return root;
281
- },
282
- persist: async () => {
283
- return true;
284
- },
285
- persisted: async () => {
286
- return true;
287
- }
288
- };
228
+ //#endregion
229
+ //#region src/index.ts
230
+ const storageFactory = ({ usage = 0, quota = 1024 ** 3 } = {}) => {
231
+ const root = fileSystemDirectoryHandleFactory("root");
232
+ return {
233
+ estimate: async () => {
234
+ const defaultUsage = usage;
235
+ const calculatedUsage = await getSizeOfDirectory(root);
236
+ return {
237
+ usage: defaultUsage + calculatedUsage,
238
+ quota
239
+ };
240
+ },
241
+ getDirectory: async () => {
242
+ return root;
243
+ },
244
+ persist: async () => {
245
+ return true;
246
+ },
247
+ persisted: async () => {
248
+ return true;
249
+ }
250
+ };
289
251
  };
290
- var mockOPFS = () => {
291
- if (!("navigator" in globalThis)) {
292
- Object.defineProperty(globalThis, "navigator", {
293
- value: {},
294
- writable: true
295
- });
296
- }
297
- if (!globalThis.navigator.storage) {
298
- const { getDirectory } = storageFactory();
299
- Object.defineProperty(globalThis.navigator, "storage", {
300
- value: {
301
- getDirectory
302
- },
303
- writable: true
304
- });
305
- }
252
+ const mockOPFS = () => {
253
+ if (!("navigator" in globalThis)) Object.defineProperty(globalThis, "navigator", {
254
+ value: {},
255
+ writable: true
256
+ });
257
+ if (!globalThis.navigator.storage) Object.defineProperty(globalThis.navigator, "storage", {
258
+ value: storageFactory(),
259
+ writable: true
260
+ });
306
261
  };
307
- var resetMockOPFS = () => {
308
- const root = fileSystemDirectoryHandleFactory("root");
309
- Object.defineProperty(globalThis.navigator.storage, "getDirectory", {
310
- value: () => root,
311
- writable: true
312
- });
313
- };
314
- if (typeof globalThis !== "undefined") {
315
- mockOPFS();
316
- }
317
- export {
318
- mockOPFS,
319
- resetMockOPFS,
320
- storageFactory
262
+ const resetMockOPFS = () => {
263
+ const root = fileSystemDirectoryHandleFactory("root");
264
+ Object.defineProperty(globalThis.navigator.storage, "getDirectory", {
265
+ value: () => root,
266
+ writable: true
267
+ });
321
268
  };
269
+ if (typeof globalThis !== "undefined") mockOPFS();
270
+
271
+ //#endregion
272
+ export { mockOPFS, resetMockOPFS, storageFactory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opfs-mock",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "description": "Mock all origin private file system APIs for your Jest or Vitest tests",
6
6
  "author": "Jure Rotar <hello@jurerotar.com>",
@@ -30,8 +30,8 @@
30
30
  "node": ">=20.0.0"
31
31
  },
32
32
  "scripts": {
33
- "dev": "tsup --watch",
34
- "build": "tsup",
33
+ "dev": "tsdown --watch",
34
+ "build": "tsdown",
35
35
  "lint:check": "npx @biomejs/biome lint",
36
36
  "lint": "npx @biomejs/biome lint --fix",
37
37
  "format:check": "npx @biomejs/biome format",
@@ -47,10 +47,10 @@
47
47
  "devDependencies": {
48
48
  "@biomejs/biome": "1.9.4",
49
49
  "@web-std/file": "3.0.3",
50
- "happy-dom": "17.4.4",
51
- "jsdom": "26.0.0",
52
- "tsup": "8.4.0",
53
- "typescript": "5.8.2",
54
- "vitest": "3.0.9"
50
+ "happy-dom": "17.4.7",
51
+ "jsdom": "26.1.0",
52
+ "tsdown": "0.12.3",
53
+ "typescript": "5.8.3",
54
+ "vitest": "3.1.4"
55
55
  }
56
56
  }