How to use the contentful-sdk-core.toPlainObject function in contentful-sdk-core

To help you get started, we’ve selected a few contentful-sdk-core 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-management.js / lib / entities / role.js View on Github external
export function wrapRoleCollection (http, data) {
  const roles = toPlainObject(cloneDeep(data))
  roles.items = roles.items.map((entity) => wrapRole(http, entity))
  return freezeSys(roles)
}
github contentful / contentful.js / lib / entities / content-type.ts View on Github external
export function wrapContentType (data: ContentTypeJSON): ContentType {
  return freezeSys(toPlainObject(cloneDeep(data)))
}
github contentful / contentful-management.js / lib / entities / space-membership.js View on Github external
export function wrapSpaceMembership (http, data) {
  const spaceMembership = toPlainObject(cloneDeep(data))
  enhanceWithMethods(spaceMembership, createSpaceMembershipApi(http))
  return freezeSys(spaceMembership)
}
github contentful / contentful.js / lib / paged-sync.js View on Github external
return (accumulated, item) => {
      if (item.sys.type === type) {
        accumulated.push(toPlainObject(item))
      }
      return accumulated
    }
  }
github contentful / contentful-management.js / lib / entities / personal-access-token.js View on Github external
export function wrapPersonalAccessToken (http, data) {
  const personalAccessToken = toPlainObject(cloneDeep(data))
  enhanceWithMethods(personalAccessToken, createPersonalAccessToken(http))
  return freezeSys(personalAccessToken)
}
github contentful / contentful-management.js / lib / entities / space.js View on Github external
export function wrapSpaceCollection (http, data) {
  const spaces = toPlainObject(cloneDeep(data))
  spaces.items = spaces.items.map((entity) => wrapSpace(http, entity))
  return freezeSys(spaces)
}
github contentful / contentful.js / lib / entities / entry.js View on Github external
export function wrapEntry (data) {
  return freezeSys(toPlainObject(cloneDeep(data)))
}
github contentful / contentful-management.js / lib / entities / locale.js View on Github external
export function wrapLocale (http, data) {
  delete data.internal_code
  const locale = toPlainObject(cloneDeep(data))
  enhanceWithMethods(locale, createLocaleApi(http))
  return freezeSys(locale)
}
github contentful / contentful-management.js / lib / entities / environment.js View on Github external
export function wrapEnvironmentCollection (http, data) {
  const environments = toPlainObject(cloneDeep(data))
  environments.items = environments.items.map((entity) => wrapEnvironment(http, entity))
  return freezeSys(environments)
}
github contentful / contentful-management.js / lib / entities / preview-api-key.js View on Github external
export function wrapPreviewApiKeyCollection (http, data) {
  const previewApiKeys = toPlainObject(cloneDeep(data))
  previewApiKeys.items = previewApiKeys.items.map((entity) => wrapPreviewApiKey(http, entity))
  return freezeSys(previewApiKeys)
}

contentful-sdk-core

Core modules for the Contentful JS SDKs

MIT
Latest version published 5 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages