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

Function isPreviewContext

packages/decap-cms-lib-util/src/API.ts:314–319  ·  view source on GitHub ↗
(context: string, previewContext: string)

Source from the content-addressed store, hash-verified

312 * otherwise checks for inclusion of a value from `PREVIEW_CONTEXT_KEYWORDS`.
313 */
314export function isPreviewContext(context: string, previewContext: string) {
315 if (previewContext) {
316 return context === previewContext;
317 }
318 return PREVIEW_CONTEXT_KEYWORDS.some(keyword => context.includes(keyword));
319}
320
321export enum PreviewState {
322 Other = 'other',

Callers 1

getPreviewStatusFunction · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected