Skip to content

Commit

Permalink
chore(deps): Migrate from deprecated @aws-sdk/hash-node to `@smithy…
Browse files Browse the repository at this point in the history
…/hash-node`

Signed-off-by: Andrew Haines <[email protected]>
  • Loading branch information
haines committed Apr 9, 2024
1 parent 41adb5d commit 3bce31c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 97 deletions.
127 changes: 58 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sha256-universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"license": "Apache-2.0",
"dependencies": {
"@aws-crypto/sha256-browser": "file:../sha256-browser",
"@aws-sdk/hash-node": "^3.110.0",
"@aws-sdk/types": "~3.413.0",
"@smithy/hash-node": "^2.2.0",
"tslib": "~2.6.2"
},
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"browser": {
"@aws-sdk/hash-node": false,
"@smithy/hash-node": false,
"crypto": false
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sha256-universal/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Sha256 as BrowserSha256 } from "@aws-crypto/sha256-browser";
import { Checksum, SourceData } from "@aws-sdk/types";
import { convertToBuffer } from "@aws-crypto/util";
import { NodeHash } from './node_hash'
import { Hash as NodeHash } from "@smithy/hash-node";

export class Sha256 implements Checksum {
private hash: Checksum;
Expand Down
24 changes: 0 additions & 24 deletions packages/sha256-universal/src/node_hash.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sha256-universal/test/nodeUsage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Sha256 } from "../src/";

import * as sinon from "sinon";
import * as crypto from "crypto";
import { NodeHash as Hash } from "../src/node_hash";
import { Hash } from "@smithy/hash-node";

describe("implementation selection", () => {
before(() => sinon.stub(crypto, "createHash"));
Expand Down

0 comments on commit 3bce31c

Please sign in to comment.