Comparing version 5.1.0 to 5.2.0
10
index.js
@@ -7,12 +7,10 @@ 'use strict'; | ||
const requireOptional = (name, defaultValue) => { | ||
const {Worker} = (() => { | ||
try { | ||
return require(name); | ||
return require('worker_threads'); | ||
} catch (_) { | ||
return defaultValue; | ||
return {}; | ||
} | ||
}; | ||
})(); | ||
const {Worker} = requireOptional('worker_threads', {}); | ||
let worker; // Lazy | ||
@@ -19,0 +17,0 @@ let taskIdCounter = 0; |
{ | ||
"name": "hasha", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Hashing made simple. Get the hash of a buffer/string/stream/file.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
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
3
15974
296