Skip to content

Commit aadd3f4

Browse files
committed
Rewrite imports: add .js extension, gh-86
1 parent 263279a commit aadd3f4

25 files changed

+53
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/node_modules
88
/.parcel-cache
99
/esm
10+
/test/node_modules

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-cryptography",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "All the cryptographic primitives used in Ethereum",
55
"contributors": [
66
{

src/aes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { crypto as cr } from "@noble/hashes/crypto";
2-
import { concatBytes, equalsBytes } from "./utils";
2+
import { concatBytes, equalsBytes } from "./utils.js";
33

44
const crypto: any = { web: cr };
55

src/blake2b.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { blake2b as _blake2b } from "@noble/hashes/blake2b";
2-
import { assertBytes } from "./utils";
2+
import { assertBytes } from "./utils.js";
33

44
export const blake2b = (msg: Uint8Array, outputLength = 64): Uint8Array => {
55
assertBytes(msg);

src/keccak.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
keccak_512
77
} from "@noble/hashes/sha3";
88
import { Hash } from "@noble/hashes/utils";
9-
import { wrapHash } from "./utils";
9+
import { wrapHash } from "./utils.js";
1010

1111
// Expose create only for keccak256
1212
interface K256 {

src/pbkdf2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from "@noble/hashes/pbkdf2";
55
import { sha256 } from "@noble/hashes/sha256";
66
import { sha512 } from "@noble/hashes/sha512";
7-
import { assertBytes } from "./utils";
7+
import { assertBytes } from "./utils.js";
88

99
export async function pbkdf2(
1010
password: Uint8Array,

src/ripemd160.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { ripemd160 as _ripemd160 } from "@noble/hashes/ripemd160";
2-
import { wrapHash } from "./utils";
2+
import { wrapHash } from "./utils.js";
33

44
export const ripemd160 = wrapHash(_ripemd160);

src/scrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { scrypt as _sync, scryptAsync as _async } from "@noble/hashes/scrypt";
2-
import { assertBytes } from "./utils";
2+
import { assertBytes } from "./utils.js";
33

44
type OnProgressCallback = (progress: number) => void;
55

src/secp256k1-compat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { sha256 } from "@noble/hashes/sha256";
22
import { mod } from "@noble/curves/abstract/modular";
3-
import { secp256k1 } from "./secp256k1";
4-
import { assertBool, assertBytes, hexToBytes, toHex } from "./utils";
3+
import { secp256k1 } from "./secp256k1.js";
4+
import { assertBool, assertBytes, hexToBytes, toHex } from "./utils.js";
55

66
// Use `secp256k1` module directly.
77
// This is a legacy compatibility layer for the npm package `secp256k1` via noble-secp256k1

src/sha256.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { sha256 as _sha256 } from "@noble/hashes/sha256";
2-
import { wrapHash } from "./utils";
2+
import { wrapHash } from "./utils.js";
33

44
export const sha256 = wrapHash(_sha256);

0 commit comments

Comments
 (0)