Skip to content

Update TS-lint and prettier and fix some formatting updates #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@
"mock-fs": "^5.2.0",
"nock": "^13.2.9",
"nyc": "^15.1.0",
"prettier": "~1.16.4",
"prettier": "~2.8.1",
"source-map-support": "^0.5.9",
"ts-mockito": "^2.3.1",
"ts-node": "^10.9.1",
"tslint": "^5.17.0",
"tslint": "^6.1.3",
"typedoc": "^0.23.22",
"typescript": "~4.9.4"
},
Expand Down
14 changes: 5 additions & 9 deletions src/attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,17 @@ export class Attach {
};
const queryStr = querystring.stringify(query);
const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;
const conn = await this.handler.connect(
path,
null,
(streamNum: number, buff: Buffer): boolean => {
WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);
return true;
},
);
const conn = await this.handler.connect(path, null, (streamNum: number, buff: Buffer): boolean => {
WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);
return true;
});
if (stdin != null) {
WebSocketHandler.handleStandardInput(conn, stdin, WebSocketHandler.StdinStream);
}
if (isResizable(stdout)) {
this.terminalSizeQueue = new TerminalSizeQueue();
WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, WebSocketHandler.ResizeStream);
this.terminalSizeQueue.handleResizes((stdout as any) as ResizableStream);
this.terminalSizeQueue.handleResizes(stdout as any as ResizableStream);
}
return conn;
}
Expand Down
10 changes: 5 additions & 5 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ListWatch<T extends KubernetesObject> implements ObjectCache<T>, In
private objects: CacheMap<T> = new Map();
private resourceVersion: string;
private readonly callbackCache: {
[key: string]: Array<ObjectCallback<T> | ErrorCallback>;
[key: string]: (ObjectCallback<T> | ErrorCallback)[];
} = {};
private request: RequestResult | undefined;
private stopped: boolean = false;
Expand Down Expand Up @@ -242,7 +242,7 @@ export function cacheMapFromList<T extends KubernetesObject>(newObjects: T[]): C
export function deleteItems<T extends KubernetesObject>(
oldObjects: CacheMap<T>,
newObjects: T[],
deleteCallback?: Array<ObjectCallback<T>>,
deleteCallback?: ObjectCallback<T>[],
): CacheMap<T> {
const newObjectsMap = cacheMapFromList(newObjects);

Expand Down Expand Up @@ -274,8 +274,8 @@ export function deleteItems<T extends KubernetesObject>(
export function addOrUpdateObject<T extends KubernetesObject>(
objects: CacheMap<T>,
obj: T,
addCallbacks?: Array<ObjectCallback<T>>,
updateCallbacks?: Array<ObjectCallback<T>>,
addCallbacks?: ObjectCallback<T>[],
updateCallbacks?: ObjectCallback<T>[],
): void {
let namespaceObjects = objects.get(obj.metadata!.namespace || '');
if (!namespaceObjects) {
Expand Down Expand Up @@ -312,7 +312,7 @@ function isSameVersion<T extends KubernetesObject>(o1: T, o2: T): boolean {
export function deleteObject<T extends KubernetesObject>(
objects: CacheMap<T>,
obj: T,
deleteCallbacks?: Array<ObjectCallback<T>>,
deleteCallbacks?: ObjectCallback<T>[],
): void {
const namespace = obj.metadata!.namespace || '';
const name = obj.metadata!.name || '';
Expand Down
Loading