Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Oct 1, 2024
2 parents 5af877a + b562c34 commit 8ce2a83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions new-log-viewer/src/services/decoders/JsonlDecoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class JsonlDecoder implements Decoder {
build (): LogEventCount {
this.#deserialize();

const numInvalidEvents = Array.from(this.#invalidLogEventIdxToRawLine.keys()).length;
const numInvalidEvents = this.#invalidLogEventIdxToRawLine.size;

return {
numValidEvents: this.#logEvents.length - numInvalidEvents,
Expand Down Expand Up @@ -106,9 +106,8 @@ class JsonlDecoder implements Decoder {

const results: DecodeResultType[] = [];
for (let i = beginIdx; i < endIdx; i++) {
// Explicit cast since typescript thinks `#filteredLogEventMap[i]`
// can be undefined, but it shouldn't be since we performed a bounds check at the
// beginning of the method.
// Explicit cast since typescript thinks `#filteredLogEventMap[i]` can be undefined, but
// it shouldn't be since we performed a bounds check at the beginning of the method.
const logEventIdx: number = (useFilter && null !== this.#filteredLogEventMap) ?
(this.#filteredLogEventMap[i] as number) :
i;
Expand Down
4 changes: 2 additions & 2 deletions new-log-viewer/src/typings/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ enum LOG_LEVEL {

type LogLevelFilter = Nullable<LOG_LEVEL[]>;

const INVALID_TIMESTAMP_VALUE = 0;

interface LogEvent {
timestamp: Dayjs,
level: LOG_LEVEL,
fields: JsonObject
}

const INVALID_TIMESTAMP_VALUE = 0;

export type {
LogEvent,
LogLevelFilter,
Expand Down

0 comments on commit 8ce2a83

Please sign in to comment.