Skip to content

Commit 8c0c90d

Browse files
committed
release: v1.41.1
1 parent 4cacaaf commit 8c0c90d

5 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.41.1 (23 Jul 2024)
2+
3+
* fix: randomId size over 21 error [#33](https://github.com/liriliri/licia/issues/33)
4+
15
## v1.41.0 (18 Jun 2024)
26

37
* feat: add dataUrl

lib/update.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
map,
1111
contain,
1212
sortKeys,
13-
escape,
1413
filter,
1514
concat,
1615
unique

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "licia",
3-
"version": "1.41.0",
3+
"version": "1.41.1",
44
"description": "Useful utility collection with zero dependencies",
55
"bin": {
66
"licia": "./bin/licia.js"

src/randomId.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports = function(size = 21, symbols = defSymbols) {
3030
let id = '';
3131

3232
const len = symbols.length;
33-
const bytes = randomBytes(21);
33+
const bytes = randomBytes(size);
3434
while (0 < size--) {
3535
id += symbols[bytes[size] % len];
3636
}

test/randomId.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ expect(randomId()).to.be.a('string');
22
expect(randomId().length).to.equal(21);
33
expect(randomId(12).length).to.equal(12);
44
expect(randomId(5, 'a')).to.equal('aaaaa');
5+
expect(randomId(22, 'a')).to.equal('aaaaaaaaaaaaaaaaaaaaaa');

0 commit comments

Comments
 (0)