Skip to content

Commit

Permalink
crypto: rename check to createJob
Browse files Browse the repository at this point in the history
This commit renames the check function to createJob which seems to be
more descriptive of what this function does.

PR-URL: #35858
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
danbev authored and targos committed Nov 3, 2020
1 parent 337bfcf commit 644c416
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/crypto/keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function generateKeyPair(type, options, callback) {
if (typeof callback !== 'function')
throw new ERR_INVALID_CALLBACK(callback);

const job = check(kCryptoJobAsync, type, options);
const job = createJob(kCryptoJobAsync, type, options);

job.ondone = (error, result) => {
if (error) return FunctionPrototypeCall(callback, job, error);
Expand All @@ -91,7 +91,7 @@ ObjectDefineProperty(generateKeyPair, customPromisifyArgs, {
});

function generateKeyPairSync(type, options) {
return handleError(check(kCryptoJobSync, type, options).run());
return handleError(createJob(kCryptoJobSync, type, options).run());
}

function handleError(ret) {
Expand Down Expand Up @@ -152,7 +152,7 @@ function parseKeyEncoding(keyType, options = {}) {
];
}

function check(mode, type, options) {
function createJob(mode, type, options) {
validateString(type, 'type');

const encoding = parseKeyEncoding(type, options);
Expand Down

0 comments on commit 644c416

Please sign in to comment.