lean-s3 0.8.0 → 0.8.2

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/dist/index.d.ts CHANGED
@@ -634,10 +634,10 @@ declare class S3File {
634
634
  write(data: ByteSource, options?: S3FileWriteOptions): Promise<void>;
635
635
  /**
636
636
  * Copies this file to a new destination.
637
- * @param destination The destination path, can be a string or another S3File instance.
637
+ * @param destination The destination path.
638
638
  * @param options Options for the copy operation.
639
639
  */
640
- copyTo(destination: string | S3File, options?: CopyObjectOptions): Promise<void>;
640
+ copyTo(destination: string, options?: CopyObjectOptions): Promise<void>;
641
641
  }
642
642
  interface S3FileDeleteOptions extends OverridableS3ClientOptions {
643
643
  /** Signal to abort the request. */
package/dist/index.js CHANGED
@@ -598,7 +598,7 @@ var S3Client = class {
598
598
  const destinationBucket = options.destinationBucket ? ensureValidBucketName(options.destinationBucket) : this.#options.bucket;
599
599
  const normalizedSourceKey = normalizePath(ensureValidPath(sourceKey));
600
600
  const copySource = encodeURIComponent(
601
- `/${sourceBucket}/${normalizedSourceKey}`
601
+ `${sourceBucket}/${normalizedSourceKey}`
602
602
  );
603
603
  const response = await this[kSignedRequest](
604
604
  this.#options.region,
@@ -1775,12 +1775,11 @@ var S3File = class _S3File {
1775
1775
  }
1776
1776
  /**
1777
1777
  * Copies this file to a new destination.
1778
- * @param destination The destination path, can be a string or another S3File instance.
1778
+ * @param destination The destination path.
1779
1779
  * @param options Options for the copy operation.
1780
1780
  */
1781
1781
  async copyTo(destination, options = {}) {
1782
- const destinationKey = typeof destination === "string" ? destination : destination.#path;
1783
- await this.#client.copyObject(this.#path, destinationKey, options);
1782
+ await this.#client.copyObject(this.#path, destination, options);
1784
1783
  }
1785
1784
  };
1786
1785
  export {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lean-s3",
3
3
  "author": "Niklas Mollenhauer",
4
4
  "license": "MIT",
5
- "version": "0.8.0",
5
+ "version": "0.8.2",
6
6
  "description": "A server-side S3 API for the regular user.",
7
7
  "keywords": [
8
8
  "s3",
@@ -51,7 +51,7 @@
51
51
  "@testcontainers/localstack": "^11.5.1",
52
52
  "@testcontainers/minio": "^11.5.1",
53
53
  "@types/node": "^24.3.0",
54
- "@typescript/native-preview": "^7.0.0-dev.20250825.1",
54
+ "@typescript/native-preview": "^7.0.0-dev.20250826.1",
55
55
  "expect": "^30.0.5",
56
56
  "lefthook": "^1.12.3",
57
57
  "testcontainers": "^11.5.1",