chore(deps): update dependency prettier to v2.8.2 (#311)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Lautzenheiser <lautzd@gmail.com>
This commit is contained in:
renovate[bot]
2023-01-09 13:29:30 -05:00
committed by GitHub
parent d9ecbd9841
commit 704dfa96b2
8 changed files with 36 additions and 36 deletions

View File

@ -28,7 +28,7 @@ import type {
} from '../interface';
export const allowedEvents = ['prePublish', 'postPublish', 'preSave', 'postSave'] as const;
export type AllowedEvent = typeof allowedEvents[number];
export type AllowedEvent = (typeof allowedEvents)[number];
const eventHandlers = allowedEvents.reduce((acc, e) => {
acc[e] = [];

View File

@ -24,11 +24,11 @@ const formatters = {
function catchFormatErrors<T extends keyof typeof formatters>(
format: T,
formatter: typeof formatters[T],
formatter: (typeof formatters)[T],
) {
return (res: Response) => {
try {
return formatter(res) as ReturnType<typeof formatters[T]>;
return formatter(res) as ReturnType<(typeof formatters)[T]>;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(
@ -62,8 +62,8 @@ interface ParseResponseOptions {
export async function parseResponse<T extends keyof typeof responseFormatters = 'text'>(
res: Response,
{ expectingOk = true, format = 'text', apiName = '' }: ParseResponseOptions,
): Promise<Awaited<ReturnType<typeof responseFormatters[T]>>> {
let body: Awaited<ReturnType<typeof responseFormatters[T]>>;
): Promise<Awaited<ReturnType<(typeof responseFormatters)[T]>>> {
let body: Awaited<ReturnType<(typeof responseFormatters)[T]>>;
try {
const formatter = responseFormatters[format] ?? false;
if (!formatter) {