MCPcopy Create free account
hub / github.com/decaporg/decap-cms / entryWithFormat

Method entryWithFormat

packages/decap-cms-core/src/backend.ts:1014–1024  ·  view source on GitHub ↗
(collection: Collection)

Source from the content-addressed store, hash-verified

1012 }
1013
1014 entryWithFormat(collection: Collection) {
1015 return (entry: EntryValue): EntryValue => {
1016 const format = resolveFormat(collection, entry);
1017 if (entry && entry.raw !== undefined) {
1018 const data = (format && attempt(format.fromFile.bind(format, entry.raw))) || {};
1019 if (isError(data)) console.error(data);
1020 return Object.assign(entry, { data: isError(data) ? {} : data });
1021 }
1022 return format.fromFile(entry);
1023 };
1024 }
1025
1026 async processUnpublishedEntry(
1027 collection: Collection,

Callers 4

processEntriesMethod · 0.95
formatRawDataMethod · 0.95
getEntryValueMethod · 0.95
formatDataMethod · 0.95

Calls 2

resolveFormatFunction · 0.90
fromFileMethod · 0.80

Tested by

no test coverage detected