UNPKG

strapi-plugin-publisher

Version:

A plugin for Strapi Headless CMS that provides the ability to schedule publishing for any content type.

14 lines (11 loc) 385 B
type TradOptions = Record<string, string>; const prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => { if (!pluginId) { throw new TypeError("pluginId can't be empty"); } return Object.keys(trad).reduce((acc, current) => { acc[`${pluginId}.${current}`] = trad[current]; return acc; }, {} as TradOptions); }; export { prefixPluginTranslations };