Skip to content

Commit c224f7b

Browse files
committed
fix: reconstructRegex return type and docblock types.
- Fixed `reconstructRegex` return type to explicitly be typed as `RegExp` and added docblock types.
1 parent e6db661 commit c224f7b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ export function ensureDirExists(dir: string) {
119119
* Reconstruct the regex pattern because vscode doesn't like the regex pattern as a string,
120120
* or some patterns are not working as expected.
121121
*
122-
* @param obj The object
123-
* @param key The key to check in the object
122+
* @param {unknown} obj The object
123+
* @param {string} key The key to check in the object
124124
* @returns {RegExp} The reconstructed regex pattern.
125125
*/
126-
export function reconstructRegex(obj: unknown, key: string) {
126+
export function reconstructRegex(obj: unknown, key: string): RegExp {
127127
// If key has a "pattern" key, then it's an object...
128128
if (Object.hasOwn(obj[key], "pattern")) {
129129
return new RegExp(obj[key].pattern);

0 commit comments

Comments
 (0)