From bee08614289a56fe9b890aabfac71adf2cb61d0a Mon Sep 17 00:00:00 2001 From: jordanfinners <17813098+jordanfinners@users.noreply.github.com> Date: Sun, 26 May 2024 13:19:36 +0100 Subject: [PATCH] Add `node:` prefix * Add prefix to nodejs dependencies to support running in Node and Cloudflare environments https://developers.cloudflare.com/workers/runtime-apis/nodejs/ --- sign.js | 2 +- verify.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sign.js b/sign.js index 82bf526..aa0876d 100644 --- a/sign.js +++ b/sign.js @@ -9,7 +9,7 @@ const isNumber = require('lodash.isnumber'); const isPlainObject = require('lodash.isplainobject'); const isString = require('lodash.isstring'); const once = require('lodash.once'); -const { KeyObject, createSecretKey, createPrivateKey } = require('crypto') +const { KeyObject, createSecretKey, createPrivateKey } = require('node:crypto') const SUPPORTED_ALGS = ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512', 'none']; if (PS_SUPPORTED) { diff --git a/verify.js b/verify.js index cdbfdc4..ee94e9d 100644 --- a/verify.js +++ b/verify.js @@ -6,7 +6,7 @@ const timespan = require('./lib/timespan'); const validateAsymmetricKey = require('./lib/validateAsymmetricKey'); const PS_SUPPORTED = require('./lib/psSupported'); const jws = require('jws'); -const {KeyObject, createSecretKey, createPublicKey} = require("crypto"); +const {KeyObject, createSecretKey, createPublicKey} = require("node:crypto"); const PUB_KEY_ALGS = ['RS256', 'RS384', 'RS512']; const EC_KEY_ALGS = ['ES256', 'ES384', 'ES512'];