MCPcopy Create free account
hub / github.com/Effect-TS/effect / printKey

Function printKey

packages/effect/src/encoding/Yaml.ts:1695–1703  ·  view source on GitHub ↗
(key: string, path: () => string)

Source from the content-addressed store, hash-verified

1693
1694// The unquoted merge key would be processed by `parse`, so it is always quoted.
1695const printKey = (key: string, path: () => string): string => {
1696 const printed = key === "<<" ? doubleQuote(key) : printSingleLine(key)
1697 if (printed.length > implicitKeyLimit) {
1698 throw new PrintError(
1699 `Cannot print a mapping key of ${printed.length} characters (implicit keys are limited to ${implicitKeyLimit}) at ${path()}`
1700 )
1701 }
1702 return printed
1703}
1704
1705// Indentation strings, built once per width.
1706const pads: Array<string> = []

Callers 1

collectionMethod · 0.85

Calls 3

doubleQuoteFunction · 0.85
printSingleLineFunction · 0.85
pathFunction · 0.50

Tested by

no test coverage detected