Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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
export function wrapEntryCollection (data, {resolveLinks, removeUnresolved}) {
const wrappedData = mixinStringifySafe(toPlainObject(cloneDeep(data)))
if (resolveLinks) {
wrappedData.items = resolveResponse(wrappedData, {removeUnresolved, itemEntryPoints: ['fields']})
}
return freezeSys(wrappedData)
}