Skip to content

Commit

Permalink
fix typos (#5896)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhizhen He <[email protected]>
  • Loading branch information
hezhizhen authored Apr 21, 2023
1 parent 53db74f commit 9f64e6d
Show file tree
Hide file tree
Showing 36 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MD004:
style: dash

# MD013 - Line length
# We do not want to artificially limit line lengh in a language like markdown because of the nature of the language's handling of whitespace. Line wrapping is just a fact of life in markdown and trying to impose the conventions of other languages on markdown is an impedance mismatch that leads to people thinking that whitespace in markdown is more representative of the rendered HTML than it really is.
# We do not want to artificially limit line length in a language like markdown because of the nature of the language's handling of whitespace. Line wrapping is just a fact of life in markdown and trying to impose the conventions of other languages on markdown is an impedance mismatch that leads to people thinking that whitespace in markdown is more representative of the rendered HTML than it really is.
MD013: false

# MD033 - Inline HTML
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia-inso/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** TypeScript version of "TODO" but for types */
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a utility type explicitly inteded for the sake of typescript conversions
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a utility type explicitly intended for the sake of typescript conversions
export type UNKNOWN = any;

/** TypeScript version of "TODO" but for Objects */
Expand Down
18 changes: 9 additions & 9 deletions packages/insomnia/bin/yarn-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4189,7 +4189,7 @@ function outside(version, range, hilo, loose) {
throw new TypeError('Must provide a hilo val of "<" or ">"');
}

// If it satisifes the range it is not outside
// If it satisfies the range it is not outside
if (satisfies(version, range, loose)) {
return false;
}
Expand Down Expand Up @@ -40618,7 +40618,7 @@ function Certificate(opts) {
assert.object(opts.signatures, 'options.signatures');
assert.buffer(opts.serial, 'options.serial');
assert.date(opts.validFrom, 'options.validFrom');
assert.date(opts.validUntil, 'optons.validUntil');
assert.date(opts.validUntil, 'options.validUntil');

assert.optionalArrayOfString(opts.purposes, 'options.purposes');

Expand Down Expand Up @@ -76945,7 +76945,7 @@ function readBitField(bits, bitIndex) {

/*
* `setBits` is an array of strings, containing the names for each bit that
* sould be set to 1. `bitIndex` is same as in `readBitField()`.
* should be set to 1. `bitIndex` is same as in `readBitField()`.
*
* Returns a Buffer, ready to be written out with `BerWriter#writeString()`.
*/
Expand Down Expand Up @@ -78512,7 +78512,7 @@ function addSchema(schema, key, _skipValidation, _meta) {

/**
* Add schema that will be used to validate other schemas
* options in META_IGNORE_OPTIONS are alway set to false
* options in META_IGNORE_OPTIONS are always set to false
* @this Ajv
* @param {Object} schema schema object
* @param {String} key optional schema key
Expand Down Expand Up @@ -116949,7 +116949,7 @@ var emojiNameRegex = /:([a-zA-Z0-9_\-\+]+):/g;

/**
* regex to trim whitespace
* use instead of String.prototype.trim() for IE8 supprt
* use instead of String.prototype.trim() for IE8 support
*/
var trimSpaceRegex = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;

Expand Down Expand Up @@ -120653,7 +120653,7 @@ HarWrapper.prototype.request = function (options) {
var self = this;
// make call to true request module
return this.requestModule(options, function (err, incomingMessage, response) {
// create new har entry with reponse timings
// create new har entry with response timings
if (!err) {
self.entries.push(self.buildHarEntry(incomingMessage));
}
Expand Down Expand Up @@ -132468,11 +132468,11 @@ var anyCorrection = function (identifier, check) {
}

module.exports = function (identifier) {
var validArugment = (
var validArgument = (
typeof identifier === 'string' &&
identifier.trim().length !== 0
)
if (!validArugment) {
if (!validArgument) {
throw Error('Invalid argument. Expected non-empty string.')
}
identifier = identifier.replace(/\+$/, '').trim()
Expand Down Expand Up @@ -136201,4 +136201,4 @@ module.exports = require("dns");
module.exports = require("domain");

/***/ })
/******/ ]);
/******/ ]);
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('validateInsomniaConfig', () => {
const result = validateInsomniaConfig();

// Assert
expect(result.error?.title).toBe('An unexpected error occured while parsing Insomnia Config');
expect(result.error?.title).toBe('An unexpected error occurred while parsing Insomnia Config');
expect(result.error?.message).toMatchSnapshot();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/insomnia/src/common/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ export function constructKeyCombinationDisplay(
};

if (isMac()) {
// Note: on Mac the cannonical order is Control, Option (i.e. Alt), Shift, Command (i.e. Meta)
// Note: on Mac the canonical order is Control, Option (i.e. Alt), Shift, Command (i.e. Meta)
// see: https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/keyboard
addModifierKeys(['ctrl', 'alt', 'shift', 'meta']);
} else {
// Note: on Windows the observed oreder (as in, if you just try to make a shortcut with all modifiers) is Windows (i.e. Super/Meta), Ctrl, Alt, Shift.
// No such standard really exists, but at least on Ubunut it follows the Windows ordering.
// No such standard really exists, but at least on Ubuntu it follows the Windows ordering.
addModifierKeys(['meta', 'ctrl', 'alt', 'shift']);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/common/validate-insomnia-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const validateInsomniaConfig = (): Result => {
errors,
].join('\n');
} else {
title = 'An unexpected error occured while parsing Insomnia Config';
title = 'An unexpected error occurred while parsing Insomnia Config';
message = JSON.stringify(configSettings);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/main/network/libcurl-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export const curlRequest = (options: CurlRequestOptions) => new Promise<CurlRequ
const closeReadFunction = (fd: number, isMultipart: boolean, path?: string) => {
fs.closeSync(fd);
// NOTE: multipart files are combined before sending, so this file is deleted after
// alt implemention to send one part at a time https://github.com/JCMais/node-libcurl/blob/develop/examples/04-multi.js
// alt implementation to send one part at a time https://github.com/JCMais/node-libcurl/blob/develop/examples/04-multi.js
if (isMultipart && path) {
fs.unlink(path, () => { });
}
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/models/helpers/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const getControlledStatus = (userSettings: Settings) => (setting: keyof S

if (isControlledByConfig(setting)) {

// note that the raw config settings are being passed here (rathern than `settings` alone), because we must verify that the controller does not itself also have a specification in the config
// note that the raw config settings are being passed here (rather than `settings` alone), because we must verify that the controller does not itself also have a specification in the config
const controllerSetting = isControlledByAnotherSetting(configSettings)(setting);

// TLDR; the config always wins
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export async function initModel<T extends BaseModel>(type: string, ...sources: R
}
}

// @ts-expect-error -- TSCONVERSION not sure why this error is occuring
// @ts-expect-error -- TSCONVERSION not sure why this error is occurring
return migratedDoc;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/insomnia/src/network/__tests__/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ describe('sendCurlAndWriteTimeline()', () => {
POSTFIELDS: 'foo=bar',
POST: 1,
PROXY: '',
SSL_VERIFYHOST: 0, // should disbale SSL
SSL_VERIFYPEER: 0, // should disbale SSL
SSL_VERIFYHOST: 0, // should disable SSL
SSL_VERIFYPEER: 0, // should disable SSL
TIMEOUT_MS: 30000,
URL: 'http://localhost/?foo%20bar=hello%26world',
USERAGENT: `insomnia/${getAppVersion()}`,
Expand Down
4 changes: 2 additions & 2 deletions packages/insomnia/src/network/o-auth-2/get-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getOAuth2Token = async (
authentication: AuthTypeOAuth2,
forceRefresh = false,
): Promise<OAuth2Token | null> => {
const oAuth2Token = await getExisingAccessTokenAndRefreshIfExpired(requestId, authentication, forceRefresh);
const oAuth2Token = await getExistingAccessTokenAndRefreshIfExpired(requestId, authentication, forceRefresh);
if (oAuth2Token) {
return oAuth2Token;
}
Expand Down Expand Up @@ -156,7 +156,7 @@ export const getOAuth2Token = async (
// 2. if expired, and no refresh token return null
// 3. run refresh token query and return new token or null if it fails

async function getExisingAccessTokenAndRefreshIfExpired(
async function getExistingAccessTokenAndRefreshIfExpired(
requestId: string,
authentication: AuthTypeOAuth2,
forceRefresh: boolean,
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/tough-cookie.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare module 'tough-cookie' {
export function domainMatch(str: string, domStr: string, canonicalize?: boolean): boolean;

/**
* Given a current request/response path, gives the Path apropriate for storing in a cookie.
* Given a current request/response path, gives the Path appropriate for storing in a cookie.
* This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
*
* The path parameter MUST be only the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.).
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ interface SegmentEventProperties {
action: string;

/**
* a description of an error that occured as a result of the user action
* a description of an error that occurred as a result of the user action
* */
error?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ export const GraphQLEditor: FC<Props> = ({
const operationNameWasChanged = !operations.includes(state.body.operationName);
if (operationsChanged && operationNameWasChanged) {
// preserve selection during name change or fallback to first operation
const oldPostion = state.operations.indexOf(state.body.operationName);
operationName = operations[oldPostion] || operations[0] || '';
const oldPosition = state.operations.indexOf(state.body.operationName);
operationName = operations[oldPosition] || operations[0] || '';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ export const WorkspaceEnvironmentsEditModal = forwardRef<WorkspaceEnvironmentsEd
if (realEnvironment) {
const updated = await models.environment.update(realEnvironment, patch);
// reload the root environment if it changed since its not updated by redux
const isBaseEnvironement = realEnvironment?.parentId === workspace?._id;
if (isBaseEnvironement) {
const isBaseEnvironment = realEnvironment?.parentId === workspace?._id;
if (isBaseEnvironment) {
setState({ ...state, baseEnvironment: updated });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function isPromise(obj: unknown) {
return (
!!obj &&
(typeof obj === 'object' || typeof obj === 'function') &&
// @ts-expect-error -- not updating because this came direclty from the npm
// @ts-expect-error -- not updating because this came directly from the npm
typeof obj.then === 'function'
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNunjucks } from './use-nunjucks';

/**
* Gated access to functions useful for Nunjucks rendering. Access is only granted if:
* 1. Nunjucks is not diabled via the hook props
* 1. Nunjucks is not disabled via the hook props
* 2. Nunjucks is not disabled by the last NunjucksEnabledProvider in the React tree
*
* For ungated access, use `useNunjucksRenderFunctions` instead
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/routes/git-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ export const commitToGitRepoAction: ActionFunction = async ({
const providerName = getOauth2FormatName(repo?.credentials);
trackSegmentEvent(SegmentEvent.vcsAction, { ...vcsSegmentEventProperties('git', 'commit'), providerName });
} catch (e) {
const message = e instanceof Error ? e.message : 'Error while commiting changes';
const message = e instanceof Error ? e.message : 'Error while committing changes';
return { errors: [message] };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
"get": {
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"parameters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
"get": {
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"parameters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"get": {
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"parameters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"get": {
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"parameters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description":
"Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"produces": ["application/xml", "application/json"],
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
{
"parentId": "fld___WORKSPACE_ID__1b034c38",
"name": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"url": "{{ _.base_url }}/pet/findByTags",
"body": {},
"method": "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description":
"Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"produces": ["application/xml", "application/json"],
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"type": "oauth2"
},
"body": {},
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"headers": [],
"method": "GET",
"name": "Finds Pets by tags",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description":
"Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"produces": ["application/xml", "application/json"],
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
{
"parentId": "fld___WORKSPACE_ID__1b034c38",
"name": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"url": "{{ _.base_url }}/pet/findByTags",
"body": {},
"method": "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"tags": ["pet"],
"summary": "Finds Pets by tags",
"description":
"Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"produces": ["application/xml", "application/json"],
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"type": "oauth2"
},
"body": {},
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"headers": [],
"method": "GET",
"name": "Finds Pets by tags",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export interface ProtocolProfileBehavior {
[k: string]: unknown;
}
/**
* One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achived using 'Folders'. A folder just is an ordered set of requests.
* One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achieved using 'Folders'. A folder just is an ordered set of requests.
*/
export interface Folder {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ export interface ProtocolProfileBehavior {
[k: string]: unknown;
}
/**
* One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achived using 'Folders'. A folder just is an ordered set of requests.
* One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achieved using 'Folders'. A folder just is an ordered set of requests.
*/
export interface Folder {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/utils/importers/importers/postman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class ImportPostman {

// It is a business logic decision to remove the "Authorization" header.
// If you think about it, this makes sense because if you've used Insomnia to fill out an Authorization form (e.g. Basic Auth), you wouldn't then also want the header to be added separately.
// If users want to manually set up these headers they still aboslutely can, of course, but we try to keep thigns simple and help users out.
// If users want to manually set up these headers they still absolutely can, of course, but we try to keep things simple and help users out.
const headers = originalHeaders.filter(h => !isAuthorizationHeader(h));

if (!authentication) {
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-2-kong/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function getMethodAnnotationName(method: HttpMethodType) {
const protocolToPort = (protocol: unknown) => protocol === 'https:' ? '443' : protocol === 'http:' ? '80' : '';

export function parseUrl(urlStr: string) {
// fallback to locahost: https://swagger.io/docs/specification/api-host-and-base-path/#relative-urls
// fallback to localhost: https://swagger.io/docs/specification/api-host-and-base-path/#relative-urls
const { port, protocol, hostname, pathname } = new URL(urlStr, 'http://localhost');
// fallback to protocol derived port
const updatedPort = port || protocolToPort(protocol);
Expand Down
Loading

0 comments on commit 9f64e6d

Please sign in to comment.