Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
This commit is contained in:
Zhizhen He authored and GitHub committed 2023-04-21 10:32:30 +00:00
1 parent 53db74ff6b
commit 9f64e6de65
36 files changed
+52 -52

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 */
+9 -9
View File
@@ -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;
}
@@ -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');
@@ -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()`.
*/
@@ -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
@@ -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;
@@ -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));
}
@@ -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()
@@ -136201,4 +136201,4 @@ module.exports = require("dns");
module.exports = require("domain");
/***/ })
/******/ ]);
/******/ ]);
@@ -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();
});
+2 -2
View File
@@ -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']);
}
@@ -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);
}
@@ -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, () => { });
}
@@ -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
+1 -1
View File
@@ -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;
}
@@ -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()}`,
@@ -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;
}
@@ -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,
+1 -1
View File
@@ -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.).
+1 -1
View File
@@ -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;
}
@@ -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] || '';
}
}
@@ -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 });
}
}
@@ -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'
);
}
@@ -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
@@ -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] };
}
@@ -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": [
{
@@ -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": [
{
@@ -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": [
{
@@ -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": [
{
@@ -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": [
@@ -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",
@@ -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": [
@@ -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",
@@ -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": [
@@ -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",
@@ -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": [
@@ -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",
@@ -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 {
/**
@@ -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 {
/**
@@ -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) {
+1 -1
View File
@@ -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);
@@ -420,7 +420,7 @@ paths:
$ref: '#/components/responses/200BasicAuth'
'404':
description: >-
Unautorized (the username and password used for Basic auth do not
Unauthorized (the username and password used for Basic auth do not
match those in the URL path.)
/bearer:
@@ -581,7 +581,7 @@ paths:
value: '*'
responses:
'200':
description: Neigher If-Modified-Since nor If-None-Match header is provided
description: Neither If-Modified-Since nor If-None-Match header is provided
'304':
description: If-Modified-Since or If-None-Match header is provided
@@ -190,12 +190,12 @@ function resolveRefSchemaRecursively(
return Object.entries(source)
.reduce<Map<string, unknown>>((acc, [key, value]: Entry<Map<string, unknown>>) => {
if (typeof value === 'string') {
// the responsiblity of this function is only really concerning `$ref`s, so if the end value is not a `$ref` we can skip it
// the responsibility of this function is only really concerning `$ref`s, so if the end value is not a `$ref` we can skip it
if (key !== '$ref') {
return acc;
}
// the accumulator alreadly having this `$ref` value indicates that we have already visited this ref, and as such we should exit early to prevent an infinite loop since circular `$ref`s are valid in OpenAPI.
// the accumulator already having this `$ref` value indicates that we have already visited this ref, and as such we should exit early to prevent an infinite loop since circular `$ref`s are valid in OpenAPI.
if (acc.has(value)) {
return acc;
}
@@ -239,7 +239,7 @@ function resolveRefSchemaRecursively(
/**
* Build components reference object with nested paths
* @param mapObject Map object that keeps all the ref keys and valuese to be transformed into the final object product with nested paths
* @param mapObject Map object that keeps all the ref keys and values to be transformed into the final object product with nested paths
* @returns final object product with nested paths
*/
function buildComponentsObjectFromMap(mapObject: Map<string, unknown>): Record<string, unknown> {