discord-interactions
Advanced tools
Comparing version 4.0.0-alpha.0 to 4.0.0-alpha.1
@@ -10,12 +10,20 @@ "use strict"; | ||
if (typeof window !== 'undefined' && window.crypto) { | ||
console.log('using window.crypto'); | ||
return window.crypto.subtle; | ||
} | ||
if (typeof globalThis !== 'undefined' && globalThis.crypto) { | ||
console.log('using globalThis.crypto'); | ||
return globalThis.crypto.subtle; | ||
} | ||
if (typeof crypto !== 'undefined') { | ||
console.log('using crypto'); | ||
return crypto.subtle; | ||
} | ||
if (typeof require === 'function') { | ||
const crypto = require('node:crypto'); | ||
console.log('using npm builtin'); | ||
// Cloudflare workers are doing what appears to be a regex check to look and | ||
// warn for this pattern. We should never get her in a cloudflare worker, so | ||
// I am being coy to avoid detection and a warning. | ||
const cryptoPackage = 'node:crypto'; | ||
const crypto = require(cryptoPackage); | ||
return crypto.webcrypto.subtle; | ||
@@ -22,0 +30,0 @@ } |
{ | ||
"name": "discord-interactions", | ||
"version": "4.0.0-alpha.0", | ||
"version": "4.0.0-alpha.1", | ||
"description": "Helpers for discord interactions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
34820
527
0
1