mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 优化内存占用
This commit is contained in:
@@ -7,7 +7,7 @@ const specials = '~!@#$%^*()_+-=[]{}|;:,./<>?';
|
||||
* @param {Number} length
|
||||
* @param {Object} options
|
||||
*/
|
||||
function randomStr(length, options) {
|
||||
function randomStr(length, options?) {
|
||||
length || (length = 8);
|
||||
options || (options = {});
|
||||
|
||||
@@ -28,8 +28,7 @@ function randomStr(length, options) {
|
||||
}
|
||||
|
||||
if (options.specials) {
|
||||
chars +=
|
||||
typeof options.specials === 'string' ? options.specials : specials;
|
||||
chars += typeof options.specials === 'string' ? options.specials : specials;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user