diff --git a/packages/components/src/spacer/hook.ts b/packages/components/src/spacer/hook.ts index 82d36baa5e202f..3ef4b21e104c74 100644 --- a/packages/components/src/spacer/hook.ts +++ b/packages/components/src/spacer/hook.ts @@ -12,8 +12,9 @@ import { space } from '../utils/space'; import { rtl, useCx } from '../utils'; import type { SpacerProps } from './types'; -const isDefined = < T >( o: T ): o is Exclude< T, null | undefined > => - typeof o !== 'undefined' && o !== null; +function isDefined< T >( o: T ): o is Exclude< T, null | undefined > { + return typeof o !== 'undefined' && o !== null; +} export function useSpacer( props: WordPressComponentProps< SpacerProps, 'div' > diff --git a/packages/data-controls/src/index.ts b/packages/data-controls/src/index.ts index 9edc6502ef881f..c0898d214224f5 100644 --- a/packages/data-controls/src/index.ts +++ b/packages/data-controls/src/index.ts @@ -154,7 +154,9 @@ export const __unstableAwaitPromise = function < T >( promise: Promise< T > ) { * store. */ export const controls = { - AWAIT_PROMISE: < T >( { promise }: { promise: Promise< T > } ) => promise, + AWAIT_PROMISE< T >( { promise }: { promise: Promise< T > } ) { + return promise; + }, API_FETCH( { request }: { request: APIFetchOptions } ) { return triggerFetch( request ); }, diff --git a/packages/fields/src/mutation/index.ts b/packages/fields/src/mutation/index.ts index 80e399d74e9479..89df0f769f70ed 100644 --- a/packages/fields/src/mutation/index.ts +++ b/packages/fields/src/mutation/index.ts @@ -10,9 +10,9 @@ import { dispatch } from '@wordpress/data'; */ import type { CoreDataError, Post } from '../types'; -const getErrorMessagesFromPromises = < T >( +function getErrorMessagesFromPromises< T >( allSettledResults: PromiseSettledResult< T >[] -) => { +) { const errorMessages = new Set< string >(); // If there was at lease one failure. if ( allSettledResults.length === 1 ) { @@ -36,7 +36,7 @@ const getErrorMessagesFromPromises = < T >( } } return errorMessages; -}; +} export type NoticeSettings< T extends Post > = { success: {