mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Run generateKeyPair on next tick
This commit is contained in:
@@ -11938,9 +11938,9 @@ crypto_exports.generateKeyPairSync = _generateKeyPairSync;
|
||||
crypto_exports.generateKeyPair = function (algorithm, options, callback) {
|
||||
try {
|
||||
const result = _generateKeyPairSync(algorithm, options);
|
||||
typeof callback === "function" && callback(null, result.publicKey, result.privateKey);
|
||||
typeof callback === "function" && process.nextTick(callback, null, result.publicKey, result.privateKey);
|
||||
} catch (err) {
|
||||
typeof callback === "function" && callback(err);
|
||||
typeof callback === "function" && process.nextTick(callback, err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user