Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

s3-etag

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-etag - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

@@ -19,6 +19,6 @@ "use strict";

function generateETag(filePath, partSizeInBytes = 0) {
if (partSizeInBytes === 0) {
const { size: fileSizeInBytes } = fs_1.default.statSync(filePath);
if (partSizeInBytes === 0 || fileSizeInBytes <= partSizeInBytes) {
return md5(fs_1.default.readFileSync(filePath));
}
const { size: fileSizeInBytes } = fs_1.default.statSync(filePath);
let parts = Math.floor(fileSizeInBytes / partSizeInBytes);

@@ -25,0 +25,0 @@ if (fileSizeInBytes % partSizeInBytes > 0) {

@@ -13,6 +13,6 @@ /**

export function generateETag(filePath, partSizeInBytes = 0) {
if (partSizeInBytes === 0) {
const { size: fileSizeInBytes } = fs.statSync(filePath);
if (partSizeInBytes === 0 || fileSizeInBytes <= partSizeInBytes) {
return md5(fs.readFileSync(filePath));
}
const { size: fileSizeInBytes } = fs.statSync(filePath);
let parts = Math.floor(fileSizeInBytes / partSizeInBytes);

@@ -19,0 +19,0 @@ if (fileSizeInBytes % partSizeInBytes > 0) {

{
"name": "s3-etag",
"version": "1.0.4",
"version": "1.0.5",
"private": false,

@@ -54,3 +54,3 @@ "description": "Generate an accurate S3 ETAG for multipart uploads in Node.js",

"jest": "^29.7.0",
"prettier": "3.0.3",
"prettier": "3.1.1",
"rimraf": "^5.0.5",

@@ -57,0 +57,0 @@ "ts-jest": "^29.1.1",