(raw)
| 512 | * @return {string} The encoded value. |
| 513 | */ |
| 514 | export function encodeVars(raw) { |
| 515 | if (raw == null) { |
| 516 | return ''; |
| 517 | } |
| 518 | |
| 519 | if (isArray(raw)) { |
| 520 | return raw.map(encodeVars).join(','); |
| 521 | } |
| 522 | // Separate out names and arguments from the value and encode the value. |
| 523 | const {argList, name} = getNameArgs(String(raw)); |
| 524 | return encodeURIComponent(name) + argList; |
| 525 | } |
| 526 | |
| 527 | /** |
| 528 | * Returns an array containing two values: name and args parsed from the key. |
no test coverage detected