Skip to content

Commit eddbb21

Browse files
committed
v1.0.3
1 parent 0bac855 commit eddbb21

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "libbase64",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Encode and decode base64 encoded strings",
55
"main": "lib/libbase64.js",
66
"scripts": {

test/libbase64-unit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('libbase64', () => {
3636
});
3737

3838
it('shoud encode Buffer to base64', () => {
39-
expect(libbase64.encode(new Buffer([0x00, 0x01, 0x02, 0x20, 0x03]))).to.equal('AAECIAM=');
39+
expect(libbase64.encode(Buffer.from([0x00, 0x01, 0x02, 0x20, 0x03]))).to.equal('AAECIAM=');
4040
});
4141
});
4242

@@ -62,7 +62,7 @@ describe('libbase64', () => {
6262
lineLength: 9
6363
});
6464

65-
let bytes = new Buffer(streamFixture[0]),
65+
let bytes = Buffer.from(streamFixture[0]),
6666
i = 0,
6767
buf = [],
6868
buflen = 0;
@@ -89,7 +89,7 @@ describe('libbase64', () => {
8989
}
9090

9191
let ord = bytes[i++];
92-
encoder.write(new Buffer([ord]));
92+
encoder.write(Buffer.from([ord]));
9393
setImmediate(sendNextByte);
9494
};
9595

@@ -99,7 +99,7 @@ describe('libbase64', () => {
9999
it('should transform incoming base64 to bytes', done => {
100100
let decoder = new libbase64.Decoder();
101101

102-
let bytes = new Buffer(streamFixture[1]),
102+
let bytes = Buffer.from(streamFixture[1]),
103103
i = 0,
104104
buf = [],
105105
buflen = 0;
@@ -126,7 +126,7 @@ describe('libbase64', () => {
126126
}
127127

128128
let ord = bytes[i++];
129-
decoder.write(new Buffer([ord]));
129+
decoder.write(Buffer.from([ord]));
130130
setImmediate(sendNextByte);
131131
};
132132

0 commit comments

Comments
 (0)