From ddf511eac67d5af3c1765a3911cf70b3ab8fa56d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 6 Oct 2019 15:56:26 -0400 Subject: [PATCH] chore: fix typos --- src/ts/main.ts | 4 ++-- src/ts/transformers/har-heuristics.ts | 2 +- src/ts/transformers/har-tabs.ts | 10 +++++----- src/ts/transformers/har.ts | 13 +++++++------ src/ts/typing/waterfall.ts | 8 ++++---- .../waterfall/details-overlay/html-details-body.ts | 2 +- src/ts/waterfall/row/svg-row-subcomponents.ts | 2 +- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/ts/main.ts b/src/ts/main.ts index d04c01f4..11ed891f 100755 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -48,7 +48,7 @@ function PerfCascade(waterfallDocsData: WaterfallDocs, chartOptions: Partial { const el = doc.parentElement as HTMLElement; const newDoc = createWaterfallSvg(pageDoc, options); @@ -85,7 +85,7 @@ export function fromHar(harData: Har, options: ChartOptions = {}): SVGSVGElement return PerfCascade(data, options); } -// aditional imported members that get exported via UMD +// additional imported members that get exported via UMD export { ChartOptions, }; diff --git a/src/ts/transformers/har-heuristics.ts b/src/ts/transformers/har-heuristics.ts index 3500c437..1b7a434c 100644 --- a/src/ts/transformers/har-heuristics.ts +++ b/src/ts/transformers/har-heuristics.ts @@ -57,7 +57,7 @@ function hasCompressionIssue(entry: Entry, requestType: RequestType) { return (!hasHeader(headers, "Content-Encoding") && isCompressible(entry, requestType)); } -/** Checks if the ressource uses https */ +/** Checks if the resource uses https */ function isSecure(entry: Entry) { return entry.request.url.indexOf("https://") === 0; } diff --git a/src/ts/transformers/har-tabs.ts b/src/ts/transformers/har-tabs.ts index fc267bb8..d3f0e01b 100644 --- a/src/ts/transformers/har-tabs.ts +++ b/src/ts/transformers/har-tabs.ts @@ -87,15 +87,15 @@ function makeGeneralTab(generalData: SafeKvTuple[], indicators: WaterfallEntryIn .map((i) => [i.title, i.description] as SafeKvTuple); if (errors.length > 0) { - content += `

${pluralize("Error", errors.length)}

+ content += `

${pluralize("Error", errors.length)}

${makeDefinitionList(errors)}
`; } if (warnings.length > 0) { - content += `

${pluralize("Warning", warnings.length)}

+ content += `

${pluralize("Warning", warnings.length)}

${makeDefinitionList(warnings)}
`; } if (info.length > 0) { - content += `

Info

+ content += `

Info

${makeDefinitionList(info)}
`; } @@ -113,9 +113,9 @@ function makeRequestTab(request: SafeKvTuple[], requestHeaders: SafeKvTuple[]): return makeWaterfallEntryTab("Request", content); } -function makeResponseTab(respose: SafeKvTuple[], responseHeaders: SafeKvTuple[]): WaterfallEntryTab { +function makeResponseTab(response: SafeKvTuple[], responseHeaders: SafeKvTuple[]): WaterfallEntryTab { const content = `
- ${makeDefinitionList(respose)} + ${makeDefinitionList(response)}

All Response Headers

diff --git a/src/ts/transformers/har.ts b/src/ts/transformers/har.ts index 2ba70ef0..757541cb 100644 --- a/src/ts/transformers/har.ts +++ b/src/ts/transformers/har.ts @@ -14,6 +14,7 @@ import { UserTiming, WaterfallData, WaterfallDocs, + WaterfallEntry, WaterfallEntryIndicator, WaterfallEntryTiming, WaterfallResponseDetails, @@ -45,14 +46,14 @@ export function transformDoc(harData: Har | Log, options: HarTransformerOptions) } /** - * Converts an HAR `Entry` into PerfCascads `WaterfallEntry` + * Converts an HAR `Entry` into PerfCascade's `WaterfallEntry` * * @param {Entry} entry * @param {number} index - resource entry index * @param {number} startRelative - entry start time relative to the document in ms * @param {boolean} isTLS */ -function toWaterFallEntry(entry: Entry, index: number, startRelative: number, isTLS: boolean) { +function toWaterFallEntry(entry: Entry, index: number, startRelative: number, isTLS: boolean): WaterfallEntry { startRelative = Math.round(startRelative); const endRelative = Math.round(toInt(entry._all_end) || (startRelative + entry.time)); const requestType = mimeToRequestType(entry.response.content.mimeType); @@ -67,7 +68,7 @@ function toWaterFallEntry(entry: Entry, index: number, startRelative: number, is ); } -/** retuns the page or a mock page object */ +/** Returns the page or a mock page object */ const getPages = (data: Log) => { if (data.pages && data.pages.length > 0) { return data.pages; @@ -177,7 +178,7 @@ const getMarks = (pageTimings: PageTiming, currPage: Page, options: ChartOptions return marks.sort(sortFn); } - return getUserTimimngs(currPage, options) + return getUserTimings(currPage, options) .concat(marks) .sort(sortFn); }; @@ -187,7 +188,7 @@ const getMarks = (pageTimings: PageTiming, currPage: Page, options: ChartOptions * @param {Page} currPage - active page * @param {ChartOptions} options - HAR options */ -const getUserTimimngs = (currPage: Page, options: ChartOptions) => { +const getUserTimings = (currPage: Page, options: ChartOptions) => { const baseFilter = options.showUserTimingEndMarker ? (k: string) => k.indexOf("_userTime.") === 0 : (k: string) => k.indexOf("_userTime.") === 0 && k.indexOf("_userTime.endTimer-") !== 0; @@ -233,7 +234,7 @@ const getUserTimimngs = (currPage: Page, options: ChartOptions) => { }; /** - * Create `WaterfallEntry`s to represent the subtimings of a request + * Create `WaterfallEntry`s to represent the sub-timings of a request * ("blocked", "dns", "connect", "send", "wait", "receive") * @param {number} startRelative - Number of milliseconds since page load started (`page.startedDateTime`) * @param {Entry} harEntry diff --git a/src/ts/typing/waterfall.ts b/src/ts/typing/waterfall.ts index f7ce15c8..6b58ef06 100644 --- a/src/ts/typing/waterfall.ts +++ b/src/ts/typing/waterfall.ts @@ -13,7 +13,7 @@ export interface UserTiming { startTime: number; } -/** Type for a time-marker, e.g. the fireing of an event */ +/** Type for a time-marker, e.g. the firing of an event */ export interface Mark extends UserTiming { /** custom data to store x position */ x?: number; @@ -36,7 +36,7 @@ export interface WaterfallEntry { tabs: WaterfallEntryTab[]; } -export type TabRenderer = (datailsHeight: number) => string; +export type TabRenderer = (detailsHeight: number) => string; /** Represents a single tab of a `WaterfallEntry` */ export interface WaterfallEntryTab { @@ -44,7 +44,7 @@ export interface WaterfallEntryTab { title: string; /** stringified tab HTML */ content?: string; - /** lazy eveluation to create stringified tab HTML */ + /** lazy evaluation to create stringified tab HTML */ renderContent?: TabRenderer; /** Add an additional CSS class-name to the tab */ tabClass?: string; @@ -62,7 +62,7 @@ export interface WaterfallEntryIndicator { title: string; /** long description e.g. for details overlay view */ description: string; - /** catrgorizes the indicator */ + /** categorizes the indicator */ type: IndicatorType; /** where to show the indicator, defaults to `"icon"` */ displayType: IndicatorDisplayType; diff --git a/src/ts/waterfall/details-overlay/html-details-body.ts b/src/ts/waterfall/details-overlay/html-details-body.ts index 3c130d1c..109708e3 100644 --- a/src/ts/waterfall/details-overlay/html-details-body.ts +++ b/src/ts/waterfall/details-overlay/html-details-body.ts @@ -5,7 +5,7 @@ import { WaterfallEntry } from "../../typing/waterfall"; /** * Creates the HTML body for the overlay * - * _All tabable elements are set to `tabindex="-1"` to avoid tabing issues_ + * _All tab-able elements are set to `tabindex="-1"` to avoid tabbing issues_ * @param requestID ID * @param detailsHeight * @param entry diff --git a/src/ts/waterfall/row/svg-row-subcomponents.ts b/src/ts/waterfall/row/svg-row-subcomponents.ts index 773b7efe..eee4522f 100644 --- a/src/ts/waterfall/row/svg-row-subcomponents.ts +++ b/src/ts/waterfall/row/svg-row-subcomponents.ts @@ -1,5 +1,5 @@ /** - * Creation of sub-components used in a ressource request row + * Creation of sub-components used in a resource request row */ import { getParentByClassName } from "../../helpers/dom";