From 644c416389122a6071e4f3c678fc636ac6fc95ee Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 29 Oct 2020 06:22:41 +0100 Subject: [PATCH] crypto: rename check to createJob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit renames the check function to createJob which seems to be more descriptive of what this function does. PR-URL: https://github.com/nodejs/node/pull/35858 Reviewed-By: Rich Trott Reviewed-By: Michaƫl Zasso Reviewed-By: Benjamin Gruenbaum --- lib/internal/crypto/keygen.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 8260f59588c714..5f29a3153b94e0 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -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); @@ -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) { @@ -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);