nanoid 1.3.3 → 1.3.4
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.
- package/CHANGELOG.md +4 -0
- package/async/index.js +3 -1
- package/non-secure.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
+
## 1.3.4
|
5
|
+
* Reduce `non-secure` size.
|
6
|
+
* Add `async` callback type check.
|
7
|
+
|
4
8
|
## 1.3.3
|
5
9
|
* Fix `nanoid/async` performance regression.
|
6
10
|
* Fix old Node.js `not seeded` issue in synchronous version too.
|
package/async/index.js
CHANGED
@@ -36,7 +36,7 @@ module.exports = function (size, callback, attempt) {
|
|
36
36
|
|
37
37
|
if (!callback) {
|
38
38
|
if (typeof Promise !== 'function') {
|
39
|
-
throw new
|
39
|
+
throw new TypeError('Function callback is required')
|
40
40
|
}
|
41
41
|
return new Promise(function (resolve, reject) {
|
42
42
|
module.exports(size, function (error, id) {
|
@@ -47,6 +47,8 @@ module.exports = function (size, callback, attempt) {
|
|
47
47
|
}
|
48
48
|
})
|
49
49
|
})
|
50
|
+
} else if (typeof callback !== 'function') {
|
51
|
+
throw new TypeError('Callback is not a function')
|
50
52
|
}
|
51
53
|
|
52
54
|
random(size, function (err, bytes) {
|
package/non-secure.js
CHANGED