Skip to content

Commit 25f15dd

Browse files
committed
do trim on encodingLength as well
1 parent c111168 commit 25f15dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ name.decode.bytes = 0
7878

7979
name.encodingLength = function (n) {
8080
if (n === '.') return 1
81-
return Buffer.byteLength(n) + 2
81+
return Buffer.byteLength(n.replace(/^\.|\.$/gm, '')) + 2
8282
}
8383

8484
const string = {}

0 commit comments

Comments
 (0)