Skip to content

Commit b909ca8

Browse files
committed
Remove rimraf, add types field
1 parent 92b1688 commit b909ca8

File tree

3 files changed

+5
-121
lines changed

3 files changed

+5
-121
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For all of the following functions, argument `expression` is the target string,
2727

2828
*Arguments: `expression, needle, replacement, [context]`*
2929

30-
Replaces all unescaped instances of a regex pattern in the given context, using a replacement string or callback function.
30+
Replaces all unescaped instances of a regex pattern in the given context, using a replacement string or function.
3131

3232
<details>
3333
<summary>Examples with a replacement string</summary>
@@ -46,7 +46,7 @@ replaceUnescaped(str, '\\.', '@', Context.CHAR_CLASS);
4646
Details for the `replacement` argument:
4747

4848
- If a string is provided, it's used literally without special handling for backreferences, etc.
49-
- If a callback function is provided, it receives two arguments:
49+
- If a function is provided, it receives two arguments:
5050
1. The match object (which includes `groups`, `index`, etc.).
5151
2. An object with extended details (`context` and `negated`) about where the match was found.
5252

@@ -66,9 +66,7 @@ Checks whether an unescaped instance of a regex pattern appears in the given con
6666

6767
*Arguments: `expression, needle, callback, [context]`*
6868

69-
Runs a callback function for each unescaped instance of a regex pattern in the given context.
70-
71-
Callback functions receive two arguments:
69+
Runs a function for each unescaped match of a regex pattern in the given context. The function receives two arguments:
7270

7371
1. The match object (which includes `groups`, `index`, etc.).
7472
2. An object with extended details (`context` and `negated`) about where the match was found.

package-lock.json

Lines changed: 0 additions & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"import": "./src/index.js"
1212
}
1313
},
14+
"types": "./types/index.d.ts",
1415
"scripts": {
1516
"types": "tsc src/index.js --rootDir src --declaration --allowJs --emitDeclarationOnly --outdir types",
16-
"prebuild": "rimraf --glob types/*",
17+
"prebuild": "rm -rf types/*",
1718
"build": "npm run types",
1819
"pretest": "npm run build",
1920
"test": "jasmine",
@@ -29,7 +30,6 @@
2930
},
3031
"devDependencies": {
3132
"jasmine": "^5.2.0",
32-
"rimraf": "6.0.1",
3333
"typescript": "5.5.4"
3434
}
3535
}

0 commit comments

Comments
 (0)