Skip to content

Commit 206bb1e

Browse files
committed
docs
1 parent d705bd2 commit 206bb1e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/encoding.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22
* Sanitizes text for one or more filter arguments by replacing symbols `:|{}()<>`
33
* with their corresponding HTML-encoded strings (hexadecimal).
44
*
5+
* When multiple arguments are provided, they are sanitized separately and then joined with `:`.
6+
*
7+
* Using this function on the same text multiple times will sanitize the text only once.
8+
*
59
* @param args
610
* Filter argument(s) text to be sanitized.
711
*
812
* @returns
913
* Sanitized string that's safe to use as a filter argument.
10-
* When more than one argument is provided, they are joined with `:`.
1114
*
1215
* @example
1316
* import {sanitizeFilterArgs} from 'custom-string-formatter';
1417
*
1518
* sanitizeFilterArgs('some (text)'); //=> some &#x28;text&#x29;
1619
*
20+
* @example
21+
* import {sanitizeFilterArgs} from 'custom-string-formatter';
22+
*
23+
* sanitizeFilterArgs('hello', 'there :)'); //=> hello:there &#x3a;&#x29;
24+
*
1725
* @see {@link decodeFilterArg}
1826
*/
1927
export function sanitizeFilterArgs(...args: string[]): string {

0 commit comments

Comments
 (0)