@aws-sdk/util-body-length-node
Advanced tools
Comparing version 3.52.0 to 3.54.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11) | ||
### Bug Fixes | ||
* **util-body-length-node:** fs.ReadStream with path of Buffer type ([#3384](https://github.com/aws/aws-sdk-js-v3/issues/3384)) ([d220242](https://github.com/aws/aws-sdk-js-v3/commit/d220242b3ab1075e6a7ea16987ed15bbfec2e6fd)) | ||
* **util-body-length-node:** support fd.createReadStream ([#3385](https://github.com/aws/aws-sdk-js-v3/issues/3385)) ([88f8cc2](https://github.com/aws/aws-sdk-js-v3/commit/88f8cc2d3d33f4dc6d06312e75f70725c89d1f17)) | ||
# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18) | ||
@@ -8,0 +20,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calculateBodyLength = void 0; | ||
const fs_1 = require("fs"); | ||
function calculateBodyLength(body) { | ||
if (!body) { | ||
return 0; | ||
} | ||
if (typeof body === "string") { | ||
return Buffer.from(body).length; | ||
} | ||
else if (typeof body.byteLength === "number") { | ||
return body.byteLength; | ||
} | ||
else if (typeof body.size === "number") { | ||
return body.size; | ||
} | ||
else if (typeof body.path === "string") { | ||
return fs_1.lstatSync(body.path).size; | ||
} | ||
} | ||
exports.calculateBodyLength = calculateBodyLength; | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./calculateBodyLength"), exports); |
@@ -1,18 +0,1 @@ | ||
import { lstatSync } from "fs"; | ||
export function calculateBodyLength(body) { | ||
if (!body) { | ||
return 0; | ||
} | ||
if (typeof body === "string") { | ||
return Buffer.from(body).length; | ||
} | ||
else if (typeof body.byteLength === "number") { | ||
return body.byteLength; | ||
} | ||
else if (typeof body.size === "number") { | ||
return body.size; | ||
} | ||
else if (typeof body.path === "string") { | ||
return lstatSync(body.path).size; | ||
} | ||
} | ||
export * from "./calculateBodyLength"; |
@@ -1,1 +0,1 @@ | ||
export declare function calculateBodyLength(body: any): number | undefined; | ||
export * from "./calculateBodyLength"; |
@@ -1,1 +0,1 @@ | ||
export declare function calculateBodyLength(body: any): number | undefined; | ||
export * from "./calculateBodyLength"; |
{ | ||
"name": "@aws-sdk/util-body-length-node", | ||
"description": "Determines the length of a request body in node.js", | ||
"version": "3.52.0", | ||
"version": "3.54.0", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33106
12
57