MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / dedent

Function dedent

packages/plugins/openapi/src/sdk/split.ts:242–243  ·  view source on GitHub ↗
(fragment: string, indent: number)

Source from the content-addressed store, hash-verified

240/** Strip exactly `indent` leading spaces from every line of `fragment`, lifting
241 * an indent-N block back to column 0 so it parses as a standalone document. */
242const dedent = (fragment: string, indent: number): string =>
243 indent === 0 ? fragment : fragment.replace(new RegExp(`^ {1,${indent}}`, "gm"), "");
244
245const parseYaml = (text: string): unknown =>
246 parseYamlDocument(text, { json: true, schema: JSON_SCHEMA });

Callers 1

parseEntryFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected