UNPKG

contentful-management

Version:
21 lines (20 loc) 698 B
import { freezeSys, toPlainObject } from 'contentful-sdk-core'; import copy from 'fast-copy'; import { wrapCollection } from '../common-utils'; /** * @private * @param makeRequest - function to make requests via an adapter * @param data - raw contentful-Function data * @return Wrapped Function data */ export function wrapFunctionLog(makeRequest, data) { const functionLog = toPlainObject(copy(data)); return freezeSys(functionLog); } /** * @private * @param makeRequest - function to make requests via an adapter * @param data - raw contentful-function data * @return Wrapped App Function collection data */ export const wrapFunctionLogCollection = wrapCollection(wrapFunctionLog);