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

Method formatData

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

Source from the content-addressed store, hash-verified

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