MCPcopy Create free account
hub / github.com/Make-md/makemd / wrapObjectString

Function wrapObjectString

src/core/utils/strings.ts:56–56  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

54
55
56export const wrapObjectString = (s: string) => `{ ${Object.entries(safelyParseJSON(s)).map(([key, value]) => `${key}: ${value}`).join(', ')} }`
57export const wrapParanthesis = (s: string) => s ? `(${s})` : null;
58export const wrapQuotes = (s: string) => s ? `"${s.replace(/"/g, '\\"').replace(/\n/g, "\\n")}"` : null
59export const unwrapParanthesis = (s: string) => {

Callers

nothing calls this directly

Calls 3

safelyParseJSONFunction · 0.90
entriesMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected