Skip to content

Commit b21704b

Browse files
committed
☕ Add jsdoc about negative offset
1 parent e6e2076 commit b21704b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export async function downloadString(url: string): Promise<string> {
1717
/**
1818
* Find the position of the first pattern match.
1919
* Search from the specified position, or from the beginning if not specified.
20+
* If `offset` is negative value, the starting position is counted from the end of the string.
2021
* Returns -1 if the pattern not match.
2122
*/
2223
export function regexIndexOf(s: string, pattern: RegExp, offset = 0): number {

0 commit comments

Comments
 (0)