Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function wrapRoleCollection (http, data) {
const roles = toPlainObject(cloneDeep(data))
roles.items = roles.items.map((entity) => wrapRole(http, entity))
return freezeSys(roles)
}
export function wrapContentType (data: ContentTypeJSON): ContentType {
return freezeSys(toPlainObject(cloneDeep(data)))
}
export function wrapSpaceMembership (http, data) {
const spaceMembership = toPlainObject(cloneDeep(data))
enhanceWithMethods(spaceMembership, createSpaceMembershipApi(http))
return freezeSys(spaceMembership)
}
return (accumulated, item) => {
if (item.sys.type === type) {
accumulated.push(toPlainObject(item))
}
return accumulated
}
}
export function wrapPersonalAccessToken (http, data) {
const personalAccessToken = toPlainObject(cloneDeep(data))
enhanceWithMethods(personalAccessToken, createPersonalAccessToken(http))
return freezeSys(personalAccessToken)
}
export function wrapSpaceCollection (http, data) {
const spaces = toPlainObject(cloneDeep(data))
spaces.items = spaces.items.map((entity) => wrapSpace(http, entity))
return freezeSys(spaces)
}
export function wrapEntry (data) {
return freezeSys(toPlainObject(cloneDeep(data)))
}
export function wrapLocale (http, data) {
delete data.internal_code
const locale = toPlainObject(cloneDeep(data))
enhanceWithMethods(locale, createLocaleApi(http))
return freezeSys(locale)
}
export function wrapEnvironmentCollection (http, data) {
const environments = toPlainObject(cloneDeep(data))
environments.items = environments.items.map((entity) => wrapEnvironment(http, entity))
return freezeSys(environments)
}
export function wrapPreviewApiKeyCollection (http, data) {
const previewApiKeys = toPlainObject(cloneDeep(data))
previewApiKeys.items = previewApiKeys.items.map((entity) => wrapPreviewApiKey(http, entity))
return freezeSys(previewApiKeys)
}