Skip to main content

unescapeStringLiteral

@webda/ql


Function: unescapeStringLiteral()

unescapeStringLiteral(literal): string

Defined in: packages/ql/src/query.ts:48

Strip the quotes of a WebdaQL string literal and unescape its contents.

Processes the inner text (between outer quotes) with these rules, applied left-to-right:

  • \\ → \ (escaped backslash)
  • `` followed by the literal's quote char → the quote char (backslash-escaped quote)
  • the quote char doubled → one quote char (SQL-style doubled quote)
  • any other \x → \x kept verbatim (so LIKE's \% and \_ reach likeToRegex unchanged)

Parameters​

literal​

string

the literal including its surrounding quotes

Returns​

string

the literal value