From d5ab7ac1e44e01dd4137db0df1bb2b0a576da4c4 Mon Sep 17 00:00:00 2001 From: nexxai Date: Tue, 26 Nov 2024 18:09:58 -0700 Subject: [PATCH] Typofixes --- src/components/common/send-recieve-graph.tsx | 2 +- .../intercept/config/android-adb-config.tsx | 2 +- src/components/modify/handler-config.tsx | 4 +-- src/components/modify/rule-row.tsx | 2 +- src/model/api/api-store.ts | 2 +- src/model/filters/search-filters.ts | 2 +- src/model/filters/syntax-matching.ts | 2 +- src/model/filters/syntax-parts.ts | 2 +- src/model/http/exchange-breakpoint.ts | 6 ++--- src/model/rules/rule-descriptions.ts | 2 +- src/model/ui/export.ts | 2 +- src/util/buffer.ts | 4 +-- src/util/colors.ts | 10 +++---- test/unit/model/http/editable-body.spec.ts | 2 +- test/unit/model/network.spec.ts | 2 +- test/unit/styles.spec.ts | 26 +++++++++---------- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/components/common/send-recieve-graph.tsx b/src/components/common/send-recieve-graph.tsx index 4c761406..455f8518 100644 --- a/src/components/common/send-recieve-graph.tsx +++ b/src/components/common/send-recieve-graph.tsx @@ -13,7 +13,7 @@ import { getSummaryColor } from '../../model/events/categorization'; import { getReadableSize } from '../../util/buffer'; // Somewhat arbitrary colour selections, but picking from our existing category -// pallet for vaugely related colours, that work together and which don't have +// pallet for vaguely related colours, that work together and which don't have // accessibility issues for colourblind usersL export const SentDataColor = getSummaryColor('data'); export const ReceivedDataColor = getSummaryColor('rtc-media'); diff --git a/src/components/intercept/config/android-adb-config.tsx b/src/components/intercept/config/android-adb-config.tsx index 937c9438..778a4008 100644 --- a/src/components/intercept/config/android-adb-config.tsx +++ b/src/components/intercept/config/android-adb-config.tsx @@ -175,7 +175,7 @@ class AndroidAdbConfig extends React.Component<{ } = this; // Ensure the config rule is in place before we start any activation. This listens for the - // next config request, and uses that to track succesful setup (by calling onSuccess). + // next config request, and uses that to track successful setup (by calling onSuccess). setUpAndroidCertificateRule( proxyStore!.certContent!, rulesStore!, diff --git a/src/components/modify/handler-config.tsx b/src/components/modify/handler-config.tsx index 4d21e72a..444942c7 100644 --- a/src/components/modify/handler-config.tsx +++ b/src/components/modify/handler-config.tsx @@ -229,7 +229,7 @@ export function HandlerConfiguration(props: { case 'wait-for-rtc-data-channel': return ; case 'wait-for-rtc-message': - return ; + return ; case 'create-rtc-data-channel': return ; case 'send-rtc-data-message': @@ -2511,7 +2511,7 @@ class RTCWaitForChannelConfig extends HandlerConfig { +class RTCWaitForDataMessageConfig extends HandlerConfig { render() { const { channelLabel } = this.props.handler; diff --git a/src/components/modify/rule-row.tsx b/src/components/modify/rule-row.tsx index 1bee8062..1cb1ff6a 100644 --- a/src/components/modify/rule-row.tsx +++ b/src/components/modify/rule-row.tsx @@ -192,7 +192,7 @@ const DetailsHeader = styled.div` const HighPriorityMarker = styled(Icon).attrs(() => ({ icon: ['fas', 'exclamation'], - title: 'High-priority rule: this rule overrides all non-high-prority rules' + title: 'High-priority rule: this rule overrides all non-high-priority rules' }))` margin-right: 10px; align-self: baseline; diff --git a/src/model/api/api-store.ts b/src/model/api/api-store.ts index 51974ac7..00555733 100644 --- a/src/model/api/api-store.ts +++ b/src/model/api/api-store.ts @@ -41,7 +41,7 @@ const apiMetadataSchema = serializr.createSimpleSchema({ }); // In addition to the public OpenAPI directory, we have a few extra APIs (stored in -// this repo in /extra-apis) that we match seprately: +// this repo in /extra-apis) that we match separately: const EXTRA_APIS: { [urlPrefix: string]: 'ipfs' | 'ethereum' } = { // See the 'servers' field in /extra-apis/ipfs.json: 'localhost:5001/api/v0': 'ipfs', diff --git a/src/model/filters/search-filters.ts b/src/model/filters/search-filters.ts index 501ec018..26d9f014 100644 --- a/src/model/filters/search-filters.ts +++ b/src/model/filters/search-filters.ts @@ -994,7 +994,7 @@ class HeaderFilter extends Filter { new StringSyntax("header value", { allowedChars: [[0, 255]], // Any ASCII! Wrapper guards against spaces for us. suggestionGenerator: (value, index, events: CollectedEvent[]) => { - // Find the start of the wrapped header name text that preceeds this + // Find the start of the wrapped header name text that precedes this const headerNameIndex = value.slice(0, index - 1).lastIndexOf('['); const headerNamePart = HeaderFilter.filterSyntax[1]; diff --git a/src/model/filters/syntax-matching.ts b/src/model/filters/syntax-matching.ts index 20fb5d3a..9f7720cd 100644 --- a/src/model/filters/syntax-matching.ts +++ b/src/model/filters/syntax-matching.ts @@ -299,7 +299,7 @@ export type SyntaxPartMatch = { }) => { // We want to get suggestions from the last part that consumed any input. That means // for a last-part half-match, we want that partial last part, but for a last part - // 0-char-match, we want the preceeding full part, because there might still be + // 0-char-match, we want the preceding full part, because there might still be // useful suggestions there to extend that part. const syntaxPartIndex = match!.lastConsumingPartSyntaxIndex; const stringIndex = match!.lastConsumingPartStringIndex; diff --git a/src/model/filters/syntax-parts.ts b/src/model/filters/syntax-parts.ts index 50d1d2c0..ffe717ca 100644 --- a/src/model/filters/syntax-parts.ts +++ b/src/model/filters/syntax-parts.ts @@ -569,7 +569,7 @@ export class SyntaxRepeaterSyntax< value: '' }]; } else if (wrappedMatch.type === 'partial') { - // We have a partial match on our contents, so suggest continuining it + // We have a partial match on our contents, so suggest continuing it const suggestions = wrappedSyntax.getSuggestions(value, index, context); if (matchCount + 1 < minimumRepetitions) { return suggestions.map(suggestion => ({ diff --git a/src/model/http/exchange-breakpoint.ts b/src/model/http/exchange-breakpoint.ts index d3cfd192..f42750e2 100644 --- a/src/model/http/exchange-breakpoint.ts +++ b/src/model/http/exchange-breakpoint.ts @@ -50,7 +50,7 @@ function getBody(message: MockttpBreakpointedRequest | MockttpBreakpointedRespon }); } -const omitPsuedoHeaders = (headers: Headers) => +const omitPseudoHeaders = (headers: Headers) => _.omitBy(headers, (_v, key) => key.startsWith(':')) as Headers; export async function getRequestBreakpoint(request: MockttpBreakpointedRequest) { @@ -203,9 +203,9 @@ export abstract class Breakpoint { : { body: await this.editableBody.encodingBestEffortPromise } ), - // Psuedo-headers those will be generated automatically from the other, + // Pseudo-headers those will be generated automatically from the other, // fields, as part of the rest of the request process. - headers: omitPsuedoHeaders(rawHeadersToHeaders(this.resultMetadata.rawHeaders)) + headers: omitPseudoHeaders(rawHeadersToHeaders(this.resultMetadata.rawHeaders)) } as unknown as BreakpointResumeType); } diff --git a/src/model/rules/rule-descriptions.ts b/src/model/rules/rule-descriptions.ts index cf606657..995073fd 100644 --- a/src/model/rules/rule-descriptions.ts +++ b/src/model/rules/rule-descriptions.ts @@ -233,7 +233,7 @@ export function summarizeHandlerClass(key: HandlerClassKey): string { case 'ipns-resolve-result': return "Return a fixed IPNS resolved address"; case 'ipns-publish-result': - return "Return a fixed succesful IPNS result"; + return "Return a fixed successful IPNS result"; case 'ipfs-pins-result': return "Return a fixed IPFS pinning result"; case 'ipfs-pin-ls-result': diff --git a/src/model/ui/export.ts b/src/model/ui/export.ts index 4eafa345..ed679ee9 100644 --- a/src/model/ui/export.ts +++ b/src/model/ui/export.ts @@ -79,7 +79,7 @@ const simplifyHarForSnippetExport = (harRequest: ExtendedHarRequest) => { : undefined; // When exporting code snippets the primary goal is to generate convenient code to send the - // request that's *sematantically* equivalent to the original request, not to force every + // request that's *semantically* equivalent to the original request, not to force every // tool to produce byte-for-byte identical requests (that's effectively impossible). To do // this, we drop headers that tools can produce automatically for themselves: return { diff --git a/src/util/buffer.ts b/src/util/buffer.ts index 45e0c232..8ad00e38 100644 --- a/src/util/buffer.ts +++ b/src/util/buffer.ts @@ -60,7 +60,7 @@ export function stringToBuffer(input: string, encoding: 'utf8' | 'binary' = 'utf } else if (encoding === 'binary') { return Buffer.from(input, encoding); // Slower, but we have no option as TextEncoder is UTF8 only } else { - throw new Error(`Cannot decode string from unrecogized encoding: ${encoding}`); + throw new Error(`Cannot decode string from unrecognized encoding: ${encoding}`); } } @@ -77,7 +77,7 @@ export function bufferToString( } else if (encoding === 'binary') { return binaryLaxDecoder.decode(input); } else { - throw new Error(`Cannot convert buffer to unrecogized encoding: ${encoding}`); + throw new Error(`Cannot convert buffer to unrecognized encoding: ${encoding}`); } } diff --git a/src/util/colors.ts b/src/util/colors.ts index 9f39a06a..dc69d46e 100644 --- a/src/util/colors.ts +++ b/src/util/colors.ts @@ -1,7 +1,7 @@ import * as polished from 'polished'; /** - * Pairs with getBackgroundColor to generate a pair of colors with reasonable constrast, + * Pairs with getBackgroundColor to generate a pair of colors with reasonable contrast, * inspired by a single base color, but aiming to broadly match a given main color & * background color. */ @@ -10,16 +10,16 @@ export function getTextColor(baseColor: string, mainColor: string, contrastRatio const baseSimilarity = (polished.getContrast(baseColor, mainColor) - 1) / 20; // Mix the colors, using between 35% & 100% of the base color, depending on how far - // off we are and how much constrast we're aiming for (i.e. more maincolor for HC theme) - const constrastBias = 1 - contrastRatio; - const baseWeighting = 0.35 + (baseSimilarity * constrastBias) * 0.65; + // off we are and how much contrast we're aiming for (i.e. more maincolor for HC theme) + const contrastBias = 1 - contrastRatio; + const baseWeighting = 0.35 + (baseSimilarity * contrastBias) * 0.65; // More similar => less mixing required => more base color weighting return polished.mix(baseWeighting, baseColor, mainColor); } /** - * Pairs with getTextColor to generate a pair of colors with reasonable constrast, + * Pairs with getTextColor to generate a pair of colors with reasonable contrast, * inspired by a single base color, but aiming to broadly match a given main color & * background color. */ diff --git a/test/unit/model/http/editable-body.spec.ts b/test/unit/model/http/editable-body.spec.ts index 693d5de2..4bf130e3 100644 --- a/test/unit/model/http/editable-body.spec.ts +++ b/test/unit/model/http/editable-body.spec.ts @@ -132,7 +132,7 @@ describe("Editable bodies", () => { const body = new EditableBody( Buffer.from('hello'), undefined, - () => headers.get(), // <-- these headesr will fail to encode initially + () => headers.get(), // <-- these headers will fail to encode initially { throttleDuration: 0 } ); diff --git a/test/unit/model/network.spec.ts b/test/unit/model/network.spec.ts index 2a766193..2dc77da1 100644 --- a/test/unit/model/network.spec.ts +++ b/test/unit/model/network.spec.ts @@ -3,7 +3,7 @@ import { expect } from "../../test-setup"; import { getReadableIP } from "../../../src/model/network"; describe("IP formatting", () => { - it("should return unrecoginized ips untouched", () => { + it("should return unrecognized ips untouched", () => { expect(getReadableIP('93.184.216.34')).to.equal('93.184.216.34'); }); diff --git a/test/unit/styles.spec.ts b/test/unit/styles.spec.ts index 0bdb0e45..3827a48a 100644 --- a/test/unit/styles.spec.ts +++ b/test/unit/styles.spec.ts @@ -34,7 +34,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -44,7 +44,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -54,7 +54,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -64,7 +64,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -84,7 +84,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -94,7 +94,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -104,7 +104,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -115,7 +115,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); // Lower target as these are usually icons (so generally only require 3:1) expect(contrast).to.be.greaterThan(lowerContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -125,7 +125,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); expect(contrast).to.be.greaterThan(normalContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -136,7 +136,7 @@ import { expect } from '../test-setup'; const contrast = polished.getContrast(mainColor, bgColor); // Lower target as this is enormous (and non-critical) background text expect(contrast).to.be.greaterThan(lowerContrastTarget, - `Constrast for ${mainColor}/${bgColor} was only ${contrast}` + `Contrast for ${mainColor}/${bgColor} was only ${contrast}` ); }); @@ -147,7 +147,7 @@ import { expect } from '../test-setup'; EventCategories.forEach((category) => { const categoryColor = getSummaryColor(category); - it(`should generate sufficient constrast for the ${category} category (${categoryColor})`, () => { + it(`should generate sufficient contrast for the ${category} category (${categoryColor})`, () => { const mainColor = getTextColor(categoryColor, theme.mainColor, theme.pillContrast); const bgColor = getBackgroundColor(categoryColor, theme.mainBackground); @@ -161,7 +161,7 @@ import { expect } from '../test-setup'; MethodNames.forEach((method) => { const methodColor = getMethodColor(method); - it(`should generate sufficient constrast for ${method} methods (${methodColor})`, () => { + it(`should generate sufficient contrast for ${method} methods (${methodColor})`, () => { const mainColor = getTextColor(methodColor, theme.mainColor, theme.pillContrast); const bgColor = getBackgroundColor(methodColor, theme.mainBackground); @@ -172,7 +172,7 @@ import { expect } from '../test-setup'; }); }); - it(`should generate sufficient constrast for the default pill colours`, () => { + it(`should generate sufficient contrast for the default pill colours`, () => { const mainColor = getTextColor(theme.pillDefaultColor, theme.mainColor, theme.pillContrast); const bgColor = getBackgroundColor(theme.pillDefaultColor, theme.mainBackground);