@dimah-s3/server 1.5.6 → 1.5.8

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.
@@ -1,4 +1,4 @@
1
- import type { DimahS3Config } from "../types";
1
+ import type { DimahS3Config } from "../types/index.d.ts";
2
2
  import { type AppliedPlugins, type DimahS3Plugin, type PluginContextMap } from "./types";
3
3
  /**
4
4
  * Validate plugins, build context map, collect endpoints, validate routes,
@@ -1,5 +1,5 @@
1
1
  import type { Endpoint } from "better-call";
2
- import type { DeleteConfig, DownloadConfig, MultipartConfig, UploadConfig, DimahS3Config, ResolvedDimahS3Config } from "../types/config";
2
+ import type { DeleteConfig, DownloadConfig, MultipartConfig, UploadConfig, DimahS3Config, ResolvedDimahS3Config } from "../types/config.d.ts";
3
3
  import type { FeatureHookKeyMap, MultipartHookKey } from "./hook-registry";
4
4
  type HookFields<T, K extends keyof T> = Pick<T, K>;
5
5
  /**
package/dist/plugins.js CHANGED
@@ -263,7 +263,7 @@ function assertStoredKey(key, keyPrefix) {
263
263
  }
264
264
  function objectKeyFileName(fileName) {
265
265
  const sanitized = sanitizeFileName(fileName);
266
- const leaf = sanitized.split("/").filter((part) => part.length > 0).at(-1);
266
+ const leaf = sanitized.split("/").findLast((part) => part.length > 0);
267
267
  if (!leaf || leaf === "." || leaf === "..") return "file";
268
268
  return leaf;
269
269
  }
@@ -352,7 +352,7 @@ function skippedPluginIds(plugins) {
352
352
  const ids = /* @__PURE__ */ new Set();
353
353
  if (!plugins) return ids;
354
354
  for (const [id, enabled] of Object.entries(plugins)) {
355
- if (enabled === false) ids.add(id);
355
+ if (!enabled) ids.add(id);
356
356
  }
357
357
  return ids;
358
358
  }
@@ -595,7 +595,7 @@ async function finalizeConfirmedObject(client, bucket, key, input) {
595
595
  ...stored,
596
596
  contentType: head.ContentType,
597
597
  contentLength,
598
- eTag: head.ETag?.replace(/"/g, ""),
598
+ eTag: head.ETag?.replaceAll('"', ""),
599
599
  metadata,
600
600
  acl,
601
601
  fileName,
@@ -906,7 +906,7 @@ async function handleFile(config, input, request) {
906
906
  new GetObjectCommand({
907
907
  Bucket: bucket,
908
908
  Key: key,
909
- ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) : `${disposition}`
909
+ ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) : disposition
910
910
  })
911
911
  )
912
912
  );
@@ -917,7 +917,7 @@ async function handleFile(config, input, request) {
917
917
  headers.set("Content-Type", result.ContentType ?? "application/octet-stream");
918
918
  headers.set(
919
919
  "Content-Disposition",
920
- fileName ? buildContentDisposition(fileName, disposition) : `${disposition}`
920
+ fileName ? buildContentDisposition(fileName, disposition) : disposition
921
921
  );
922
922
  if (typeof result.ContentLength === "number") {
923
923
  headers.set("Content-Length", String(result.ContentLength));
@@ -1170,7 +1170,7 @@ async function handleListParts(config, input, request) {
1170
1170
  {
1171
1171
  partNumber: p.PartNumber,
1172
1172
  size: p.Size ?? 0,
1173
- eTag: (p.ETag ?? "").replace(/"/g, "")
1173
+ eTag: (p.ETag ?? "").replaceAll('"', "")
1174
1174
  }
1175
1175
  ];
1176
1176
  });