@specship/specship-win32-arm64 0.13.0 → 0.13.1
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/lib/dist/server/cli.js +1 -1
- package/lib/dist/server/routes/sse.js +1 -1
- package/lib/dist/server/server.js +1 -1
- package/lib/node_modules/.package-lock.json +11 -20
- package/lib/node_modules/ajv/node_modules/fast-uri/index.js +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/package.json +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/test/security.test.js +28 -0
- package/lib/node_modules/toad-cache/README.md +10 -9
- package/lib/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
- package/lib/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
- package/lib/node_modules/toad-cache/package.json +8 -8
- package/lib/node_modules/toad-cache/toad-cache.d.cts +20 -14
- package/lib/node_modules/toad-cache/toad-cache.d.ts +18 -14
- package/lib/node_modules/yaml/README.md +14 -31
- package/lib/node_modules/yaml/browser/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/browser/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/browser/dist/compose/compose-scalar.js +8 -14
- package/lib/node_modules/yaml/browser/dist/compose/composer.js +2 -4
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/browser/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/browser/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/browser/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/browser/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/browser/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/browser/dist/errors.js +1 -1
- package/lib/node_modules/yaml/browser/dist/log.js +6 -1
- package/lib/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +21 -0
- package/lib/node_modules/yaml/browser/dist/nodes/Alias.js +12 -27
- package/lib/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
- package/lib/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +49 -8
- package/lib/node_modules/yaml/browser/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/browser/dist/parse/parser.js +8 -31
- package/lib/node_modules/yaml/browser/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/browser/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/tags.js +16 -29
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +13 -5
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyString.js +16 -24
- package/lib/node_modules/yaml/browser/dist/util.js +1 -1
- package/lib/node_modules/yaml/dist/cli.d.ts +1 -1
- package/lib/node_modules/yaml/dist/cli.mjs +3 -5
- package/lib/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
- package/lib/node_modules/yaml/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/dist/compose/compose-node.d.ts +7 -8
- package/lib/node_modules/yaml/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-scalar.js +7 -13
- package/lib/node_modules/yaml/dist/compose/composer.d.ts +6 -7
- package/lib/node_modules/yaml/dist/compose/composer.js +3 -6
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
- package/lib/node_modules/yaml/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/dist/doc/Document.d.ts +11 -11
- package/lib/node_modules/yaml/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
- package/lib/node_modules/yaml/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
- package/lib/node_modules/yaml/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/dist/doc/directives.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.js +1 -1
- package/lib/node_modules/yaml/dist/index.d.ts +18 -21
- package/lib/node_modules/yaml/dist/log.js +4 -4
- package/lib/node_modules/yaml/dist/nodes/Alias.d.ts +9 -10
- package/lib/node_modules/yaml/dist/nodes/Alias.js +11 -26
- package/lib/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/nodes/Node.d.ts +9 -16
- package/lib/node_modules/yaml/dist/nodes/Pair.d.ts +8 -9
- package/lib/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -9
- package/lib/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.js +48 -7
- package/lib/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
- package/lib/node_modules/yaml/dist/nodes/toJS.d.ts +2 -4
- package/lib/node_modules/yaml/dist/options.d.ts +10 -22
- package/lib/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
- package/lib/node_modules/yaml/dist/parse/cst.d.ts +3 -4
- package/lib/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/dist/parse/parser.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/parser.js +9 -33
- package/lib/node_modules/yaml/dist/public-api.d.ts +5 -6
- package/lib/node_modules/yaml/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/dist/schema/Schema.d.ts +5 -4
- package/lib/node_modules/yaml/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/dist/schema/tags.d.ts +3 -11
- package/lib/node_modules/yaml/dist/schema/tags.js +13 -26
- package/lib/node_modules/yaml/dist/schema/types.d.ts +12 -14
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.js +7 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +17 -11
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyString.js +15 -23
- package/lib/node_modules/yaml/dist/util.d.ts +12 -16
- package/lib/node_modules/yaml/dist/util.js +2 -2
- package/lib/node_modules/yaml/dist/visit.d.ts +7 -7
- package/lib/node_modules/yaml/package.json +14 -13
- package/lib/package.json +5 -6
- package/package.json +1 -1
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/lib/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/lib/node_modules/jsonc-parser/README.md +0 -364
- package/lib/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +0 -185
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +0 -261
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +0 -659
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +0 -443
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +0 -29
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +0 -178
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +0 -201
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +0 -275
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +0 -682
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +0 -456
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +0 -42
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +0 -194
- package/lib/node_modules/jsonc-parser/package.json +0 -37
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -67
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -71
package/lib/dist/server/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ function parseArgs() {
|
|
|
50
50
|
console.log(`Usage: specship-desktop [options]
|
|
51
51
|
|
|
52
52
|
Options:
|
|
53
|
-
--project-root, -p <path> Project root (default: $SPECSHIP_PROJECT_ROOT
|
|
53
|
+
--project-root, -p <path> Project root (default: $SPECSHIP_PROJECT_ROOT or cwd)
|
|
54
54
|
--port <n> HTTP port (default: 4242)
|
|
55
55
|
--host <h> Bind host (default: 127.0.0.1)
|
|
56
56
|
--no-ingest Skip the in-process Claude JSONL transcript watcher
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `origin: true`) never gets to add the CORS header. Without this, a
|
|
8
8
|
* cross-origin `EventSource` is blocked: e.g. the dashboard opened at
|
|
9
9
|
* `127.0.0.1:<port>` calling the API host `localhost` (different origins to the
|
|
10
|
-
* browser), or the
|
|
10
|
+
* browser), or the Vite dev server on `:5173`. Echoing the request origin
|
|
11
11
|
* mirrors what `origin: true` does for the non-raw routes.
|
|
12
12
|
*/
|
|
13
13
|
export function writeSseHead(req, reply) {
|
|
@@ -292,7 +292,7 @@ export async function createServer(options) {
|
|
|
292
292
|
// 1. Try the requested URL as a real file under webDir → serve it
|
|
293
293
|
// with the right content-type. Covers the SPA's chunk-*.js,
|
|
294
294
|
// styles.css, favicons, fonts, etc.
|
|
295
|
-
// 2. Fall through to index.html for any other GET so
|
|
295
|
+
// 2. Fall through to index.html for any other GET so the SPA's
|
|
296
296
|
// client-side router can take over (`/memory`, `/graph`, …).
|
|
297
297
|
// Non-GET methods and `/api/*` paths still 404 cleanly so the UI
|
|
298
298
|
// can surface them. A MISSING asset path (e.g. a stale build's old
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specship/specship",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
"node_modules/ajv/node_modules/fast-uri": {
|
|
126
|
-
"version": "3.1.
|
|
127
|
-
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.
|
|
128
|
-
"integrity": "sha512-
|
|
126
|
+
"version": "3.1.3",
|
|
127
|
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz",
|
|
128
|
+
"integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==",
|
|
129
129
|
"funding": [
|
|
130
130
|
{
|
|
131
131
|
"type": "github",
|
|
@@ -594,12 +594,6 @@
|
|
|
594
594
|
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
|
595
595
|
"license": "MIT"
|
|
596
596
|
},
|
|
597
|
-
"node_modules/jsonc-parser": {
|
|
598
|
-
"version": "3.3.1",
|
|
599
|
-
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
|
|
600
|
-
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
|
|
601
|
-
"license": "MIT"
|
|
602
|
-
},
|
|
603
597
|
"node_modules/light-my-request": {
|
|
604
598
|
"version": "5.14.0",
|
|
605
599
|
"resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.14.0.tgz",
|
|
@@ -1122,9 +1116,9 @@
|
|
|
1122
1116
|
}
|
|
1123
1117
|
},
|
|
1124
1118
|
"node_modules/toad-cache": {
|
|
1125
|
-
"version": "3.7.
|
|
1126
|
-
"resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.
|
|
1127
|
-
"integrity": "sha512-
|
|
1119
|
+
"version": "3.7.4",
|
|
1120
|
+
"resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.4.tgz",
|
|
1121
|
+
"integrity": "sha512-m1TdR/rvT7kgGJZhspNtXdsdYk0fddFpJJFlG5s+UkPFo6lkLoZ3YLOaovPYjq1R75NP5JfeTlSHaOsE09peCg==",
|
|
1128
1122
|
"license": "MIT",
|
|
1129
1123
|
"engines": {
|
|
1130
1124
|
"node": ">=20"
|
|
@@ -1196,18 +1190,15 @@
|
|
|
1196
1190
|
"optional": true
|
|
1197
1191
|
},
|
|
1198
1192
|
"node_modules/yaml": {
|
|
1199
|
-
"version": "2.
|
|
1200
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.
|
|
1201
|
-
"integrity": "sha512-
|
|
1193
|
+
"version": "2.5.0",
|
|
1194
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz",
|
|
1195
|
+
"integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==",
|
|
1202
1196
|
"license": "ISC",
|
|
1203
1197
|
"bin": {
|
|
1204
1198
|
"yaml": "bin.mjs"
|
|
1205
1199
|
},
|
|
1206
1200
|
"engines": {
|
|
1207
|
-
"node": ">= 14
|
|
1208
|
-
},
|
|
1209
|
-
"funding": {
|
|
1210
|
-
"url": "https://github.com/sponsors/eemeli"
|
|
1201
|
+
"node": ">= 14"
|
|
1211
1202
|
}
|
|
1212
1203
|
}
|
|
1213
1204
|
}
|
|
@@ -305,7 +305,7 @@ function parseWithStatus (uri, opts) {
|
|
|
305
305
|
if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
306
306
|
// convert Unicode IDN -> ASCII IDN
|
|
307
307
|
try {
|
|
308
|
-
parsed.host = URL
|
|
308
|
+
parsed.host = new URL('http://' + parsed.host).hostname
|
|
309
309
|
} catch (e) {
|
|
310
310
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e
|
|
311
311
|
}
|
|
@@ -131,3 +131,31 @@ test('normalize does not double-decode %2540 into a live @', (t) => {
|
|
|
131
131
|
t.plan(1)
|
|
132
132
|
t.notEqual(parsed.host, 'trusted.com@evil.com', 'http://trusted.com%2540evil.com/')
|
|
133
133
|
})
|
|
134
|
+
|
|
135
|
+
test('parse canonicalises IDN / Unicode hosts to their ASCII form', (t) => {
|
|
136
|
+
const cases = [
|
|
137
|
+
{
|
|
138
|
+
input: 'http://127。0。0。1/',
|
|
139
|
+
expectedHost: '127.0.0.1',
|
|
140
|
+
description: 'full-width ideographic stops as octet separators'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
input: 'http://example.com/',
|
|
144
|
+
expectedHost: 'example.com',
|
|
145
|
+
description: 'fullwidth e as first letter'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
input: 'http://納豆.example.org/',
|
|
149
|
+
expectedHost: 'xn--99zt52a.example.org',
|
|
150
|
+
description: 'CJK label requiring punycode'
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
|
|
154
|
+
t.plan(cases.length * 2)
|
|
155
|
+
|
|
156
|
+
cases.forEach(({ input, expectedHost, description }) => {
|
|
157
|
+
const parsed = fastURI.parse(input)
|
|
158
|
+
t.notOk(parsed.error, `parse should not set error: ${description}`)
|
|
159
|
+
t.equal(parsed.host, expectedHost, `host canonicalised to ASCII: ${description}`)
|
|
160
|
+
})
|
|
161
|
+
})
|
|
@@ -144,7 +144,7 @@ console.log(cache.keys())
|
|
|
144
144
|
|
|
145
145
|
### Property
|
|
146
146
|
|
|
147
|
-
Max items to hold in cache (1000)
|
|
147
|
+
Max items to hold in cache (1000). Must be a non-negative integer; `0` means no size limit.
|
|
148
148
|
|
|
149
149
|
**Example**
|
|
150
150
|
|
|
@@ -201,7 +201,7 @@ cache.size // 0 - it's a new cache!
|
|
|
201
201
|
|
|
202
202
|
### Property
|
|
203
203
|
|
|
204
|
-
Milliseconds an item will remain in cache; lazy expiration upon next `get()` of an item
|
|
204
|
+
Milliseconds an item will remain in cache; lazy expiration upon next `get()` of an item. Must be a non-negative integer; `0` disables expiration.
|
|
205
205
|
|
|
206
206
|
**Example**
|
|
207
207
|
|
|
@@ -211,6 +211,8 @@ const cache = new Lru()
|
|
|
211
211
|
cache.ttl = 3e4
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
Note: entries stored while `ttl` was `0` have no expiry timestamp, so enabling a TTL at runtime immediately expires them on their next `get()`. Prefer setting the TTL via the constructor.
|
|
215
|
+
|
|
214
216
|
## Hit/miss/expiration tracking
|
|
215
217
|
|
|
216
218
|
In case you want to gather information on cache hit/miss/expiration ratio, as well as cache size and eviction statistics, you can use LruHitStatistics class:
|
|
@@ -218,13 +220,12 @@ In case you want to gather information on cache hit/miss/expiration ratio, as we
|
|
|
218
220
|
```js
|
|
219
221
|
const sharedRecord = new HitStatisticsRecord() // if you want to use single record object for all of caches, create it manually and pass to each cache
|
|
220
222
|
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
})
|
|
223
|
+
const max = 1000
|
|
224
|
+
const ttlInMsecs = 0
|
|
225
|
+
const cacheId = 'some-cache-id'
|
|
226
|
+
const statisticTtlInHours = 24 // how often to reset statistics. On every rotation previously accumulated data is removed
|
|
227
|
+
|
|
228
|
+
const cache = new LruHitStatistics(max, ttlInMsecs, cacheId, sharedRecord, statisticTtlInHours)
|
|
228
229
|
```
|
|
229
230
|
|
|
230
231
|
You can retrieve accumulated statistics from the cache, or from the record directly:
|