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

Function parseContentKey

packages/decap-cms-lib-util/src/APIUtils.ts:27–30  ·  view source on GitHub ↗
(contentKey: string)

Source from the content-addressed store, hash-verified

25}
26
27export function parseContentKey(contentKey: string) {
28 const index = contentKey.indexOf('/');
29 return { collection: contentKey.slice(0, index), slug: contentKey.slice(index + 1) };
30}
31
32export function contentKeyFromBranch(branch: string) {
33 return branch.slice(`${CMS_BRANCH_PREFIX}/`.length);

Callers 6

localGitMiddlewareFunction · 0.90
parseContentKeyMethod · 0.90
parseContentKeyMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected