* Encodes a string to be used in a URL. * @param {String} input The string to encode. * @returns {String} The encoded string.
(input)
| 479 | * @returns {String} The encoded string. |
| 480 | */ |
| 481 | static encodeForUrl(input) { |
| 482 | return encodeURIComponent(input).replace(/[!'.()*]/g, char => |
| 483 | '%' + char.charCodeAt(0).toString(16).toUpperCase() |
| 484 | ); |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Creates a JSON replacer function that handles Map, Set, and circular references. |