Socket
Socket
Sign inDemoInstall

@aws-sdk/util-body-length-node

Package Overview
Dependencies
Maintainers
6
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-body-length-node - npm Package Compare versions

Comparing version 3.52.0 to 3.54.0

dist-cjs/calculateBodyLength.js

12

CHANGELOG.md

@@ -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 @@

22

dist-cjs/index.js
"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'",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc