File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,11 @@ class Encoder extends Transform {
113
113
this . push ( chunk ) ;
114
114
}
115
115
116
- _getWrapped ( str ) {
117
- let prefix = '' ;
118
-
116
+ _getWrapped ( str , isFinal ) {
119
117
str = wrap ( str , this . options . lineLength ) ;
120
-
121
- if ( prefix ) {
122
- str = prefix + str ;
118
+ if ( ! isFinal && str . length === this . options . lineLength ) {
119
+ str += '\r\n' ;
123
120
}
124
-
125
121
return str ;
126
122
}
127
123
@@ -179,7 +175,7 @@ class Encoder extends Transform {
179
175
}
180
176
181
177
if ( this . _curLine ) {
182
- this . _curLine = this . _getWrapped ( this . _curLine ) ;
178
+ this . _curLine = this . _getWrapped ( this . _curLine , true ) ;
183
179
this . _writeChunk ( Buffer . from ( this . _curLine , 'ascii' ) , true ) ;
184
180
this . _curLine = '' ;
185
181
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " libbase64" ,
3
- "version" : " 1.2.0 " ,
3
+ "version" : " 1.2.1 " ,
4
4
"description" : " Encode and decode base64 encoded strings" ,
5
5
"main" : " lib/libbase64.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments