UNPKG

contentful-management

Version:
20 lines (17 loc) 635 B
import { toPlainObject, freezeSys } from 'contentful-sdk-core'; import copy from 'fast-copy'; import createUIConfigApi from '../create-ui-config-api.js'; import enhanceWithMethods from '../enhance-with-methods.js'; /** * @internal * @param makeRequest - function to make requests via an adapter * @param data - Raw data * @returns Wrapped UIConfig */ function wrapUIConfig(makeRequest, data) { const user = toPlainObject(copy(data)); const userWithMethods = enhanceWithMethods(user, createUIConfigApi(makeRequest)); return freezeSys(userWithMethods); } export { wrapUIConfig }; //# sourceMappingURL=ui-config.js.map