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

Method formatData

packages/decap-cms-core/src/backend.ts:1061–1075  ·  view source on GitHub ↗
(data: string, path: string, newFile: boolean)

Source from the content-addressed store, hash-verified

1059 );
1060
1061 const formatData = (data: string, path: string, newFile: boolean) => {
1062 const entry = createEntry(collection.get('name'), slug, path, {
1063 raw: data,
1064 isModification: !newFile,
1065 label: collection && selectFileEntryLabel(collection, slug),
1066 mediaFiles,
1067 updatedOn: entryData.updatedAt,
1068 author: entryData.pullRequestAuthor,
1069 status: entryData.status,
1070 meta: { path: prepareMetaPath(path, collection) },
1071 });
1072
1073 const entryWithFormat = this.entryWithFormat(collection)(entry);
1074 return entryWithFormat;
1075 };
1076
1077 const readAndFormatDataFile = async (dataFile: UnpublishedEntryDiff) => {
1078 const data = await this.implementation.unpublishedEntryDataFile(

Callers

nothing calls this directly

Calls 5

entryWithFormatMethod · 0.95
createEntryFunction · 0.90
selectFileEntryLabelFunction · 0.90
prepareMetaPathFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected