@openclaw/lobster 2026.6.33 → 2026.6.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/node_modules/fast-uri/.github/dependabot.yml +42 -2
  2. package/node_modules/fast-uri/.github/workflows/ci.yml +54 -6
  3. package/node_modules/fast-uri/.github/workflows/lock-threads.yml +1 -1
  4. package/node_modules/fast-uri/.github/workflows/ossf-scorecard.yml +45 -0
  5. package/node_modules/fast-uri/README.md +10 -9
  6. package/node_modules/fast-uri/SECURITY.md +173 -0
  7. package/node_modules/fast-uri/benchmark/benchmark.mjs +71 -0
  8. package/node_modules/fast-uri/benchmark/encoder.mjs +54 -0
  9. package/node_modules/fast-uri/index.js +277 -45
  10. package/node_modules/fast-uri/lib/schemes.js +384 -7
  11. package/node_modules/fast-uri/lib/utils.js +458 -95
  12. package/node_modules/fast-uri/package.json +4 -4
  13. package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  14. package/node_modules/fast-uri/test/equal.test.js +94 -3
  15. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +24 -1
  16. package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +23 -1
  17. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  18. package/node_modules/fast-uri/test/ipv6-validation.test.js +154 -0
  19. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  20. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  21. package/node_modules/fast-uri/test/parse.test.js +150 -3
  22. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  23. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  24. package/node_modules/fast-uri/test/scheme-normalization.test.js +16 -0
  25. package/node_modules/fast-uri/test/scheme-validation.test.js +122 -0
  26. package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  27. package/node_modules/fast-uri/test/security-utf8-encoding.test.js +0 -0
  28. package/node_modules/fast-uri/test/security.test.js +301 -3
  29. package/node_modules/fast-uri/test/serialize.test.js +144 -0
  30. package/node_modules/fast-uri/test/uri-js-compatibility.test.js +0 -3
  31. package/node_modules/fast-uri/test/uri-js.test.js +4 -4
  32. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  33. package/node_modules/fast-uri/test/util.test.js +9 -0
  34. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  35. package/node_modules/fast-uri/tsconfig.json +8 -7
  36. package/node_modules/fast-uri/types/index.d.ts +4 -9
  37. package/node_modules/fast-uri/types/index.tst.ts +31 -0
  38. package/npm-shrinkwrap.json +5 -5
  39. package/package.json +4 -4
  40. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +0 -24
  41. package/node_modules/fast-uri/types/index.test-d.ts +0 -17
@@ -2,12 +2,52 @@ version: 2
2
2
  updates:
3
3
  - package-ecosystem: "github-actions"
4
4
  directory: "/"
5
+ commit-message:
6
+ # Prefix all commit messages with "chore: "
7
+ prefix: "chore"
5
8
  schedule:
6
- interval: "monthly"
9
+ interval: "weekly"
10
+ cooldown:
11
+ default-days: 7
12
+ allow:
13
+ - dependency-name: "*"
14
+ update-types:
15
+ - "version-update:semver-major"
7
16
  open-pull-requests-limit: 10
8
17
 
9
18
  - package-ecosystem: "npm"
10
19
  directory: "/"
20
+ commit-message:
21
+ # Prefix all commit messages with "chore: "
22
+ prefix: "chore"
11
23
  schedule:
12
- interval: "monthly"
24
+ interval: "weekly"
25
+ cooldown:
26
+ default-days: 7
27
+ versioning-strategy: "increase-if-necessary"
28
+ allow:
29
+ - dependency-name: "*"
30
+ update-types:
31
+ - "version-update:semver-major"
32
+ ignore:
33
+ # TODO: remove ignore until neostandard support ESLint 10
34
+ - dependency-name: "eslint"
35
+ - dependency-name: "neostandard"
36
+ - dependency-name: "@stylistic/*"
13
37
  open-pull-requests-limit: 10
38
+ groups:
39
+ # Production dependencies with breaking changes
40
+ dependencies:
41
+ dependency-type: "production"
42
+ # ESLint related dependencies
43
+ dev-dependencies-eslint:
44
+ patterns:
45
+ - "eslint"
46
+ - "neostandard"
47
+ - "@stylistic/*"
48
+ # TypeScript related dependencies
49
+ dev-dependencies-typescript:
50
+ patterns:
51
+ - "@types/*"
52
+ - "tstyche"
53
+ - "typescript"
@@ -23,17 +23,65 @@ permissions:
23
23
  contents: read
24
24
 
25
25
  jobs:
26
+ type-tests:
27
+ name: Type Tests
28
+ runs-on: ubuntu-latest
29
+ strategy:
30
+ matrix:
31
+ node-version: ['20', '22', '24', '26']
32
+ steps:
33
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
34
+ with:
35
+ persist-credentials: false
36
+
37
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
38
+ with:
39
+ node-version: ${{ matrix.node-version }}
40
+ cache: 'npm'
41
+ cache-dependency-path: package.json
42
+ check-latest: true
43
+
44
+ - name: Install dependencies
45
+ run: npm install --ignore-scripts
46
+
47
+ - name: Run type tests
48
+ run: npm run test:typescript
49
+
50
+ unit-tests:
51
+ name: Unit Tests
52
+ runs-on: ubuntu-latest
53
+ strategy:
54
+ matrix:
55
+ node-version: ['16', '18', '20', '22', '24', '26']
56
+ steps:
57
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
58
+ with:
59
+ persist-credentials: false
60
+
61
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
62
+ with:
63
+ node-version: ${{ matrix.node-version }}
64
+ cache: 'npm'
65
+ cache-dependency-path: package.json
66
+ check-latest: true
67
+
68
+ - name: Install dependencies
69
+ run: npm install --ignore-scripts
70
+
71
+ - name: Run unit tests
72
+ run: npm test
73
+
26
74
  test-regression-check-node10:
27
75
  name: Test compatibility with Node.js 10
28
76
  runs-on: ubuntu-latest
29
77
  permissions:
30
78
  contents: read
31
79
  steps:
32
- - uses: actions/checkout@v6
80
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
33
81
  with:
34
82
  persist-credentials: false
35
83
 
36
- - uses: actions/setup-node@v6
84
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
37
85
  with:
38
86
  node-version: '10'
39
87
  cache: 'npm'
@@ -71,11 +119,11 @@ jobs:
71
119
  permissions:
72
120
  contents: read
73
121
  steps:
74
- - uses: actions/checkout@v6
122
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
75
123
  with:
76
124
  persist-credentials: false
77
125
 
78
- - uses: actions/setup-node@v6
126
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
79
127
  with:
80
128
  node-version: '24'
81
129
  cache: 'npm'
@@ -99,8 +147,8 @@ jobs:
99
147
  permissions:
100
148
  contents: write
101
149
  pull-requests: write
102
- uses: fastify/workflows/.github/workflows/plugins-ci.yml@v6
150
+ uses: fastify/workflows/.github/workflows/plugins-ci.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
103
151
  with:
104
152
  license-check: true
105
153
  lint: true
106
- node-versions: '["16", "18", "20", "22", "24"]'
154
+ node-versions: '["16", "18", "20", "22", "24", "26"]'
@@ -16,4 +16,4 @@ jobs:
16
16
  permissions:
17
17
  issues: write
18
18
  pull-requests: write
19
- uses: fastify/workflows/.github/workflows/lock-threads.yml@v6
19
+ uses: fastify/workflows/.github/workflows/lock-threads.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 # v7.0.0
@@ -0,0 +1,45 @@
1
+ name: OSSF Scorecard Analysis
2
+
3
+ # **What it does**: Runs OSSF Scorecard analysis on the repository and uploads the results.
4
+ # **Why we have it**: Security scanning.
5
+
6
+ on:
7
+ branch_protection_rule:
8
+ push:
9
+ branches:
10
+ - main
11
+ paths-ignore:
12
+ - "docs/**"
13
+ - "*.md"
14
+ schedule:
15
+ # ┌───────────── minute (0 - 59)
16
+ # │ ┌───────────── hour (0 - 23)
17
+ # │ │ ┌───────────── day of the month (1 - 31)
18
+ # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
19
+ # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
20
+ # │ │ │ │ │
21
+ # │ │ │ │ │
22
+ # │ │ │ │ │
23
+ # * * * * *
24
+ - cron: "21 17 * * 0"
25
+ # Allows this workflow to be run manually from the Actions tab
26
+ workflow_dispatch:
27
+
28
+ # This allows a subsequently queued workflow run to interrupt previous runs
29
+ concurrency:
30
+ group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
31
+ cancel-in-progress: true
32
+
33
+ permissions:
34
+ contents: read
35
+
36
+ jobs:
37
+ analysis:
38
+ name: OSSF Scorecard Analysis
39
+ permissions:
40
+ contents: read
41
+ id-token: write
42
+ security-events: write
43
+ uses: fastify/workflows/.github/workflows/reusable-ossf-scorecard.yml@ef591e2186785d5ab36b9fe6a79c7ce2f1d94e57 #v7.0.0
44
+ with:
45
+ publish_results: true
@@ -3,6 +3,7 @@
3
3
  [![NPM version](https://img.shields.io/npm/v/fast-uri.svg?style=flat)](https://www.npmjs.com/package/fast-uri)
4
4
  [![CI](https://github.com/fastify/fast-uri/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fast-uri/actions/workflows/ci.yml)
5
5
  [![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
6
+ [![OSSF Scorecard](https://api.scorecard.dev/projects/github.com/fastify/fast-uri/badge)](https://scorecard.dev/viewer/?uri=github.com/fastify/fast-uri)
6
7
 
7
8
  Dependency-free RFC 3986 URI toolbox.
8
9
 
@@ -27,10 +28,10 @@ Malformed authorities and out-of-range ports are reported through the parsed com
27
28
  If set to `true`, the serializer will not resolve a relative `path` component.
28
29
 
29
30
  * `unicodeSupport` (boolean, false)
30
- If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt).
31
+ If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](https://www.ietf.org/rfc/rfc3987.txt).
31
32
 
32
33
  * `domainHost` (boolean, false)
33
- If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt).
34
+ If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](https://www.ietf.org/rfc/rfc5891.txt).
34
35
 
35
36
  ### Parse
36
37
 
@@ -90,14 +91,14 @@ true
90
91
 
91
92
  ## Scheme supports
92
93
 
93
- fast-uri supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme)-dependent processing rules. Currently, fast-uri has built-in support for the following schemes:
94
+ fast-uri supports inserting custom [scheme](https://en.wikipedia.org/wiki/URI_scheme)-dependent processing rules. Currently, fast-uri has built-in support for the following schemes:
94
95
 
95
- * http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\]
96
- * https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\]
97
- * ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
98
- * wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
99
- * urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\]
100
- * urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\]
96
+ * http \[[RFC 2616](https://www.ietf.org/rfc/rfc2616.txt)\]
97
+ * https \[[RFC 2818](https://www.ietf.org/rfc/rfc2818.txt)\]
98
+ * ws \[[RFC 6455](https://www.ietf.org/rfc/rfc6455.txt)\]
99
+ * wss \[[RFC 6455](https://www.ietf.org/rfc/rfc6455.txt)\]
100
+ * urn \[[RFC 2141](https://www.ietf.org/rfc/rfc2141.txt)\]
101
+ * urn:uuid \[[RFC 4122](https://www.ietf.org/rfc/rfc4122.txt)\]
101
102
 
102
103
 
103
104
  ## Benchmarks
@@ -0,0 +1,173 @@
1
+ # Security Policy
2
+
3
+ This document describes the management of vulnerabilities for `fast-uri`, an
4
+ official Fastify project package. It supplements the Fastify project's
5
+ [organization-wide security policy](https://github.com/fastify/.github/blob/main/SECURITY.md).
6
+
7
+ ## Standards and scope
8
+
9
+ `fast-uri` implements URI parsing and normalization according to
10
+ [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986). It does not implement the
11
+ [WHATWG URL Standard](https://url.spec.whatwg.org/).
12
+
13
+ Differences between `fast-uri` and WHATWG URL implementations are expected.
14
+ Reports based solely on comparing or mixing parsers that follow these different
15
+ standards are out of scope. Applications must use the same parsing and
16
+ normalization rules for both security decisions and subsequent URI use.
17
+
18
+ Reports are assessed based on reproducibility, documented supported usage, and
19
+ concrete security impact—not merely on whether they mention WHATWG URL
20
+ behavior. Reports demonstrating a parsing or normalization flaw in a supported
21
+ scheme remain eligible for evaluation.
22
+
23
+ ## Threat model
24
+
25
+ `fast-uri`'s threat model extends the
26
+ [Node.js threat model](https://github.com/nodejs/node/blob/main/SECURITY.md#the-nodejs-threat-model).
27
+
28
+ **Trusted:** Application code, parser options, configuration, and the runtime
29
+ environment.
30
+
31
+ **Untrusted:** URI and IRI strings passed to the package's public APIs.
32
+
33
+ ### Examples of vulnerabilities
34
+
35
+ - RFC 3986 parsing or normalization flaws that bypass security controls
36
+ - Denial of service through malformed input
37
+ - Inconsistent parsing or normalization between `fast-uri` APIs
38
+
39
+ ### Examples of non-vulnerabilities
40
+
41
+ The following are **not** considered vulnerabilities in `fast-uri`:
42
+
43
+ - **Different URL standards:** Differences between RFC 3986 behavior and
44
+ WHATWG URL behavior, including differences exposed by mixing parsers that
45
+ implement those standards
46
+ - **Unsupported scheme semantics:** Scheme-specific behavior for schemes that
47
+ `fast-uri` does not document as supported
48
+ - **Application code vulnerabilities:** Security flaws in code that consumes
49
+ `fast-uri` output
50
+ - **Configuration mistakes:** Security issues caused by incorrect parser
51
+ options or application configuration
52
+ - **Missing security features:** Application-level protections that are not
53
+ part of URI parsing or normalization
54
+ - **Third-party dependencies:** Vulnerabilities in packages used by an
55
+ application alongside `fast-uri`
56
+
57
+ ## Reporting vulnerabilities
58
+
59
+ Individuals who find potential vulnerabilities in `fast-uri` are invited to
60
+ complete a vulnerability report via the
61
+ [GitHub Security page][advisory].
62
+
63
+ Do not assign or request a CVE directly.
64
+ CVE assignment is handled by the Fastify Security Team.
65
+ Fastify falls under the [OpenJS CNA](https://cna.openjsf.org/).
66
+ A CVE will be assigned as part of our responsible disclosure process.
67
+
68
+ > [!NOTE]
69
+ > Fastify's [HackerOne](https://hackerone.com/fastify) program is now closed.
70
+
71
+ [advisory]: ../../security/advisories/new
72
+
73
+ ### Strict measures when reporting vulnerabilities
74
+
75
+ It is of the utmost importance that you read carefully and follow these
76
+ guidelines to ensure the ecosystem as a whole is not disrupted due to
77
+ improperly reported vulnerabilities:
78
+
79
+ - Avoid creating new "informative" reports. Only create a new report if you are
80
+ confident the issue is an actual vulnerability. Third-party vendors and
81
+ individuals track new GitHub security reports and may flag them for their
82
+ customers.
83
+ - Security reports should never be created and triaged by the same person. A
84
+ second Security Team member must triage a report submitted by a team member
85
+ or on their behalf. If in doubt, invite more Fastify collaborators to help
86
+ review the report.
87
+ - **Do not** attempt to demonstrate CI/CD vulnerabilities by creating pull
88
+ requests in Fastify organization repositories. Doing so will result in a
89
+ [content report][content-report] to GitHub as an unsolicited exploit. Create
90
+ a separate repository configured like the affected repository and provide
91
+ the proof of concept there instead.
92
+
93
+ [content-report]: https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam#reporting-an-issue-or-pull-request
94
+
95
+ ### Vulnerabilities found outside this process
96
+
97
+ The Fastify project does not support vulnerability reporting outside the
98
+ process described in this document.
99
+
100
+ ## Handling vulnerability reports
101
+
102
+ When a potential vulnerability is reported, the following actions are taken.
103
+
104
+ ### Triage
105
+
106
+ **Delay:** 4 business days
107
+
108
+ Within 4 business days, a member of the Security Team provides a first response
109
+ to the reporter. The possible responses are:
110
+
111
+ - **Acceptance:** The report is considered a new vulnerability.
112
+ - **Rejection:** The report is not considered a new vulnerability.
113
+ - **Need more information:** The Security Team needs more information to
114
+ evaluate the report.
115
+
116
+ Triaging should include updating these issue fields:
117
+
118
+ - Asset: set or create the module affected by the report
119
+ - Severity: TBD, initially left empty
120
+
121
+ ### Correction follow-up
122
+
123
+ **Delay:** 90 days
124
+
125
+ When a vulnerability is confirmed, a member of the Security Team volunteers to
126
+ follow up on the report.
127
+
128
+ With the reporter's help, they contact the maintainers of the vulnerable
129
+ package and may invite them as participants in the report. Together, they
130
+ define a publication date. Ideally, publication should not happen before the
131
+ package has been patched.
132
+
133
+ The report's vulnerable-version upper limit should be set to:
134
+
135
+ - `*` if no fixed version is available when the report is published
136
+ - the last vulnerable version, such as `<=1.2.3`, if the fix is released in
137
+ `1.2.4`
138
+
139
+ ### Publication
140
+
141
+ **Delay:** 90 days
142
+
143
+ Within 90 days after triage, the vulnerability must be made public.
144
+
145
+ Vulnerability severity is assessed using
146
+ [CVSS v3](https://www.first.org/cvss/user-guide).
147
+
148
+ If package maintainers are actively developing a patch, the Security Team and
149
+ the reporter may approve an additional delay.
150
+
151
+ ### Secondary contact
152
+
153
+ If you do not receive an acknowledgment within 6 business days, or cannot find
154
+ a private security contact, contact the OpenJS Foundation CNA at
155
+ <https://cna.openjsf.org/> or `security@lists.openjsf.org` for assistance.
156
+
157
+ The CNA can help ensure that reports are acknowledged, coordinate disclosure
158
+ timelines, and assign CVEs when necessary.
159
+
160
+ ## The Fastify Security Team
161
+
162
+ The core team manages the security program, policy, and process.
163
+
164
+ Team members must keep all privileged information private. This includes the
165
+ existence of undisclosed issues, expected release dates, and upcoming patches.
166
+
167
+ ### Members
168
+
169
+ - [Matteo Collina](https://github.com/mcollina)
170
+ - [Tomas Della Vedova](https://github.com/delvedor)
171
+ - [Vincent Le Goff](https://github.com/zekth)
172
+ - [KaKa Ng](https://github.com/climba03003)
173
+ - [James Sumners](https://github.com/jsumners)
@@ -10,6 +10,21 @@ const ipv6 = '//[2001:db8::7]'
10
10
  const urn = 'urn:foo:a123,456'
11
11
  const urnuuid = 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
12
12
 
13
+ const mailtoSimple = 'mailto:chris@example.com'
14
+ const mailtoWithSubject = 'mailto:infobot@example.com?subject=current-issue'
15
+ const mailtoWithBody = 'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index'
16
+ const mailtoWithHeaders = 'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E'
17
+ const mailtoMultiple = 'mailto:joe@example.com,alice@example.org?subject=Test&body=NATTO'
18
+ const mailtoEncoded = 'mailto:%22oh%5C%5Cno%22@example.org'
19
+
20
+ const mailtoComponent = {
21
+ scheme: 'mailto',
22
+ to: ['chris@example.com'],
23
+ subject: 'current-issue',
24
+ body: 'send current-issue\r\nsend index',
25
+ headers: { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' }
26
+ }
27
+
13
28
  const urnuuidComponent = {
14
29
  scheme: 'urn',
15
30
  nid: 'uuid',
@@ -146,6 +161,62 @@ benchUriJs.add('urijs: equal', function () {
146
161
  uriJsEqual('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d')
147
162
  })
148
163
 
164
+ benchFastUri.add('fast-uri: parse mailto simple', function () {
165
+ fastUriParse(mailtoSimple)
166
+ })
167
+ benchUriJs.add('urijs: parse mailto simple', function () {
168
+ uriJsParse(mailtoSimple)
169
+ })
170
+
171
+ benchFastUri.add('fast-uri: parse mailto subject', function () {
172
+ fastUriParse(mailtoWithSubject)
173
+ })
174
+ benchUriJs.add('urijs: parse mailto subject', function () {
175
+ uriJsParse(mailtoWithSubject)
176
+ })
177
+
178
+ benchFastUri.add('fast-uri: parse mailto body CRLF', function () {
179
+ fastUriParse(mailtoWithBody)
180
+ })
181
+ benchUriJs.add('urijs: parse mailto body CRLF', function () {
182
+ uriJsParse(mailtoWithBody)
183
+ })
184
+
185
+ benchFastUri.add('fast-uri: parse mailto headers', function () {
186
+ fastUriParse(mailtoWithHeaders)
187
+ })
188
+ benchUriJs.add('urijs: parse mailto headers', function () {
189
+ uriJsParse(mailtoWithHeaders)
190
+ })
191
+
192
+ benchFastUri.add('fast-uri: parse mailto multi recipient', function () {
193
+ fastUriParse(mailtoMultiple)
194
+ })
195
+ benchUriJs.add('urijs: parse mailto multi recipient', function () {
196
+ uriJsParse(mailtoMultiple)
197
+ })
198
+
199
+ benchFastUri.add('fast-uri: parse mailto encoded local', function () {
200
+ fastUriParse(mailtoEncoded)
201
+ })
202
+ benchUriJs.add('urijs: parse mailto encoded local', function () {
203
+ uriJsParse(mailtoEncoded)
204
+ })
205
+
206
+ benchFastUri.add('fast-uri: serialize mailto', function () {
207
+ fastUriSerialize(mailtoComponent)
208
+ })
209
+ benchUriJs.add('urijs: serialize mailto', function () {
210
+ uriJsSerialize(mailtoComponent)
211
+ })
212
+
213
+ benchFastUri.add('fast-uri: serialize+parse mailto round-trip', function () {
214
+ fastUriSerialize(fastUriParse(mailtoWithBody))
215
+ })
216
+ benchUriJs.add('urijs: serialize+parse mailto round-trip', function () {
217
+ uriJsSerialize(uriJsParse(mailtoWithBody))
218
+ })
219
+
149
220
  await benchFastUri.run()
150
221
  console.log(benchFastUri.name)
151
222
  console.table(benchFastUri.table())
@@ -0,0 +1,54 @@
1
+ import { Bench } from 'tinybench'
2
+ import { fastUri } from '../index.js'
3
+
4
+ const { serialize, normalize, parse } = fastUri
5
+
6
+ const asciiPath = '/users/profile/settings/account'
7
+ const asciiPathWithSpaces = '/users/john doe/profile page'
8
+ const cjkPath = '/ユーザー/プロフィール/設定'
9
+ const mixedPath = '/users/日本/profile-📱-emoji/設定'
10
+ const emojiPath = '/🚀/🌍/🎉/end'
11
+ const longAsciiPath = '/' + 'a/b/c/d/e/f/g/h/'.repeat(20)
12
+ const longUtf8Path = '/' + '日本/中文/한국/'.repeat(20)
13
+
14
+ const bench = new Bench({ name: 'encoder bench', time: 1000 })
15
+
16
+ bench.add('serialize ascii path', () => {
17
+ serialize({ scheme: 'http', host: 'example.com', path: asciiPath })
18
+ })
19
+
20
+ bench.add('serialize ascii path with spaces', () => {
21
+ serialize({ scheme: 'http', host: 'example.com', path: asciiPathWithSpaces })
22
+ })
23
+
24
+ bench.add('serialize cjk path', () => {
25
+ serialize({ scheme: 'http', host: 'example.com', path: cjkPath })
26
+ })
27
+
28
+ bench.add('serialize mixed path', () => {
29
+ serialize({ scheme: 'http', host: 'example.com', path: mixedPath })
30
+ })
31
+
32
+ bench.add('serialize emoji path', () => {
33
+ serialize({ scheme: 'http', host: 'example.com', path: emojiPath })
34
+ })
35
+
36
+ bench.add('serialize long ascii path', () => {
37
+ serialize({ scheme: 'http', host: 'example.com', path: longAsciiPath })
38
+ })
39
+
40
+ bench.add('serialize long utf8 path', () => {
41
+ serialize({ scheme: 'http', host: 'example.com', path: longUtf8Path })
42
+ })
43
+
44
+ bench.add('normalize utf8 uri', () => {
45
+ normalize('http://example.com/日本/profile')
46
+ })
47
+
48
+ bench.add('parse utf8 uri', () => {
49
+ parse('http://example.com/日本/profile')
50
+ })
51
+
52
+ await bench.run()
53
+ console.log(bench.name)
54
+ console.table(bench.table())