cdk-common 2.0.1260 → 2.0.1262
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.
- package/.jsii +2 -2
- package/lib/main.js +1 -1
- package/node_modules/fast-uri/.github/workflows/ci.yml +45 -2
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +5 -1
- package/node_modules/fast-uri/LICENSE +3 -1
- package/node_modules/fast-uri/README.md +37 -24
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/index.js +95 -58
- package/node_modules/fast-uri/lib/schemes.js +160 -81
- package/node_modules/fast-uri/lib/utils.js +214 -122
- package/node_modules/fast-uri/package.json +7 -6
- package/node_modules/fast-uri/test/ajv.test.js +7 -3
- package/node_modules/fast-uri/test/equal.test.js +7 -2
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +31 -31
- package/node_modules/fast-uri/test/resolve.test.js +52 -49
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/serialize.test.js +55 -47
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +230 -230
- package/node_modules/fast-uri/test/util.test.js +23 -8
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +7 -0
- package/package.json +1 -1
- package/node_modules/fast-uri/benchmark.js +0 -105
- package/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/node_modules/fast-uri/test/.gitkeep +0 -0
- package/node_modules/fast-uri/test/compatibility.test.js +0 -131
package/.jsii
CHANGED
|
@@ -12390,6 +12390,6 @@
|
|
|
12390
12390
|
"symbolId": "src/main:LambdaArmFunctionProps"
|
|
12391
12391
|
}
|
|
12392
12392
|
},
|
|
12393
|
-
"version": "2.0.
|
|
12394
|
-
"fingerprint": "
|
|
12393
|
+
"version": "2.0.1262",
|
|
12394
|
+
"fingerprint": "2USx+NjS80bQ0olfKWnuH2/EHj0T17KsBDV/R98yE68="
|
|
12395
12395
|
}
|
package/lib/main.js
CHANGED
|
@@ -38,5 +38,5 @@ class LambdaArmFunction extends constructs_1.Construct {
|
|
|
38
38
|
}
|
|
39
39
|
exports.LambdaArmFunction = LambdaArmFunction;
|
|
40
40
|
_a = JSII_RTTI_SYMBOL_1;
|
|
41
|
-
LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.
|
|
41
|
+
LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.1262" };
|
|
42
42
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbUNBQW1DO0FBQ25DLGlEQUFpRDtBQUNqRCwyQ0FBdUM7QUFLdkMsTUFBYSxpQkFBa0IsU0FBUSxzQkFBUztJQUU5QyxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLEtBQTRCO1FBQ3BFLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFakIsTUFBTSxlQUFlLEdBQUcsSUFBSSxHQUFHLENBQXlCO1lBQ3RELENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsbUNBQW1DLENBQUM7WUFDakUsQ0FBQyxNQUFNLEN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vbnN0IHdhcm5pbmcgPSBydW50aW1lV2FybmluZ3MuZ2V0KHByb3BzLnJ1bnRpbWUpO1xuICAgIGlmICh3YXJuaW5nKSB7XG4gICAgICBjZGsuQW5ub3RhdGlvbnMub2YodGhpcykuYWRkV2FybmluZyh3YXJuaW5nKTtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIFJ1bnRpbWUgJHtwcm9wcy5ydW50aW1lfSBhdCBBUk0sIFNlZSBodHRwczovL2RvY3MuYXdzLmFtYXpvbi5jb20vbGFtYmRhL2xhdGVzdC9kZy9mb3VuZGF0aW9uLWFyY2guaHRtbD9pY21waWQ9ZG9jc19sYW1iZGFfcnNzYCk7XG4gICAgfVxuXG4gICAgdGhpcy5sYW1iZGFGdW5jdGlvbiA9IG5ldyBsYW1iZGEuRnVuY3Rpb24odGhpcywgJ0xhbWJkYUZ1bmN0aW9uJywge1xuICAgICAgYXJjaGl0ZWN0dXJlOiBwcm9wcy5hcmNoaXRlY3R1cmUgPz8gbGFtYmRhLkFyY2hpdGVjdHVyZS5BUk1fNjQsXG4gICAgICAuLi5wcm9wcyxcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -4,7 +4,6 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
-
- master
|
|
8
7
|
- next
|
|
9
8
|
- 'v*'
|
|
10
9
|
paths-ignore:
|
|
@@ -15,10 +14,15 @@ on:
|
|
|
15
14
|
- 'docs/**'
|
|
16
15
|
- '*.md'
|
|
17
16
|
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
18
20
|
jobs:
|
|
19
21
|
test-regression-check-node10:
|
|
20
22
|
name: Test compatibility with Node.js 10
|
|
21
23
|
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
22
26
|
steps:
|
|
23
27
|
- uses: actions/checkout@v4
|
|
24
28
|
with:
|
|
@@ -48,11 +52,50 @@ jobs:
|
|
|
48
52
|
env:
|
|
49
53
|
NODE_OPTIONS: no-network-family-autoselection
|
|
50
54
|
|
|
55
|
+
test-browser:
|
|
56
|
+
name: Test browser compatibility
|
|
57
|
+
runs-on: ${{ matrix.os }}
|
|
58
|
+
strategy:
|
|
59
|
+
fail-fast: false
|
|
60
|
+
matrix:
|
|
61
|
+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
|
62
|
+
browser: ['chromium', 'firefox', 'webkit']
|
|
63
|
+
exclude:
|
|
64
|
+
- os: ubuntu-latest
|
|
65
|
+
browser: webkit
|
|
66
|
+
permissions:
|
|
67
|
+
contents: read
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v4
|
|
70
|
+
with:
|
|
71
|
+
persist-credentials: false
|
|
72
|
+
|
|
73
|
+
- uses: actions/setup-node@v4
|
|
74
|
+
with:
|
|
75
|
+
node-version: '24'
|
|
76
|
+
cache: 'npm'
|
|
77
|
+
cache-dependency-path: package.json
|
|
78
|
+
check-latest: true
|
|
79
|
+
|
|
80
|
+
- name: Install dependencies
|
|
81
|
+
run: |
|
|
82
|
+
npm install --ignore-scripts
|
|
83
|
+
|
|
84
|
+
- if: ${{ matrix.os == 'windows-latest' }}
|
|
85
|
+
run: npx playwright install winldd
|
|
86
|
+
|
|
87
|
+
- name: Run browser tests
|
|
88
|
+
run: |
|
|
89
|
+
npm run test:browser:${{ matrix.browser }}
|
|
90
|
+
|
|
51
91
|
test:
|
|
52
92
|
needs:
|
|
53
93
|
- test-regression-check-node10
|
|
94
|
+
permissions:
|
|
95
|
+
contents: write
|
|
96
|
+
pull-requests: write
|
|
54
97
|
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
|
|
55
98
|
with:
|
|
56
99
|
license-check: true
|
|
57
100
|
lint: true
|
|
58
|
-
node-versions: '["16", "18", "20", "22"]'
|
|
101
|
+
node-versions: '["16", "18", "20", "22", "24"]'
|
|
@@ -4,7 +4,6 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
-
- master
|
|
8
7
|
- next
|
|
9
8
|
- 'v*'
|
|
10
9
|
paths-ignore:
|
|
@@ -15,6 +14,11 @@ on:
|
|
|
15
14
|
- 'docs/**'
|
|
16
15
|
- '*.md'
|
|
17
16
|
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
18
20
|
jobs:
|
|
19
21
|
test:
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
20
24
|
uses: fastify/workflows/.github/workflows/plugins-ci-package-manager.yml@v5
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
Copyright (c) 2021 The Fastify Team
|
|
2
1
|
Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
|
|
2
|
+
Copyright (c) 2021-present The Fastify team
|
|
3
3
|
All rights reserved.
|
|
4
4
|
|
|
5
|
+
The Fastify team members are listed at https://github.com/fastify/fastify#team.
|
|
6
|
+
|
|
5
7
|
Redistribution and use in source and binary forms, with or without
|
|
6
8
|
modification, are permitted provided that the following conditions are met:
|
|
7
9
|
* Redistributions of source code must retain the above copyright
|
|
@@ -94,36 +94,49 @@ fast-uri supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_sch
|
|
|
94
94
|
## Benchmarks
|
|
95
95
|
|
|
96
96
|
```
|
|
97
|
-
fast-uri
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
fast-uri: parse IPv6
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
fast-uri:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
fast-uri:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
urijs:
|
|
118
|
-
|
|
119
|
-
urijs:
|
|
97
|
+
fast-uri benchmark
|
|
98
|
+
┌─────────┬──────────────────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
|
|
99
|
+
│ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
|
|
100
|
+
├─────────┼──────────────────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
|
|
101
|
+
│ 0 │ 'fast-uri: parse domain' │ '951.31 ± 0.75%' │ '875.00 ± 11.00' │ '1122538 ± 0.01%' │ '1142857 ± 14550' │ 1051187 │
|
|
102
|
+
│ 1 │ 'fast-uri: parse IPv4' │ '443.44 ± 0.22%' │ '406.00 ± 3.00' │ '2422762 ± 0.01%' │ '2463054 ± 18335' │ 2255105 │
|
|
103
|
+
│ 2 │ 'fast-uri: parse IPv6' │ '1241.6 ± 1.74%' │ '1131.0 ± 30.00' │ '875177 ± 0.02%' │ '884173 ± 24092' │ 805399 │
|
|
104
|
+
│ 3 │ 'fast-uri: parse URN' │ '689.19 ± 4.29%' │ '618.00 ± 9.00' │ '1598373 ± 0.01%' │ '1618123 ± 23913' │ 1450972 │
|
|
105
|
+
│ 4 │ 'fast-uri: parse URN uuid' │ '1025.4 ± 2.02%' │ '921.00 ± 19.00' │ '1072419 ± 0.02%' │ '1085776 ± 22871' │ 975236 │
|
|
106
|
+
│ 5 │ 'fast-uri: serialize uri' │ '1028.5 ± 0.53%' │ '933.00 ± 43.00' │ '1063310 ± 0.02%' │ '1071811 ± 50523' │ 972249 │
|
|
107
|
+
│ 6 │ 'fast-uri: serialize long uri with dots' │ '1805.1 ± 0.52%' │ '1627.0 ± 17.00' │ '602620 ± 0.02%' │ '614628 ± 6490' │ 553997 │
|
|
108
|
+
│ 7 │ 'fast-uri: serialize IPv6' │ '2569.4 ± 2.69%' │ '2302.0 ± 21.00' │ '426080 ± 0.03%' │ '434405 ± 3999' │ 389194 │
|
|
109
|
+
│ 8 │ 'fast-uri: serialize ws' │ '979.39 ± 0.43%' │ '882.00 ± 8.00' │ '1111665 ± 0.02%' │ '1133787 ± 10378' │ 1021045 │
|
|
110
|
+
│ 9 │ 'fast-uri: resolve' │ '2208.2 ± 1.08%' │ '1980.0 ± 24.00' │ '495001 ± 0.03%' │ '505051 ± 6049' │ 452848 │
|
|
111
|
+
└─────────┴──────────────────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
|
|
112
|
+
uri-js benchmark
|
|
113
|
+
┌─────────┬───────────────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
|
|
114
|
+
│ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
|
|
115
|
+
├─────────┼───────────────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
|
|
116
|
+
│ 0 │ 'urijs: parse domain' │ '3618.3 ± 0.43%' │ '3314.0 ± 33.00' │ '294875 ± 0.04%' │ '301750 ± 2975' │ 276375 │
|
|
117
|
+
│ 1 │ 'urijs: parse IPv4' │ '4024.1 ± 0.41%' │ '3751.0 ± 25.00' │ '261981 ± 0.04%' │ '266596 ± 1789' │ 248506 │
|
|
118
|
+
│ 2 │ 'urijs: parse IPv6' │ '5417.2 ± 0.46%' │ '4968.0 ± 43.00' │ '196023 ± 0.05%' │ '201288 ± 1727' │ 184598 │
|
|
119
|
+
│ 3 │ 'urijs: parse URN' │ '1324.2 ± 0.23%' │ '1229.0 ± 17.00' │ '801535 ± 0.02%' │ '813670 ± 11413' │ 755185 │
|
|
120
|
+
│ 4 │ 'urijs: parse URN uuid' │ '1822.0 ± 3.08%' │ '1655.0 ± 15.00' │ '594433 ± 0.02%' │ '604230 ± 5427' │ 548843 │
|
|
121
|
+
│ 5 │ 'urijs: serialize uri' │ '4196.8 ± 0.36%' │ '3908.0 ± 27.00' │ '251146 ± 0.04%' │ '255885 ± 1756' │ 238276 │
|
|
122
|
+
│ 6 │ 'urijs: serialize long uri with dots' │ '8331.0 ± 1.30%' │ '7658.0 ± 72.00' │ '126440 ± 0.07%' │ '130582 ± 1239' │ 120034 │
|
|
123
|
+
│ 7 │ 'urijs: serialize IPv6' │ '5685.5 ± 0.30%' │ '5366.0 ± 33.00' │ '182632 ± 0.05%' │ '186359 ± 1153' │ 175886 │
|
|
124
|
+
│ 8 │ 'urijs: serialize ws' │ '4159.3 ± 0.20%' │ '3899.0 ± 28.00' │ '250459 ± 0.04%' │ '256476 ± 1855' │ 240423 │
|
|
125
|
+
│ 9 │ 'urijs: resolve' │ '6729.9 ± 0.39%' │ '6261.0 ± 37.00' │ '156361 ± 0.06%' │ '159719 ± 949' │ 148591 │
|
|
126
|
+
└─────────┴───────────────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
|
|
127
|
+
WHATWG URL benchmark
|
|
128
|
+
┌─────────┬────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
|
|
129
|
+
│ (index) │ Task name │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
|
|
130
|
+
├─────────┼────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
|
|
131
|
+
│ 0 │ 'WHATWG URL: parse domain' │ '475.22 ± 0.20%' │ '444.00 ± 5.00' │ '2217599 ± 0.01%' │ '2252252 ± 25652' │ 2104289 │
|
|
132
|
+
│ 1 │ 'WHATWG URL: parse URN' │ '384.78 ± 0.85%' │ '350.00 ± 5.00' │ '2809071 ± 0.01%' │ '2857143 ± 41408' │ 2598885 │
|
|
133
|
+
└─────────┴────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
|
|
120
134
|
```
|
|
121
135
|
|
|
122
136
|
## TODO
|
|
123
137
|
|
|
124
138
|
- [ ] Support MailTo
|
|
125
139
|
- [ ] Be 100% iso compatible with uri-js
|
|
126
|
-
- [ ] Add browser test stack
|
|
127
140
|
|
|
128
141
|
## License
|
|
129
142
|
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Bench } from 'tinybench'
|
|
2
|
+
import { fastUri } from '../index.js'
|
|
3
|
+
import { parse as uriJsParse, serialize as uriJsSerialize, resolve as uriJsResolve, equal as uriJsEqual } from 'uri-js'
|
|
4
|
+
|
|
5
|
+
const base = 'uri://a/b/c/d;p?q'
|
|
6
|
+
|
|
7
|
+
const domain = 'https://example.com/foo#bar$fiz'
|
|
8
|
+
const ipv4 = '//10.10.10.10'
|
|
9
|
+
const ipv6 = '//[2001:db8::7]'
|
|
10
|
+
const urn = 'urn:foo:a123,456'
|
|
11
|
+
const urnuuid = 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
|
|
12
|
+
|
|
13
|
+
const urnuuidComponent = {
|
|
14
|
+
scheme: 'urn',
|
|
15
|
+
nid: 'uuid',
|
|
16
|
+
uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
parse: fastUriParse,
|
|
21
|
+
serialize: fastUriSerialize,
|
|
22
|
+
resolve: fastUriResolve,
|
|
23
|
+
equal: fastUriEqual,
|
|
24
|
+
} = fastUri
|
|
25
|
+
|
|
26
|
+
// Initialization as there is a lot to parse at first
|
|
27
|
+
// eg: regexes
|
|
28
|
+
fastUriParse(domain)
|
|
29
|
+
uriJsParse(domain)
|
|
30
|
+
|
|
31
|
+
const benchFastUri = new Bench({ name: 'fast-uri benchmark' })
|
|
32
|
+
const benchUriJs = new Bench({ name: 'uri-js benchmark' })
|
|
33
|
+
const benchWHATWG = new Bench({ name: 'WHATWG URL benchmark' })
|
|
34
|
+
|
|
35
|
+
benchFastUri.add('fast-uri: parse domain', function () {
|
|
36
|
+
fastUriParse(domain)
|
|
37
|
+
})
|
|
38
|
+
benchUriJs.add('urijs: parse domain', function () {
|
|
39
|
+
uriJsParse(domain)
|
|
40
|
+
})
|
|
41
|
+
benchWHATWG.add('WHATWG URL: parse domain', function () {
|
|
42
|
+
// eslint-disable-next-line
|
|
43
|
+
new URL(domain)
|
|
44
|
+
})
|
|
45
|
+
benchFastUri.add('fast-uri: parse IPv4', function () {
|
|
46
|
+
fastUriParse(ipv4)
|
|
47
|
+
})
|
|
48
|
+
benchUriJs.add('urijs: parse IPv4', function () {
|
|
49
|
+
uriJsParse(ipv4)
|
|
50
|
+
})
|
|
51
|
+
benchFastUri.add('fast-uri: parse IPv6', function () {
|
|
52
|
+
fastUriParse(ipv6)
|
|
53
|
+
})
|
|
54
|
+
benchUriJs.add('urijs: parse IPv6', function () {
|
|
55
|
+
uriJsParse(ipv6)
|
|
56
|
+
})
|
|
57
|
+
benchFastUri.add('fast-uri: parse URN', function () {
|
|
58
|
+
fastUriParse(urn)
|
|
59
|
+
})
|
|
60
|
+
benchUriJs.add('urijs: parse URN', function () {
|
|
61
|
+
uriJsParse(urn)
|
|
62
|
+
})
|
|
63
|
+
benchWHATWG.add('WHATWG URL: parse URN', function () {
|
|
64
|
+
// eslint-disable-next-line
|
|
65
|
+
new URL(urn)
|
|
66
|
+
})
|
|
67
|
+
benchFastUri.add('fast-uri: parse URN uuid', function () {
|
|
68
|
+
fastUriParse(urnuuid)
|
|
69
|
+
})
|
|
70
|
+
benchUriJs.add('urijs: parse URN uuid', function () {
|
|
71
|
+
uriJsParse(urnuuid)
|
|
72
|
+
})
|
|
73
|
+
benchFastUri.add('fast-uri: serialize URN uuid', function () {
|
|
74
|
+
fastUriSerialize(urnuuidComponent)
|
|
75
|
+
})
|
|
76
|
+
benchUriJs.add('uri-js: serialize URN uuid', function () {
|
|
77
|
+
uriJsSerialize(urnuuidComponent)
|
|
78
|
+
})
|
|
79
|
+
benchFastUri.add('fast-uri: serialize uri', function () {
|
|
80
|
+
fastUriSerialize({
|
|
81
|
+
scheme: 'uri',
|
|
82
|
+
userinfo: 'foo:bar',
|
|
83
|
+
host: 'example.com',
|
|
84
|
+
port: 1,
|
|
85
|
+
path: 'path',
|
|
86
|
+
query: 'query',
|
|
87
|
+
fragment: 'fragment'
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
benchUriJs.add('urijs: serialize uri', function () {
|
|
91
|
+
uriJsSerialize({
|
|
92
|
+
scheme: 'uri',
|
|
93
|
+
userinfo: 'foo:bar',
|
|
94
|
+
host: 'example.com',
|
|
95
|
+
port: 1,
|
|
96
|
+
path: 'path',
|
|
97
|
+
query: 'query',
|
|
98
|
+
fragment: 'fragment'
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
benchFastUri.add('fast-uri: serialize long uri with dots', function () {
|
|
102
|
+
fastUriSerialize({
|
|
103
|
+
scheme: 'uri',
|
|
104
|
+
userinfo: 'foo:bar',
|
|
105
|
+
host: 'example.com',
|
|
106
|
+
port: 1,
|
|
107
|
+
path: './a/./b/c/../.././d/../e/f/.././/',
|
|
108
|
+
query: 'query',
|
|
109
|
+
fragment: 'fragment'
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
benchUriJs.add('urijs: serialize long uri with dots', function () {
|
|
113
|
+
uriJsSerialize({
|
|
114
|
+
scheme: 'uri',
|
|
115
|
+
userinfo: 'foo:bar',
|
|
116
|
+
host: 'example.com',
|
|
117
|
+
port: 1,
|
|
118
|
+
path: './a/./b/c/../.././d/../e/f/.././/',
|
|
119
|
+
query: 'query',
|
|
120
|
+
fragment: 'fragment'
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
benchFastUri.add('fast-uri: serialize IPv6', function () {
|
|
124
|
+
fastUriSerialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
|
|
125
|
+
})
|
|
126
|
+
benchUriJs.add('urijs: serialize IPv6', function () {
|
|
127
|
+
uriJsSerialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
|
|
128
|
+
})
|
|
129
|
+
benchFastUri.add('fast-uri: serialize ws', function () {
|
|
130
|
+
fastUriSerialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
|
|
131
|
+
})
|
|
132
|
+
benchUriJs.add('urijs: serialize ws', function () {
|
|
133
|
+
uriJsSerialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
|
|
134
|
+
})
|
|
135
|
+
benchFastUri.add('fast-uri: resolve', function () {
|
|
136
|
+
fastUriResolve(base, '../../../g')
|
|
137
|
+
})
|
|
138
|
+
benchUriJs.add('urijs: resolve', function () {
|
|
139
|
+
uriJsResolve(base, '../../../g')
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
benchFastUri.add('fast-uri: equal', function () {
|
|
143
|
+
fastUriEqual('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d')
|
|
144
|
+
})
|
|
145
|
+
benchUriJs.add('urijs: equal', function () {
|
|
146
|
+
uriJsEqual('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d')
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
await benchFastUri.run()
|
|
150
|
+
console.log(benchFastUri.name)
|
|
151
|
+
console.table(benchFastUri.table())
|
|
152
|
+
|
|
153
|
+
await benchUriJs.run()
|
|
154
|
+
console.log(benchUriJs.name)
|
|
155
|
+
console.table(benchUriJs.table())
|
|
156
|
+
|
|
157
|
+
await benchWHATWG.run()
|
|
158
|
+
console.log(benchWHATWG.name)
|
|
159
|
+
console.table(benchWHATWG.table())
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Bench } from 'tinybench'
|
|
2
|
+
import { fastUri } from '../index.js'
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
equal: fastUriEqual,
|
|
6
|
+
parse: fastUriParse,
|
|
7
|
+
} = fastUri
|
|
8
|
+
|
|
9
|
+
const stringA = 'example://a/b/c/%7Bfoo%7D'
|
|
10
|
+
const stringB = 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'
|
|
11
|
+
|
|
12
|
+
const componentA = fastUriParse(stringA)
|
|
13
|
+
const componentB = fastUriParse(stringB)
|
|
14
|
+
|
|
15
|
+
const benchFastUri = new Bench({ name: 'fast-uri equal' })
|
|
16
|
+
|
|
17
|
+
benchFastUri.add('equal string with string', function () {
|
|
18
|
+
fastUriEqual(stringA, stringA)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
benchFastUri.add('equal component with component', function () {
|
|
22
|
+
fastUriEqual(componentA, componentA)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
benchFastUri.add('equal component with string', function () {
|
|
26
|
+
fastUriEqual(componentA, stringA)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
benchFastUri.add('equal string with component', function () {
|
|
30
|
+
fastUriEqual(stringA, componentA)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
benchFastUri.add('not equal string with string', function () {
|
|
34
|
+
fastUriEqual(stringA, stringB)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
benchFastUri.add('not equal component with component', function () {
|
|
38
|
+
fastUriEqual(componentA, componentB)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
benchFastUri.add('not equal component with string', function () {
|
|
42
|
+
fastUriEqual(componentA, stringB)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
benchFastUri.add('not equal string with component', function () {
|
|
46
|
+
fastUriEqual(stringA, componentB)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
await benchFastUri.run()
|
|
50
|
+
console.log(benchFastUri.name)
|
|
51
|
+
console.table(benchFastUri.table())
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Bench } from 'tinybench'
|
|
2
|
+
import { nonSimpleDomain } from '../lib/utils.js'
|
|
3
|
+
|
|
4
|
+
const benchNonSimpleDomain = new Bench({ name: 'nonSimpleDomain' })
|
|
5
|
+
|
|
6
|
+
const exampleCom = 'example.com'
|
|
7
|
+
const exaumlmpleCom = 'exämple.com'
|
|
8
|
+
const longDomain = 'abc'.repeat(100) + '.com'
|
|
9
|
+
|
|
10
|
+
console.assert(nonSimpleDomain(exampleCom) === false, 'example.com should be a simple domain')
|
|
11
|
+
console.assert(nonSimpleDomain(exaumlmpleCom) === true, 'exämple.com should not be a simple domain')
|
|
12
|
+
console.assert(nonSimpleDomain(longDomain) === false, `${longDomain} should be a simple domain?`)
|
|
13
|
+
|
|
14
|
+
benchNonSimpleDomain.add('nonSimpleDomain', function () {
|
|
15
|
+
nonSimpleDomain(exampleCom)
|
|
16
|
+
nonSimpleDomain(exaumlmpleCom)
|
|
17
|
+
nonSimpleDomain(longDomain)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
await benchNonSimpleDomain.run()
|
|
21
|
+
console.log(benchNonSimpleDomain.name)
|
|
22
|
+
console.table(benchNonSimpleDomain.table())
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "benchmark",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"private": true,
|
|
7
|
+
"scripts": {
|
|
8
|
+
"bench": "node benchmark.mjs"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"tinybench": "^5.0.0",
|
|
15
|
+
"uri-js": "^4.4.1"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Bench } from 'tinybench'
|
|
2
|
+
import { stringArrayToHexStripped } from '../lib/utils.js'
|
|
3
|
+
|
|
4
|
+
const benchStringArrayToHexStripped = new Bench({ name: 'stringArrayToHexStripped' })
|
|
5
|
+
|
|
6
|
+
const case1 = ['0', '0', '0', '0']
|
|
7
|
+
const case2 = ['0', '0', '0', '1']
|
|
8
|
+
const case3 = ['0', '0', '1', '0']
|
|
9
|
+
const case4 = ['0', '1', '0', '0']
|
|
10
|
+
const case5 = ['1', '0', '0', '0']
|
|
11
|
+
const case6 = ['1', '0', '0', '1']
|
|
12
|
+
|
|
13
|
+
benchStringArrayToHexStripped.add('stringArrayToHexStripped', function () {
|
|
14
|
+
stringArrayToHexStripped(case1)
|
|
15
|
+
stringArrayToHexStripped(case2)
|
|
16
|
+
stringArrayToHexStripped(case3)
|
|
17
|
+
stringArrayToHexStripped(case4)
|
|
18
|
+
stringArrayToHexStripped(case5)
|
|
19
|
+
stringArrayToHexStripped(case6)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
await benchStringArrayToHexStripped.run()
|
|
23
|
+
console.log(benchStringArrayToHexStripped.name)
|
|
24
|
+
console.table(benchStringArrayToHexStripped.table())
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Bench } from 'tinybench'
|
|
2
|
+
import { wsIsSecure } from '../lib/schemes.js'
|
|
3
|
+
|
|
4
|
+
const benchWsIsSecure = new Bench({ name: 'wsIsSecure' })
|
|
5
|
+
|
|
6
|
+
const wsComponentAttributeSecureTrue = {
|
|
7
|
+
scheme: 'ws',
|
|
8
|
+
secure: true,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const wsComponentAttributeSecureFalse = {
|
|
12
|
+
scheme: 'ws',
|
|
13
|
+
secure: false,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const wssComponent = {
|
|
17
|
+
scheme: 'wss',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const wssComponentMixedCase = {
|
|
21
|
+
scheme: 'Wss',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const wssComponentUpperCase = {
|
|
25
|
+
scheme: 'WSS',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const httpComponent = {
|
|
29
|
+
scheme: 'http',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.assert(wsIsSecure(wsComponentAttributeSecureTrue) === true, 'wsComponentAttributeSecureTrue should be secure')
|
|
33
|
+
console.assert(wsIsSecure(wsComponentAttributeSecureFalse) === false, 'wsComponentAttributeSecureFalse should not be secure')
|
|
34
|
+
console.assert(wsIsSecure(wssComponent) === true, 'wssComponent should be secure')
|
|
35
|
+
console.assert(wsIsSecure(wssComponentMixedCase) === true, 'wssComponentMixedCase should be secure')
|
|
36
|
+
console.assert(wsIsSecure(wssComponentUpperCase) === true, 'wssComponentUpperCase should be secure')
|
|
37
|
+
console.assert(wsIsSecure(httpComponent) === false, 'httpComponent should not be secure')
|
|
38
|
+
|
|
39
|
+
benchWsIsSecure.add(JSON.stringify(wsComponentAttributeSecureFalse), function () {
|
|
40
|
+
wsIsSecure(wsComponentAttributeSecureFalse)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
benchWsIsSecure.add(JSON.stringify(wsComponentAttributeSecureTrue), function () {
|
|
44
|
+
wsIsSecure(wsComponentAttributeSecureTrue)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
benchWsIsSecure.add(JSON.stringify(wssComponent), function () {
|
|
48
|
+
wsIsSecure(wssComponent)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
benchWsIsSecure.add(JSON.stringify(wssComponentMixedCase), function () {
|
|
52
|
+
wsIsSecure(wssComponentMixedCase)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
benchWsIsSecure.add(JSON.stringify(wssComponentUpperCase), function () {
|
|
56
|
+
wsIsSecure(wssComponentUpperCase)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
benchWsIsSecure.add(JSON.stringify(httpComponent), function () {
|
|
60
|
+
wsIsSecure(httpComponent)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
await benchWsIsSecure.run()
|
|
64
|
+
console.log(benchWsIsSecure.name)
|
|
65
|
+
console.table(benchWsIsSecure.table())
|