diff --git a/packages/decap-cms-core/src/lib/__tests__/serializeEntryValues.spec.js b/packages/decap-cms-core/src/lib/__tests__/serializeEntryValues.spec.js index 4b2aa66be9c8..147697874d61 100644 --- a/packages/decap-cms-core/src/lib/__tests__/serializeEntryValues.spec.js +++ b/packages/decap-cms-core/src/lib/__tests__/serializeEntryValues.spec.js @@ -3,7 +3,10 @@ import { fromJS } from 'immutable'; import { serializeValues, deserializeValues } from '../serializeEntryValues'; const values = fromJS({ title: 'New Post', unknown: 'Unknown Field', removed_image: '' }); -const fields = fromJS([{ name: 'title', widget: 'string' }, { name: 'removed_image', widget: 'image' }]); +const fields = fromJS([ + { name: 'title', widget: 'string' }, + { name: 'removed_image', widget: 'image' }, +]); describe('serializeValues', () => { it('should retain unknown fields', () => { diff --git a/packages/decap-cms-core/src/lib/serializeEntryValues.js b/packages/decap-cms-core/src/lib/serializeEntryValues.js index e763e070d08b..706d39df1d69 100644 --- a/packages/decap-cms-core/src/lib/serializeEntryValues.js +++ b/packages/decap-cms-core/src/lib/serializeEntryValues.js @@ -71,7 +71,8 @@ function runSerializer(values, fields, method, config = {}, isRecursive = false) // Remove only on the top level, otherwise `mergeDeep` will reinsert them. if (config.remove_empty_image_field && !isRecursive) { - serializedData = serializedData.map(v => removeEntriesRecursive(v)) + serializedData = serializedData + .map(v => removeEntriesRecursive(v)) .filter(v => v !== FLAG_REMOVE_ENTRY); }