Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Aug 7, 2019
1 parent 86ee2a6 commit bc8207a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions lib/libbase64.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,11 @@ class Encoder extends Transform {
this.push(chunk);
}

_getWrapped(str) {
let prefix = '';

_getWrapped(str, isFinal) {
str = wrap(str, this.options.lineLength);

if (prefix) {
str = prefix + str;
if (!isFinal && str.length === this.options.lineLength) {
str += '\r\n';
}

return str;
}

Expand Down Expand Up @@ -179,7 +175,7 @@ class Encoder extends Transform {
}

if (this._curLine) {
this._curLine = this._getWrapped(this._curLine);
this._curLine = this._getWrapped(this._curLine, true);
this._writeChunk(Buffer.from(this._curLine, 'ascii'), true);
this._curLine = '';
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libbase64",
"version": "1.2.0",
"version": "1.2.1",
"description": "Encode and decode base64 encoded strings",
"main": "lib/libbase64.js",
"scripts": {
Expand Down

0 comments on commit bc8207a

Please sign in to comment.