MCPcopy Create free account
hub / github.com/chhoumann/quickadd / unwrapQuotedValue

Function unwrapQuotedValue

src/utils/valueSyntax.ts:671–680  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

669 * Unquoted values pass through unchanged.
670 */
671export function unwrapQuotedValue(value: string): string {
672 const trimmed = value.trim();
673 if (!isDoubleQuote(trimmed[0])) return value;
674 // Reuse the list grammar so unwrapping matches splitting exactly (strict
675 // close, doubled-quote escape). Only a single, fully balanced quoted field is
676 // unwrapped; anything that falls back to a literal split is left untouched.
677 const fields = splitQuotedCommaList(trimmed);
678 if (fields.length === 1 && fields[0] !== trimmed) return fields[0].trim();
679 return value;
680}
681
682export function parseValueToken(
683 raw: string,

Callers 3

scanVariableTokensMethod · 0.90
parseValueTokenFunction · 0.85

Calls 2

isDoubleQuoteFunction · 0.85
splitQuotedCommaListFunction · 0.85

Tested by

no test coverage detected