contentful-management
Version:
Client for Contentful's Content Management API
20 lines (18 loc) • 633 B
JavaScript
/**
* @internal
*/
const wrap = ({ makeRequest, defaults }, entityType, action) => {
// @ts-expect-error It's not really possible to make this type safe as we are overloading `makeRequest`. This missing typesafety is only within `wrap`. `wrap` has proper public types.
return (params, payload, headers) =>
// @ts-expect-error see above
makeRequest({
entityType,
action,
params: { ...defaults, ...params },
payload,
// Required after adding optional headers to a delete method for the first time
headers,
});
};
export { wrap };
//# sourceMappingURL=wrap.js.map