Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hip3r committed Oct 22, 2024
1 parent 4de43fd commit 9b70e0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/decap-cms-core/src/lib/serializeEntryValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 9b70e0c

Please sign in to comment.