/** * @description * Creates a valid query params object for get requests * ie. plugins[i18n][locale]=en becomes locale=en */ const buildValidParams = (query)=>{ if (!query) return query; // Extract pluginOptions from the query, they shouldn't be part of the URL const { plugins: _, ...validQueryParams } = { ...query, ...Object.values(query?.plugins ?? {}).reduce((acc, current)=>{ if (typeof current === 'object' && current !== null) { return Object.assign(acc, current); } return acc; }, {}) }; return validQueryParams; }; const isBaseQueryError = (error)=>{ return error.name !== undefined; }; export { buildValidParams, isBaseQueryError }; //# sourceMappingURL=api.mjs.map