mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix type errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
627da1471b
commit
2357424eef
@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
import { Readable } from "readable-stream";
|
||||
import type { ReadableStreamDefaultReadResult } from "stream/web";
|
||||
import type { TypedArray } from "type-fest";
|
||||
|
||||
/**
|
||||
@ -24,8 +23,8 @@ export class ReadableWebToNodeStream<T extends TypedArray> extends Readable {
|
||||
* Default web API stream reader
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader
|
||||
*/
|
||||
private reader: ReadableStreamReader<T>;
|
||||
private pendingRead?: Promise<ReadableStreamDefaultReadResult<T>>;
|
||||
private reader: ReadableStreamDefaultReader<T>;
|
||||
private pendingRead?: Promise<ReadableStreamReadResult<T>>;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -193,8 +193,8 @@ export class LogStore {
|
||||
*/
|
||||
getLastSinceTime(tabId: TabId): string {
|
||||
const logs = this.podLogs.get(tabId) ?? [];
|
||||
const timestamps = this.getTimestamps(logs[logs.length - 1]);
|
||||
const stamp = timestamps[0] ? new Date(timestamps[0]) : new Date();
|
||||
const [timestamp] = this.getTimestamps(logs[logs.length - 1]) ?? [];
|
||||
const stamp = timestamp ? new Date(timestamp) : new Date();
|
||||
|
||||
stamp.setSeconds(stamp.getSeconds() + 1); // avoid duplicates from last second
|
||||
|
||||
@ -211,8 +211,8 @@ export class LogStore {
|
||||
return [extraction[1], extraction[2]];
|
||||
}
|
||||
|
||||
getTimestamps(logs: string): RegExpMatchArray {
|
||||
return logs.match(/^\d+\S+/gm) ?? [];
|
||||
getTimestamps(logs: string) {
|
||||
return logs.match(/^\d+\S+/gm);
|
||||
}
|
||||
|
||||
removeTimestamps(logs: string): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user