MCPcopy
hub / github.com/usebruno/bruno / getValueString

Function getValueString

packages/bruno-lang/v2/src/utils.js:34–48  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

32};
33
34const getValueString = (value) => {
35 // Handle null, undefined, and empty strings
36 if (!value) {
37 return '';
38 }
39
40 const hasNewLines = value.includes('\n') || value.includes('\r');
41
42 if (!hasNewLines) {
43 return value;
44 }
45
46 // Wrap multiline values in triple quotes with 2-space indentation
47 return `'''\n${indentString(value)}\n'''`;
48};
49
50const getKeyString = (key) => {
51 const quotableChars = [':', '"', '{', '}', ' '];

Callers 5

jsonToBruFunction · 0.85
jsonToCollectionBruFunction · 0.85
envToJsonFunction · 0.85
jsonToExampleBruFunction · 0.85
utils.spec.jsFile · 0.85

Calls 1

indentStringFunction · 0.70

Tested by

no test coverage detected