Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
6
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 3.52.0 to 3.54.0

dist-cjs/calculateBodyLength.js

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11)
**Note:** Version bump only for package @aws-sdk/util-body-length-browser
# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18)

@@ -8,0 +16,0 @@

23

dist-cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateBodyLength = void 0;
function calculateBodyLength(body) {
if (typeof body === "string") {
let len = body.length;
for (let i = len - 1; i >= 0; i--) {
const code = body.charCodeAt(i);
if (code > 0x7f && code <= 0x7ff)
len++;
else if (code > 0x7ff && code <= 0xffff)
len += 2;
}
return len;
}
else if (typeof body.byteLength === "number") {
return body.byteLength;
}
else if (typeof body.size === "number") {
return body.size;
}
}
exports.calculateBodyLength = calculateBodyLength;
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./calculateBodyLength"), exports);

@@ -1,19 +0,1 @@

export function calculateBodyLength(body) {
if (typeof body === "string") {
var len = body.length;
for (var i = len - 1; i >= 0; i--) {
var code = body.charCodeAt(i);
if (code > 0x7f && code <= 0x7ff)
len++;
else if (code > 0x7ff && code <= 0xffff)
len += 2;
}
return len;
}
else if (typeof body.byteLength === "number") {
return body.byteLength;
}
else if (typeof body.size === "number") {
return body.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-browser",
"description": "Determines the length of a request body in browsers",
"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