Skip to content

Commit 34c07b0

Browse files
committed
Use Promise instead of PromiseLike
1 parent f9e10e4 commit 34c07b0

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/sdk-crypto/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function(config) {
2121
logLevel: config.LOG_WARN,
2222
autoWatch: false,
2323
browsers: ['HeadlessChrome'],
24-
singleRun: true,
24+
singleRun: false,
2525
concurrency: Infinity,
2626
customLaunchers: {
2727
HeadlessChrome: {

packages/sdk-crypto/lib/BrowserCryptoProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class BrowserCryptoProvider implements CryptoProvider {
1717
}
1818
}
1919

20-
sha256Digest(toHash: SourceData): PromiseLike<Uint8Array> {
20+
sha256Digest(toHash: SourceData): Promise<Uint8Array> {
2121
if (isEmptyData(toHash)) {
2222
return emptyDataSha256();
2323
}
@@ -27,7 +27,7 @@ export default class BrowserCryptoProvider implements CryptoProvider {
2727
.then<Uint8Array>(buffer => new Uint8Array(buffer));
2828
}
2929

30-
hmacSha256(toHash: SourceData, secret: SourceData): PromiseLike<Uint8Array> {
30+
hmacSha256(toHash: SourceData, secret: SourceData): Promise<Uint8Array> {
3131
if (isEmptyData(secret)) {
3232
return Promise.reject('HMAC signatures cannot be generated with empty key data.');
3333
}

packages/sdk-crypto/lib/CryptoProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export interface ProviderOptions {
55
}
66

77
interface CryptoProvider {
8-
sha256Digest(toHash: SourceData): PromiseLike<Uint8Array>;
9-
hmacSha256(toHash: SourceData, secret: SourceData): PromiseLike<Uint8Array>;
10-
randomValues(length: number): PromiseLike<Uint8Array>;
8+
sha256Digest(toHash: SourceData): Promise<Uint8Array>;
9+
hmacSha256(toHash: SourceData, secret: SourceData): Promise<Uint8Array>;
10+
randomValues(length: number): Promise<Uint8Array>;
1111
}
1212

1313
export default CryptoProvider;

packages/sdk-crypto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"prepublishOnly": "tsc",
99
"pretest": "tsc",
10-
"test": "mocha && karma start"
10+
"test": "mocha && karma start --single-run"
1111
},
1212
"author": "[email protected]",
1313
"license": "UNLICENSED",

0 commit comments

Comments
 (0)