chore: fix typos across the codebase (#402)

This commit is contained in:
a-kriya
2023-01-22 08:47:27 +05:30
committed by GitHub
parent 14db8da270
commit 6d9478f8f7
16 changed files with 66 additions and 66 deletions

View File

@ -16,7 +16,7 @@ async function sha256(text: string) {
// based on https://github.com/auth0/auth0-spa-js/blob/9a83f698127eae7da72691b0d4b1b847567687e3/src/utils.ts#L147
function generateVerifierCode() {
// characters that can be used for codeVerifer
// characters that can be used for codeVerifier
// excludes _~ as if included would cause an uneven distribution as char.length would no longer be a factor of 256
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.';
const randomValues = Array.from(window.crypto.getRandomValues(new Uint8Array(128)));

View File

@ -4,7 +4,7 @@ import partialRight from 'lodash/partialRight';
import { COMMIT_AUTHOR, COMMIT_DATE } from '../constants/commitProps';
import { sanitizeSlug } from './urlHelper';
import { selectIdentifier, selectInferedField } from './util/collection.util';
import { selectIdentifier, selectInferredField } from './util/collection.util';
import { selectField } from './util/field.util';
import { set } from './util/object.util';
import {
@ -108,7 +108,7 @@ export function slugFormatter(collection: Collection, entryData: EntryData, slug
export function summaryFormatter(summaryTemplate: string, entry: Entry, collection: Collection) {
let entryData = entry.data;
const date = parseDateFromEntry(entry, selectInferedField(collection, 'date')) || null;
const date = parseDateFromEntry(entry, selectInferredField(collection, 'date')) || null;
const identifier = get(entryData, keyToPathArray(selectIdentifier(collection)));
entryData =
@ -144,7 +144,7 @@ export function folderFormatter(
'folder' in collection ? collection.folder : '',
);
const date = parseDateFromEntry(entry, selectInferedField(collection, 'date')) || null;
const date = parseDateFromEntry(entry, selectInferredField(collection, 'date')) || null;
const identifier = get(fields, keyToPathArray(selectIdentifier(collection)));
const processSegment = getProcessSegment(slugConfig, [defaultFolder, fields?.dirname as string]);

View File

@ -125,7 +125,7 @@ export function selectEntryCollectionTitle(collection: Collection, entry: Entry)
// try to infer a title field from the entry data
const entryData = entry.data;
const titleField = selectInferedField(collection, 'title');
const titleField = selectInferredField(collection, 'title');
const result = titleField && get(entryData, keyToPathArray(titleField));
// if the custom field does not yield a result, fallback to 'title'
@ -138,7 +138,7 @@ export function selectEntryCollectionTitle(collection: Collection, entry: Entry)
export function selectDefaultSortableFields(collection: Collection, backend: Backend) {
let defaultSortable = SORTABLE_FIELDS.map((type: string) => {
const field = selectInferedField(collection, type);
const field = selectInferredField(collection, type);
if (backend.isGitBackend() && type === 'author' && !field) {
// default to commit author if not author field is found
return COMMIT_AUTHOR;
@ -336,7 +336,7 @@ export function selectIdentifier(collection: Collection) {
);
}
export function selectInferedField(collection: Collection, fieldName: string) {
export function selectInferredField(collection: Collection, fieldName: string) {
if (fieldName === 'title' && collection.identifier_field) {
return selectIdentifier(collection);
}
@ -393,11 +393,11 @@ export function selectInferedField(collection: Collection, fieldName: string) {
return null;
}
export function useInferedFields(collection: Collection) {
export function useInferredFields(collection: Collection) {
return useMemo(() => {
const titleField = selectInferedField(collection, 'title');
const shortTitleField = selectInferedField(collection, 'shortTitle');
const authorField = selectInferedField(collection, 'author');
const titleField = selectInferredField(collection, 'title');
const shortTitleField = selectInferredField(collection, 'shortTitle');
const authorField = selectInferredField(collection, 'author');
const iFields: Record<string, InferredField> = {};
if (titleField) {