Skip to content

Commit

Permalink
src: remove use of util.isUndefined()
Browse files Browse the repository at this point in the history
This method has been deprecated in Node.js.

It looks like a similar change was made to the master branch
as part of #1320, but it was not cherry-picked to release-1.x.
  • Loading branch information
cjihrig committed Sep 26, 2024
1 parent 9cc3815 commit a272bd1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/portforward.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import WebSocket = require('isomorphic-ws');
import querystring = require('querystring');
import stream = require('stream');
import { isUndefined } from 'util';

import { KubeConfig } from './config';
import { WebSocketHandler, WebSocketInterface } from './web-socket-handler';
Expand All @@ -13,7 +12,7 @@ export class PortForward {
// handler is a parameter really only for injecting for testing.
constructor(config: KubeConfig, disconnectOnErr?: boolean, handler?: WebSocketInterface) {
this.handler = handler || new WebSocketHandler(config);
this.disconnectOnErr = isUndefined(disconnectOnErr) ? true : disconnectOnErr;
this.disconnectOnErr = disconnectOnErr === undefined ? true : disconnectOnErr;
}

// TODO: support multiple ports for real...
Expand Down

0 comments on commit a272bd1

Please sign in to comment.