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

Function getPreviewStatus

packages/decap-cms-lib-util/src/API.ts:330–341  ·  view source on GitHub ↗
(
  statuses: {
    context: string;
    target_url: string;
    state: PreviewState;
  }[],
  previewContext: string,
)

Source from the content-addressed store, hash-verified

328 * matching status is inferred via `isPreviewContext`.
329 */
330export function getPreviewStatus(
331 statuses: {
332 context: string;
333 target_url: string;
334 state: PreviewState;
335 }[],
336 previewContext: string,
337) {
338 return statuses.find(({ context }) => {
339 return isPreviewContext(context, previewContext);
340 });
341}
342
343function getConflictingBranches(branchName: string) {
344 // for cms/posts/post-1, conflicting branches are cms/posts, cms

Callers 4

getDeployPreviewMethod · 0.90
getDeployPreviewMethod · 0.90
getDeployPreviewMethod · 0.90
getDeployPreviewMethod · 0.90

Calls 2

isPreviewContextFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected