pkg-pr-new 0.0.26 → 0.0.28

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/index.ts CHANGED
@@ -352,12 +352,15 @@ const main = defineCommand({
352
352
  )!;
353
353
  outputPkg.shasum = shasum;
354
354
 
355
- const file = await fs.readFile(path.resolve(p, filename));
355
+ const filePath = path.resolve(p, filename)
356
+ const buffer = await fs.readFile(filePath);
356
357
 
357
- const blob = new Blob([file], {
358
+ const blob = new Blob([buffer], {
358
359
  type: "application/octet-stream",
359
360
  });
360
361
  formData.append(`package:${pJson.name}`, blob, filename);
362
+
363
+ await fs.rm(filePath)
361
364
  } finally {
362
365
  await restoreMap.get(p)?.();
363
366
  }
@@ -554,10 +557,10 @@ function hijackDeps(
554
557
  }
555
558
 
556
559
  function getFormEntrySize(entry: FormDataEntryValue) {
557
- if (entry instanceof File) {
558
- return entry.size;
560
+ if (typeof entry === 'string') {
561
+ return entry.length;
559
562
  }
560
- return entry.length;
563
+ return entry.size;
561
564
  }
562
565
 
563
566
  async function verifyCompactMode(packageName: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkg-pr-new",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",