Skip to content

Commit 3308a5c

Browse files
committed
docs: more docs
1 parent 7461d41 commit 3308a5c

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ npm install @gruhn/regex-utils
2424

2525
There is a high-level API and a low-level API:
2626

27-
- [high-level API documentation](https://gruhn.github.io/regex-utils/modules/high-level-api.html)
28-
- [low-level API documentation](https://gruhn.github.io/regex-utils/modules/low-level-api.html)
27+
- [high-level API documentation](https://gruhn.github.io/regex-utils/modules/High-level_API.html)
28+
- [low-level API documentation](https://gruhn.github.io/regex-utils/modules/Low-Level_API.html)
2929

3030
The high-level API operates directly on native JavaScript `RegExp` instances,
3131
which is more convenient but also requires parsing the regular expression.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"name": "@gruhn/regex-utils",
3+
"description": "TypeScript library for regex intersection, complement and other utilities that go beyond string matching.",
4+
"author": "Niklas Gruhn",
5+
"license": "MIT",
6+
"repository": "github:gruhn/regex-utils",
37
"version": "0.0.0-development",
48
"type": "module",
59
"scripts": {
@@ -8,24 +12,20 @@
812
"build": "tsc --project tsconfig.build.json && tsc-alias",
913
"build:docs": "typedoc --tsconfig tsconfig.build.json"
1014
},
11-
"main": "./dist/high-level-api.js",
15+
"main": "./dist/index.js",
1216
"exports": {
1317
".": {
14-
"import": "./dist/high-level-api.js",
15-
"types": "./dist/high-level-api.d.ts"
18+
"import": "./dist/index.js",
19+
"types": "./dist/index.d.ts"
1620
},
1721
"./low-level-api": {
1822
"import": "./dist/low-level-api.js",
1923
"types": "./dist/low-level-api.d.ts"
2024
}
2125
},
22-
"author": "Niklas Gruhn",
23-
"license": "MIT",
24-
"repository": "github:gruhn/regex-utils",
2526
"files": [
2627
"dist"
2728
],
28-
"description": "TypeScript library for regex intersection, complement and other utilities that go beyond string matching.",
2929
"devDependencies": {
3030
"0x": "^5.8.0",
3131
"fast-check": "^3.23.2",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* The high-level API operates directly on native JavaScript `RegExp` instances.
3+
* Use this if you want convenience. Use the low-level API if you want speed.
4+
*
5+
* @module High-level API
6+
*/
7+
18
import * as RE from './low-level-api'
29

310
/**

src/low-level-api.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* The high-level API operates directly on native JavaScript `RegExp` instances.
3+
* The low-level API provides the same functions but operates on the custom data
4+
* types `StdRegex` (standard regex) and `ExtRegex` (extended regex).
5+
* Most of the additional functions are just a
6+
* [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)
7+
* for constructing instances of these types.
8+
*
9+
* `ExtRegex` is a super-type of `StdRegex` and extends it with complement and
10+
* intersection operators which have no direct representation in standard regular
11+
* expressions. Some operations like `size` and `enumerate` only work on `StdRegex`.
12+
* `ExtRegex` can always be "compiled down" to `StdRegex` using `toStdRegex`.
13+
* But note that most computational cost is concentrated in this transformation.
14+
*
15+
* @module Low-Level API
16+
*/
17+
118
export {
219
parseRegExp as parse
320
} from './regex-parser'

typedoc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"entryPoints": ["src/high-level-api.ts", "src/low-level-api.ts"],
32
"navigationLinks": {
43
"GitHub": "https://github.com/gruhn/regex-utils"
54
}

0 commit comments

Comments
 (0)