Skip to content

Commit

Permalink
Merge pull request #142 from nexxai/main
Browse files Browse the repository at this point in the history
Typofixes
  • Loading branch information
pimterry authored Nov 27, 2024
2 parents 291715c + d5ab7ac commit 3dd492b
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/components/common/send-recieve-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/components/intercept/config/android-adb-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand Down
4 changes: 2 additions & 2 deletions src/components/modify/handler-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function HandlerConfiguration(props: {
case 'wait-for-rtc-data-channel':
return <RTCWaitForChannelConfig {...configProps} />;
case 'wait-for-rtc-message':
return <RTCWaitForDataMessaageConfig {...configProps} />;
return <RTCWaitForDataMessageConfig {...configProps} />;
case 'create-rtc-data-channel':
return <RTCCreateChannelStepConfig {...configProps} />;
case 'send-rtc-data-message':
Expand Down Expand Up @@ -2511,7 +2511,7 @@ class RTCWaitForChannelConfig extends HandlerConfig<WaitForChannelStepDefinition
}

@observer
class RTCWaitForDataMessaageConfig extends HandlerConfig<WaitForMessageStepDefinition> {
class RTCWaitForDataMessageConfig extends HandlerConfig<WaitForMessageStepDefinition> {

render() {
const { channelLabel } = this.props.handler;
Expand Down
2 changes: 1 addition & 1 deletion src/components/modify/rule-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/model/api/api-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/model/filters/search-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/model/filters/syntax-matching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/model/filters/syntax-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ({
Expand Down
6 changes: 3 additions & 3 deletions src/model/http/exchange-breakpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -203,9 +203,9 @@ export abstract class Breakpoint<T extends BreakpointInProgress> {
: { 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<T>);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/rules/rule-descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion src/model/ui/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/util/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}

Expand All @@ -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}`);
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/util/colors.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand All @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion test/unit/model/http/editable-body.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
);

Expand Down
2 changes: 1 addition & 1 deletion test/unit/model/network.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
26 changes: 13 additions & 13 deletions test/unit/styles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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}`
);
});

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 3dd492b

Please sign in to comment.