Skip to content

Commit

Permalink
refactor: format
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjagodic committed Sep 4, 2024
1 parent caa41f1 commit 6a0fca7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/decap-cms-core/src/__tests__/backend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,15 @@ describe('Backend', () => {
backend = new Backend(implementation, { config: {}, backendName: 'github' });
backend.listAllEntries = jest.fn(collection => {
if (collection.get('name') === 'posts') {
return Promise.resolve({entries: posts});
return Promise.resolve({ entries: posts });
}
if (collection.get('name') === 'pages') {
return Promise.resolve({entries: pages});
return Promise.resolve({ entries: pages });
}
if (collection.get('name') === 'files') {
return Promise.resolve({entries: files});
return Promise.resolve({ entries: files });
}
return Promise.resolve({entries: []});
return Promise.resolve({ entries: [] });
});
});

Expand Down
4 changes: 3 additions & 1 deletion packages/decap-cms-core/src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ export class Backend {
);

const formattedEntries = entries.map(this.entryWithFormat(collection));
const errors = formattedEntries.filter(e => e.parseError).map(e => `${e.parseError}. In ${e.path}`);
const errors = formattedEntries
.filter(e => e.parseError)
.map(e => `${e.parseError}. In ${e.path}`);

// If this collection has a "filter" property, filter entries accordingly
const collectionFilter = collection.get('filter');
Expand Down

0 comments on commit 6a0fca7

Please sign in to comment.