@aws-sdk/body-checksum-browser 3.972.11 → 3.972.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var sha256TreeHash = require('@aws-sdk/sha256-tree-hash');
4
- var chunkedBlobReader = require('@smithy/chunked-blob-reader');
5
- var utilHexEncoding = require('@smithy/util-hex-encoding');
6
- var utilUtf8 = require('@smithy/util-utf8');
4
+ var checksum = require('@smithy/core/checksum');
5
+ var serde = require('@smithy/core/serde');
7
6
 
8
7
  const MiB = 1024 * 1024;
9
8
  async function bodyChecksumGenerator(request, options) {
@@ -11,13 +10,13 @@ async function bodyChecksumGenerator(request, options) {
11
10
  const treeHash = new sha256TreeHash.TreeHash(options.sha256, options.utf8Decoder);
12
11
  const { body } = request;
13
12
  if (typeof body === "string") {
14
- contentHash.update(utilUtf8.toUint8Array(body));
13
+ contentHash.update(serde.toUint8Array(body));
15
14
  treeHash.update(body);
16
15
  }
17
16
  else {
18
17
  if (Boolean(body) &&
19
18
  (Object.prototype.toString.call(body) === "[object Blob]" || body.constructor?.name === "Blob")) {
20
- await chunkedBlobReader.blobReader(body, (chunk) => {
19
+ await checksum.blobReader(body, (chunk) => {
21
20
  treeHash?.update(chunk);
22
21
  contentHash?.update(chunk);
23
22
  }, MiB);
@@ -26,7 +25,7 @@ async function bodyChecksumGenerator(request, options) {
26
25
  throw new Error(`Unable to calculate checksums for non-blob streams, received: ${body.constructor.name + ":" + Object.prototype.toString.call(body)}.`);
27
26
  }
28
27
  }
29
- return [utilHexEncoding.toHex(await contentHash.digest()), utilHexEncoding.toHex(await treeHash.digest())];
28
+ return [serde.toHex(await contentHash.digest()), serde.toHex(await treeHash.digest())];
30
29
  }
31
30
 
32
31
  exports.bodyChecksumGenerator = bodyChecksumGenerator;
package/dist-es/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { TreeHash } from "@aws-sdk/sha256-tree-hash";
2
- import { blobReader } from "@smithy/chunked-blob-reader";
3
- import { toHex } from "@smithy/util-hex-encoding";
4
- import { toUint8Array } from "@smithy/util-utf8";
2
+ import { blobReader } from "@smithy/core/checksum";
3
+ import { toHex, toUint8Array } from "@smithy/core/serde";
5
4
  const MiB = 1024 * 1024;
6
5
  export async function bodyChecksumGenerator(request, options) {
7
6
  const contentHash = new options.sha256();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/body-checksum-browser",
3
- "version": "3.972.11",
3
+ "version": "3.972.13",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
6
6
  "build:cjs": "node ../../scripts/compilation/inline body-checksum-browser",
@@ -22,13 +22,10 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@aws-sdk/sha256-tree-hash": "^3.972.11",
25
+ "@aws-sdk/sha256-tree-hash": "^3.972.12",
26
26
  "@aws-sdk/types": "^3.973.8",
27
- "@smithy/chunked-blob-reader": "^5.2.2",
28
- "@smithy/protocol-http": "^5.3.14",
27
+ "@smithy/core": "^3.24.2",
29
28
  "@smithy/types": "^4.14.1",
30
- "@smithy/util-hex-encoding": "^4.2.2",
31
- "@smithy/util-utf8": "^4.2.2",
32
29
  "tslib": "^2.6.2"
33
30
  },
34
31
  "devDependencies": {