@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 +2 -2
- package/dist-cjs/runtimeConfig.js +3 -0
- package/dist-cjs/runtimeConfig.shared.js +3 -0
- package/dist-es/byteLength.js +1 -1
- package/dist-es/byteLengthSource.js +1 -1
- package/dist-es/runtimeConfig.js +4 -1
- package/dist-es/runtimeConfig.shared.js +3 -0
- package/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +2 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/runtimeConfig.shared.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -0
- package/package.json +4 -2
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 (
|
|
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 (
|
|
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 */;
|
package/dist-es/byteLength.js
CHANGED
|
@@ -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 (
|
|
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 (
|
|
35
|
+
else if (runtimeConfig.isFileReadStream(input)) {
|
|
36
36
|
try {
|
|
37
37
|
runtimeConfig.lstatSync(input.path).size;
|
|
38
38
|
return BYTE_LENGTH_SOURCE.LSTAT;
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/lib-storage",
|
|
3
|
-
"version": "3.
|
|
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": {
|