@aws-sdk/lib-storage 3.901.0 → 3.905.0

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-cjs/index.js CHANGED
@@ -50,7 +50,7 @@ var byteLength = /* @__PURE__ */ __name((input) => {
50
50
  return input.size;
51
51
  } else if (typeof input.start === "number" && typeof input.end === "number") {
52
52
  return input.end + 1 - input.start;
53
- } else if (typeof input.path === "string") {
53
+ } else if (import_runtimeConfig.runtimeConfig.isFileReadStream(input)) {
54
54
  try {
55
55
  return import_runtimeConfig.runtimeConfig.lstatSync(input.path).size;
56
56
  } catch (error) {
@@ -80,7 +80,7 @@ var byteLengthSource = /* @__PURE__ */ __name((input, override) => {
80
80
  return "the value of Body.size" /* SIZE */;
81
81
  } else if (typeof input.start === "number" && typeof input.end === "number") {
82
82
  return "the numeric difference between Body.start and Body.end" /* START_END_DIFF */;
83
- } else if (typeof input.path === "string") {
83
+ } else if (import_runtimeConfig2.runtimeConfig.isFileReadStream(input)) {
84
84
  try {
85
85
  import_runtimeConfig2.runtimeConfig.lstatSync(input.path).size;
86
86
  return "the size of the file given by Body.path on disk as reported by lstatSync" /* LSTAT */;
@@ -7,4 +7,7 @@ exports.runtimeConfig = {
7
7
  ...runtimeConfig_shared_1.runtimeConfigShared,
8
8
  runtime: "node",
9
9
  lstatSync: fs_1.lstatSync,
10
+ isFileReadStream(f) {
11
+ return f instanceof fs_1.ReadStream;
12
+ },
10
13
  };
@@ -3,4 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runtimeConfigShared = void 0;
4
4
  exports.runtimeConfigShared = {
5
5
  lstatSync: () => { },
6
+ isFileReadStream(f) {
7
+ return false;
8
+ },
6
9
  };
@@ -19,7 +19,7 @@ export const byteLength = (input) => {
19
19
  else if (typeof input.start === "number" && typeof input.end === "number") {
20
20
  return input.end + 1 - input.start;
21
21
  }
22
- else if (typeof input.path === "string") {
22
+ else if (runtimeConfig.isFileReadStream(input)) {
23
23
  try {
24
24
  return runtimeConfig.lstatSync(input.path).size;
25
25
  }
@@ -32,7 +32,7 @@ export const byteLengthSource = (input, override) => {
32
32
  else if (typeof input.start === "number" && typeof input.end === "number") {
33
33
  return BYTE_LENGTH_SOURCE.START_END_DIFF;
34
34
  }
35
- else if (typeof input.path === "string") {
35
+ else if (runtimeConfig.isFileReadStream(input)) {
36
36
  try {
37
37
  runtimeConfig.lstatSync(input.path).size;
38
38
  return BYTE_LENGTH_SOURCE.LSTAT;
@@ -1,7 +1,10 @@
1
- import { lstatSync } from "fs";
1
+ import { lstatSync, ReadStream } from "fs";
2
2
  import { runtimeConfigShared as shared } from "./runtimeConfig.shared";
3
3
  export const runtimeConfig = {
4
4
  ...shared,
5
5
  runtime: "node",
6
6
  lstatSync,
7
+ isFileReadStream(f) {
8
+ return f instanceof ReadStream;
9
+ },
7
10
  };
@@ -1,3 +1,6 @@
1
1
  export const runtimeConfigShared = {
2
2
  lstatSync: () => { },
3
+ isFileReadStream(f) {
4
+ return false;
5
+ },
3
6
  };
@@ -4,4 +4,5 @@
4
4
  export declare const runtimeConfig: {
5
5
  runtime: string;
6
6
  lstatSync: () => void;
7
+ isFileReadStream(f: unknown): boolean;
7
8
  };
@@ -1,7 +1,9 @@
1
+ import { ReadStream } from "fs";
1
2
  /**
2
3
  * @internal
3
4
  */
4
5
  export declare const runtimeConfig: {
5
6
  runtime: string;
6
7
  lstatSync: import("fs").StatSyncFn;
8
+ isFileReadStream(f: unknown): f is ReadStream;
7
9
  };
@@ -4,4 +4,5 @@
4
4
  export declare const runtimeConfig: {
5
5
  runtime: string;
6
6
  lstatSync: () => void;
7
+ isFileReadStream(f: unknown): boolean;
7
8
  };
@@ -3,4 +3,5 @@
3
3
  */
4
4
  export declare const runtimeConfigShared: {
5
5
  lstatSync: () => void;
6
+ isFileReadStream(f: unknown): boolean;
6
7
  };
@@ -1,4 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
2
  runtime: string;
3
3
  lstatSync: () => void;
4
+ isFileReadStream(f: unknown): boolean;
4
5
  };
@@ -1,4 +1,6 @@
1
+ import { ReadStream } from "fs";
1
2
  export declare const runtimeConfig: {
2
3
  runtime: string;
3
4
  lstatSync: import("fs").StatSyncFn;
5
+ isFileReadStream(f: unknown): f is ReadStream;
4
6
  };
@@ -1,4 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
2
  runtime: string;
3
3
  lstatSync: () => void;
4
+ isFileReadStream(f: unknown): boolean;
4
5
  };
@@ -1,3 +1,4 @@
1
1
  export declare const runtimeConfigShared: {
2
2
  lstatSync: () => void;
3
+ isFileReadStream(f: unknown): boolean;
3
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/lib-storage",
3
- "version": "3.901.0",
3
+ "version": "3.905.0",
4
4
  "description": "Storage higher order operation",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -15,8 +15,10 @@
15
15
  "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
16
16
  "extract:docs": "api-extractor run --local",
17
17
  "test": "yarn g:vitest run",
18
- "test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts --mode development",
19
18
  "test:watch": "yarn g:vitest watch",
19
+ "test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
20
+ "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts",
21
+ "test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts --mode development",
20
22
  "test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts"
21
23
  },
22
24
  "engines": {