Skip to content

Commit

Permalink
fix: rn source import corrected, key argument type error (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
boorad committed May 1, 2024
1 parent 7086647 commit 52ff6f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "react-native-quick-crypto",
"version": "0.7.0-rc.2",
"version": "0.7.0-rc.3",
"description": "A fast implementation of Node's `crypto` module written in C/C++ JSI",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/src/index.d.ts",
"react-native": "lib/module/index",
"react-native": "src/index",
"source": "src/index",
"files": [
"src",
Expand Down
6 changes: 4 additions & 2 deletions src/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export function parsePrivateKeyEncoding(
}

function prepareSecretKey(
key: any, //KeyObject | CryptoKey | string,
key: ArrayBuffer | KeyObject | CryptoKey | string,
encoding?: string,
bufferOnly = false
): any {
Expand Down Expand Up @@ -448,7 +448,9 @@ function prepareSecretKey(
return binaryLikeToArrayBuffer(key, encoding);
}

throw new Error('invalid argument type "key"');
throw new Error(
'Invalid argument type for "key". Need ArrayBuffer, KeyObject, CryptoKey, string'
);
}

export function createSecretKey(key: any, encoding?: string) {
Expand Down

0 comments on commit 52ff6f3

Please sign in to comment.