Skip to content

Commit b772a8d

Browse files
author
Maximilian Schuler
committed
Fix node deprecation warning on Buffer constructor
1 parent d013987 commit b772a8d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node-client/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class KubeConfig {
102102
return fs.readFileSync(file);
103103
}
104104
if (data) {
105-
return new Buffer(base64.decode(data), 'utf-8');
105+
return Buffer.from(base64.decode(data), 'utf-8');
106106
}
107107
return null;
108108
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class WebSocketHandler {
8989

9090
public static handleStandardInput(conn: ws.connection, stdin: stream.Readable | any) {
9191
stdin.on('data', (data) => {
92-
let buff = new Buffer(data.length + 1);
92+
let buff = Buffer.from(data.length + 1);
9393
buff.writeInt8(0, 0);
9494
if (data instanceof Buffer) {
9595
data.copy(buff, 1);

0 commit comments

Comments
 (0)