nanoid 3.1.11 → 3.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nanoid might be problematic. Click here for more details.
- package/CHANGELOG.md +3 -0
- package/README.md +4 -0
- package/index.browser.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
@@ -175,10 +175,14 @@ If you support IE, you need to [transpile `node_modules`] by Babel
|
|
175
175
|
and add `crypto` alias:
|
176
176
|
|
177
177
|
```js
|
178
|
+
// polyfills.js
|
178
179
|
if (!window.crypto) {
|
179
180
|
window.crypto = window.msCrypto
|
180
181
|
}
|
182
|
+
```
|
181
183
|
|
184
|
+
```js
|
185
|
+
import './polyfills.js'
|
182
186
|
import { nanoid } from 'nanoid'
|
183
187
|
```
|
184
188
|
|
package/index.browser.js
CHANGED
@@ -20,8 +20,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
20
20
|
}
|
21
21
|
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {
|
22
22
|
throw new Error(
|
23
|
-
'
|
24
|
-
'before Nano ID to fix IE 11 support'
|
23
|
+
'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +
|
24
|
+
' before importing Nano ID to fix IE 11 support'
|
25
25
|
)
|
26
26
|
}
|
27
27
|
if (typeof crypto === 'undefined') {
|