Skip to content

Commit

Permalink
Rename DecodeResultType -> DecodeResult; Update DecodeResult as…
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao committed Nov 11, 2024
1 parent e0bdb68 commit 479fd71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/services/decoders/ClpIrDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Dayjs} from "dayjs";
import {Nullable} from "../../typings/common";
import {
Decoder,
DecodeResultType,
DecodeResult,
DecoderOptions,
FilteredLogEventMap,
LogEventCount,
Expand Down Expand Up @@ -95,8 +95,8 @@ class ClpIrDecoder implements Decoder {
beginIdx: number,
endIdx: number,
useFilter: boolean
): Nullable<DecodeResultType[]> {
const results: DecodeResultType[] =
): Nullable<DecodeResult[]> {
const results: DecodeResult[] =
this.#streamReader.decodeRange(beginIdx, endIdx, useFilter);

if (this.#streamType === CLP_IR_STREAM_TYPE.UNSTRUCTURED) {
Expand Down
10 changes: 5 additions & 5 deletions src/services/decoders/JsonlDecoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Dayjs} from "dayjs";
import {Nullable} from "../../../typings/common";
import {
Decoder,
DecodeResultType,
DecodeResult,
DecoderOptions,
FilteredLogEventMap,
LogEventCount,
Expand Down Expand Up @@ -91,7 +91,7 @@ class JsonlDecoder implements Decoder {
beginIdx: number,
endIdx: number,
useFilter: boolean,
): Nullable<DecodeResultType[]> {
): Nullable<DecodeResult[]> {
if (useFilter && null === this.#filteredLogEventMap) {
return null;
}
Expand All @@ -104,7 +104,7 @@ class JsonlDecoder implements Decoder {
return null;
}

const results: DecodeResultType[] = [];
const results: DecodeResult[] = [];
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.
Expand Down Expand Up @@ -204,12 +204,12 @@ class JsonlDecoder implements Decoder {
}

/**
* Decodes a log event into a `DecodeResultType`.
* Decodes a log event into a `DecodeResult`.
*
* @param logEventIdx
* @return The decoded log event.
*/
#decodeLogEvent = (logEventIdx: number): DecodeResultType => {
#decodeLogEvent = (logEventIdx: number): DecodeResult => {
let timestamp: number;
let message: string;
let logLevel: LOG_LEVEL;
Expand Down
6 changes: 3 additions & 3 deletions src/typings/decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface DecoderOptions {
* @property level
* @property number
*/
type DecodeResultType = [string, number, number, number];
type DecodeResult = [string, bigint, number, number];

/**
* Mapping between an index in the filtered log events collection to an index in the unfiltered log
Expand Down Expand Up @@ -97,13 +97,13 @@ interface Decoder {
beginIdx: number,
endIdx: number,
useFilter: boolean
): Nullable<DecodeResultType[]>;
): Nullable<DecodeResult[]>;
}

export type {
ActiveLogCollectionEventIdx,
Decoder,
DecodeResultType,
DecodeResult,
DecoderOptions,
FilteredLogEventMap,
LogEventCount,
Expand Down

0 comments on commit 479fd71

Please sign in to comment.