2024-03-21 18:20:12 +01:00

15 lines
362 B
TypeScript

import type { Core } from '@strapi/types';
import type { Services } from './services';
export const getService = <TName extends keyof Services>(
name: TName,
{ strapi }: { strapi: Core.Strapi } = { strapi: global.strapi }
): Services[TName] => {
return strapi.plugin('documentation').service<Services[TName]>(name);
};
export default {
getService,
};