Skip to content

Commit e56477e

Browse files
Merge pull request #63 from dvallin/master
Fix node deprecation warning on Buffer constructor
2 parents a460160 + 1612df1 commit e56477e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node-client/src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class KubeConfig {
185185
return fs.readFileSync(file);
186186
}
187187
if (data) {
188-
return new Buffer(base64.decode(data), 'utf-8');
188+
return Buffer.from(base64.decode(data), 'utf-8');
189189
}
190190
return null;
191191
}

node-client/src/web-socket-handler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class WebSocketHandler {
4343

4444
public static handleStandardInput(conn: ws.connection, stdin: stream.Readable | any) {
4545
stdin.on('data', (data) => {
46-
const buff = new Buffer(data.length + 1);
46+
const buff = Buffer.from(data.length + 1);;
4747
buff.writeInt8(0, 0);
4848
if (data instanceof Buffer) {
4949
data.copy(buff, 1);

0 commit comments

Comments
 (0)