Comparing version 3.3.0 to 3.3.1
import { urlAlphabet } from './url-alphabet/index.js' | ||
if (process.env.NODE_ENV !== 'production') { | ||
if ( | ||
typeof navigator !== 'undefined' && | ||
navigator.product === 'ReactNative' && | ||
typeof crypto === 'undefined' | ||
) { | ||
throw new Error( | ||
'React Native does not have a built-in secure random generator. ' + | ||
'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' + | ||
'For secure IDs, import `react-native-get-random-values` ' + | ||
'before Nano ID.' | ||
) | ||
} | ||
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') { | ||
throw new Error( | ||
'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' + | ||
' before importing Nano ID to fix IE 11 support' | ||
) | ||
} | ||
if (typeof crypto === 'undefined') { | ||
throw new Error( | ||
'Your browser does not have secure random generator. ' + | ||
'If you don’t need unpredictable IDs, you can use nanoid/non-secure.' | ||
) | ||
} | ||
} | ||
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) | ||
@@ -29,0 +3,0 @@ let customRandom = (alphabet, defaultSize, getRandom) => { |
{ | ||
"name": "nanoid", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "A tiny (130 bytes), secure URL-friendly unique string ID generator", | ||
@@ -32,7 +32,3 @@ "keywords": [ | ||
".": { | ||
"browser": { | ||
"development": "./index.dev.js", | ||
"production": "./index.prod.js", | ||
"default": "./index.prod.js" | ||
}, | ||
"browser": "./index.browser.js", | ||
"require": "./index.cjs", | ||
@@ -39,0 +35,0 @@ "import": "./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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
21672
24
595