@valentinkolb/filegate 2.2.0 → 2.2.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Valentin Kolb
3
+ Copyright (c) 2026-Present Valentin Kolb
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valentinkolb/filegate",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -83,6 +83,13 @@ const assembleFile = async (meta: UploadMeta): Promise<string | null> => {
83
83
  const chunks = await getUploadedChunks(meta.uploadId);
84
84
  if (chunks.length !== meta.totalChunks) return "missing chunks";
85
85
 
86
+ // Verify all expected chunk indices are present (0 to totalChunks-1)
87
+ const expectedChunks = Array.from({ length: meta.totalChunks }, (_, i) => i);
88
+ const missingChunks = expectedChunks.filter((i) => !chunks.includes(i));
89
+ if (missingChunks.length > 0) {
90
+ return `missing chunk indices: ${missingChunks.join(", ")}`;
91
+ }
92
+
86
93
  const fullPath = join(meta.path, meta.filename);
87
94
  const pathResult = await validatePath(fullPath);
88
95
  if (!pathResult.ok) return pathResult.error;