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

Function getPreviewStatus

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

Source from the content-addressed store, hash-verified

325 * matching status is inferred via `isPreviewContext`.
326 */
327export function getPreviewStatus(
328 statuses: {
329 context: string;
330 target_url: string;
331 state: PreviewState;
332 }[],
333 previewContext: string,
334) {
335 return statuses.find(({ context }) => {
336 return isPreviewContext(context, previewContext);
337 });
338}
339
340function getConflictingBranches(branchName: string) {
341 // 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