How to use contentful-resolve-response - 2 common examples

To help you get started, we’ve selected a few contentful-resolve-response examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github contentful / contentful.js / lib / paged-sync.js View on Github external
.then((response) => {
      // clones response.items used in includes because we don't want these to be mutated
      if (resolveLinks) {
        response.items = resolveResponse(response, {removeUnresolved, itemEntryPoints: ['fields']})
      }
      // maps response items again after getters are attached
      const mappedResponseItems = mapResponseItems(response.items)

      if (response.nextSyncToken) {
        mappedResponseItems.nextSyncToken = response.nextSyncToken
      }

      if (response.nextPageToken) {
        mappedResponseItems.nextPageToken = response.nextPageToken
      }

      return freezeSys(mixinStringifySafe(toPlainObject(mappedResponseItems)))
    }, (error) => {
      throw error
github contentful / contentful.js / lib / entities / entry.js View on Github external
export function wrapEntryCollection (data, {resolveLinks, removeUnresolved}) {
  const wrappedData = mixinStringifySafe(toPlainObject(cloneDeep(data)))
  if (resolveLinks) {
    wrappedData.items = resolveResponse(wrappedData, {removeUnresolved, itemEntryPoints: ['fields']})
  }
  return freezeSys(wrappedData)
}

contentful-resolve-response

[![npm](https://img.shields.io/npm/v/contentful-resolve-response.svg)](https://www.npmjs.com/package/contentful-resolve-response)

MIT
Latest version published 8 months ago

Package Health Score

86 / 100
Full package analysis

Popular contentful-resolve-response functions

Similar packages