@axium/storage 0.20.0 → 0.20.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.
@@ -57,7 +57,7 @@ import { database } from '@axium/server/database';
57
57
  import { error, withError } from '@axium/server/requests';
58
58
  import { addRoute } from '@axium/server/routes';
59
59
  import { createHash } from 'node:crypto';
60
- import { closeSync, openSync, readFileSync, readSync, renameSync, unlinkSync, writeFileSync, writeSync } from 'node:fs';
60
+ import { closeSync, copyFileSync, openSync, readSync, renameSync, unlinkSync, writeFileSync, writeSync } from 'node:fs';
61
61
  import { join } from 'node:path/posix';
62
62
  import * as z from 'zod';
63
63
  import '../polyfills.js';
@@ -131,7 +131,7 @@ addRoute({
131
131
  catch (e) {
132
132
  if (e.code != 'EXDEV')
133
133
  throw e;
134
- writeFileSync(path, readFileSync(upload.file));
134
+ copyFileSync(upload.file, path);
135
135
  }
136
136
  });
137
137
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/storage",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "User file storage for Axium",
6
6
  "funding": {