@aws-sdk/util-body-length-node
Advanced tools
Comparing version 0.1.0-preview.2 to 0.1.0-preview.3
@@ -8,13 +8,13 @@ "use strict"; | ||
} | ||
if (typeof body === 'string') { | ||
if (typeof body === "string") { | ||
return Buffer.from(body).length; | ||
} | ||
else if (typeof body.byteLength === 'number') { | ||
else if (typeof body.byteLength === "number") { | ||
// handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView | ||
return body.byteLength; | ||
} | ||
else if (typeof body.size === 'number') { | ||
else if (typeof body.size === "number") { | ||
return body.size; | ||
} | ||
else if (typeof body.path === 'string') { | ||
else if (typeof body.path === "string") { | ||
// handles fs readable streams | ||
@@ -21,0 +21,0 @@ return fs_1.lstatSync(body.path).size; |
{ | ||
"name": "@aws-sdk/util-body-length-node", | ||
"description": "Determines the length of a request body in node.js", | ||
"version": "0.1.0-preview.2", | ||
"scripts": { | ||
"prepublishOnly": "tsc", | ||
"pretest": "tsc -p tsconfig.test.json", | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^20.0.4", | ||
"@types/node": "^8.10.29", | ||
"jest": "^20.0.4", | ||
"typescript": "^3.0.0" | ||
}, | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"author": { | ||
"name": "AWS SDK for JavaScript Team", | ||
"email": "aws-sdk-js@amazon.com", | ||
"url": "https://aws.amazon.com/javascript/" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"tslib": "^1.8.0" | ||
} | ||
"name": "@aws-sdk/util-body-length-node", | ||
"description": "Determines the length of a request body in node.js", | ||
"version": "0.1.0-preview.3", | ||
"scripts": { | ||
"prepublishOnly": "tsc", | ||
"pretest": "tsc -p tsconfig.test.json", | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.12", | ||
"@types/node": "^10.0.0", | ||
"jest": "^24.7.1", | ||
"typescript": "~3.4.0" | ||
}, | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"author": { | ||
"name": "AWS SDK for JavaScript Team", | ||
"email": "", | ||
"url": "https://aws.amazon.com/javascript/" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"tslib": "^1.8.0" | ||
} | ||
} |
@@ -1,3 +0,6 @@ | ||
# util-body-length-node | ||
# @aws-sdk/util-body-length-node | ||
Determines the length of a request body in node.js | ||
Determines the length of a request body in node.js | ||
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-body-length-node/preview.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-node) | ||
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-body-length-node.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-node) |
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"strict": true, | ||
"sourceMap": true, | ||
"downlevelIteration": true, | ||
"lib": [ | ||
"es5", | ||
"es2015.promise", | ||
"es2015.collection", | ||
"es2015.iterable", | ||
"es2015.symbol.wellknown" | ||
], | ||
"rootDir": "./src", | ||
"outDir": "./build", | ||
"importHelpers": true, | ||
"noEmitHelpers": true | ||
} | ||
} | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"strict": true, | ||
"sourceMap": true, | ||
"downlevelIteration": true, | ||
"lib": [ | ||
"es5", | ||
"es2015.promise", | ||
"es2015.collection", | ||
"es2015.iterable", | ||
"es2015.symbol.wellknown" | ||
], | ||
"rootDir": "./src", | ||
"outDir": "./build", | ||
"importHelpers": true, | ||
"noEmitHelpers": true | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
14991
9
49
7