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

Function asString

packages/decap-cms-lib-util/src/notesFormat.ts:61–63  ·  view source on GitHub ↗

* The marker is hand-editable on the host, so nothing in it is trusted to be * the type it should be. A non-string author reaching `Note` crashes the pane * outright - the avatar initials call `.split()` on it - so anything that is * not a usable string is treated as no recorded author, which fal

(value: unknown)

Source from the content-addressed store, hash-verified

59 * the account that posted the comment.
60 */
61function asString(value: unknown) {
62 return typeof value === 'string' && value.trim() ? value.trim() : undefined;
63}
64
65export function parseNoteBody(body: string): ParsedNoteBody {
66 const match = body.match(NOTE_PATTERN);

Callers 1

parseNoteBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected