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

Function parseGitPatternAttribute

packages/decap-cms-lib-util/src/git-lfs.ts:51–64  ·  view source on GitHub ↗
(attributeString: string)

Source from the content-addressed store, hash-verified

49}
50
51function parseGitPatternAttribute(attributeString: string) {
52 // There are three kinds of attribute settings:
53 // - a key=val pair sets an attribute to a specific value
54 // - a key without a value and a leading hyphen sets an attribute to false
55 // - a key without a value and no leading hyphen sets an attribute
56 // to true
57 if (attributeString.includes('=')) {
58 return attributeString.split('=');
59 }
60 if (attributeString.startsWith('-')) {
61 return [attributeString.slice(1), false];
62 }
63 return [attributeString, true];
64}
65
66const parseGitPatternAttributes = flow([
67 (attributes: string[]) => attributes.map(parseGitPatternAttribute),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected