@0disoft/mensor-contract 0.1.0

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.
@@ -0,0 +1,257 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "feature-contract-v1.schema.json",
4
+ "title": "Mensor Feature Contract v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "feature", "actions"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "version": {
13
+ "const": 1
14
+ },
15
+ "feature": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["id"],
19
+ "properties": {
20
+ "id": {
21
+ "$ref": "#/$defs/identifier"
22
+ }
23
+ }
24
+ },
25
+ "actions": {
26
+ "type": "array",
27
+ "minItems": 1,
28
+ "items": {
29
+ "$ref": "#/$defs/action"
30
+ }
31
+ }
32
+ },
33
+ "$defs": {
34
+ "identifier": {
35
+ "type": "string",
36
+ "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$"
37
+ },
38
+ "exportName": {
39
+ "type": "string",
40
+ "pattern": "^[A-Za-z_$][A-Za-z0-9_$]*$"
41
+ },
42
+ "relativePath": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$"
46
+ },
47
+ "route": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["method", "path"],
51
+ "properties": {
52
+ "method": {
53
+ "const": "POST"
54
+ },
55
+ "path": {
56
+ "type": "string",
57
+ "pattern": "^/[^?#]*$"
58
+ }
59
+ }
60
+ },
61
+ "form": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["template", "id"],
65
+ "properties": {
66
+ "template": {
67
+ "allOf": [
68
+ { "$ref": "#/$defs/relativePath" },
69
+ { "type": "string", "pattern": "\\.html$" }
70
+ ]
71
+ },
72
+ "id": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "documentPath": {
77
+ "type": "string",
78
+ "pattern": "^/[^?#]*$"
79
+ }
80
+ }
81
+ },
82
+ "handler": {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": ["file", "export", "role"],
86
+ "properties": {
87
+ "file": {
88
+ "$ref": "#/$defs/relativePath"
89
+ },
90
+ "export": {
91
+ "$ref": "#/$defs/exportName"
92
+ },
93
+ "role": {
94
+ "$ref": "#/$defs/identifier"
95
+ }
96
+ }
97
+ },
98
+ "stringSchema": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["kind"],
102
+ "properties": {
103
+ "kind": {
104
+ "const": "string"
105
+ },
106
+ "minLength": {
107
+ "type": "integer",
108
+ "minimum": 0
109
+ },
110
+ "maxLength": {
111
+ "type": "integer",
112
+ "minimum": 0
113
+ }
114
+ }
115
+ },
116
+ "objectSchema": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["kind", "properties", "required"],
120
+ "properties": {
121
+ "kind": {
122
+ "const": "object"
123
+ },
124
+ "properties": {
125
+ "type": "object",
126
+ "minProperties": 1,
127
+ "additionalProperties": {
128
+ "$ref": "#/$defs/stringSchema"
129
+ }
130
+ },
131
+ "required": {
132
+ "type": "array",
133
+ "uniqueItems": true,
134
+ "items": {
135
+ "type": "string",
136
+ "minLength": 1
137
+ }
138
+ }
139
+ }
140
+ },
141
+ "textDecoder": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": ["kind", "trim", "empty"],
145
+ "properties": {
146
+ "kind": {
147
+ "const": "text"
148
+ },
149
+ "trim": {
150
+ "type": "boolean"
151
+ },
152
+ "empty": {
153
+ "enum": ["allow", "reject"]
154
+ }
155
+ }
156
+ },
157
+ "binding": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": ["name", "path", "decode"],
161
+ "properties": {
162
+ "name": {
163
+ "type": "string",
164
+ "minLength": 1
165
+ },
166
+ "path": {
167
+ "type": "array",
168
+ "minItems": 1,
169
+ "items": {
170
+ "type": "string",
171
+ "minLength": 1
172
+ }
173
+ },
174
+ "decode": {
175
+ "$ref": "#/$defs/textDecoder"
176
+ }
177
+ }
178
+ },
179
+ "ignoredField": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["name", "consumer"],
183
+ "properties": {
184
+ "name": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "consumer": {
189
+ "type": "string",
190
+ "minLength": 1
191
+ }
192
+ }
193
+ },
194
+ "formCodec": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": ["encoding", "unknownFields", "bindings"],
198
+ "properties": {
199
+ "encoding": {
200
+ "const": "urlencoded"
201
+ },
202
+ "unknownFields": {
203
+ "const": "reject"
204
+ },
205
+ "bindings": {
206
+ "type": "array",
207
+ "minItems": 1,
208
+ "items": {
209
+ "$ref": "#/$defs/binding"
210
+ }
211
+ },
212
+ "ignoredFields": {
213
+ "type": "array",
214
+ "uniqueItems": true,
215
+ "items": {
216
+ "$ref": "#/$defs/ignoredField"
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "input": {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": ["schema", "formCodec"],
225
+ "properties": {
226
+ "schema": {
227
+ "$ref": "#/$defs/objectSchema"
228
+ },
229
+ "formCodec": {
230
+ "$ref": "#/$defs/formCodec"
231
+ }
232
+ }
233
+ },
234
+ "action": {
235
+ "type": "object",
236
+ "additionalProperties": false,
237
+ "required": ["id", "route", "form", "handler", "input"],
238
+ "properties": {
239
+ "id": {
240
+ "$ref": "#/$defs/identifier"
241
+ },
242
+ "route": {
243
+ "$ref": "#/$defs/route"
244
+ },
245
+ "form": {
246
+ "$ref": "#/$defs/form"
247
+ },
248
+ "handler": {
249
+ "$ref": "#/$defs/handler"
250
+ },
251
+ "input": {
252
+ "$ref": "#/$defs/input"
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "project-contract-v1.schema.json",
4
+ "title": "Mensor Project Contract v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "sourceRoot", "featureContracts", "fileRoles"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "version": {
13
+ "const": 1
14
+ },
15
+ "sourceRoot": {
16
+ "$ref": "#/$defs/relativePath"
17
+ },
18
+ "featureContracts": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "uniqueItems": true,
22
+ "items": {
23
+ "$ref": "#/$defs/relativePath"
24
+ }
25
+ },
26
+ "fileRoles": {
27
+ "type": "array",
28
+ "minItems": 1,
29
+ "items": {
30
+ "$ref": "#/$defs/fileRole"
31
+ }
32
+ },
33
+ "boundaries": {
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "#/$defs/boundary"
37
+ }
38
+ },
39
+ "ownershipRules": {
40
+ "type": "array",
41
+ "items": {
42
+ "$ref": "#/$defs/ownershipRule"
43
+ }
44
+ },
45
+ "routeIndex": {
46
+ "$ref": "#/$defs/relativePath"
47
+ }
48
+ },
49
+ "$defs": {
50
+ "identifier": {
51
+ "type": "string",
52
+ "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$"
53
+ },
54
+ "relativePath": {
55
+ "type": "string",
56
+ "minLength": 1,
57
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$"
58
+ },
59
+ "featureDirectory": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*//$)(?!.*(?:^|/)\\.(?:/|$)).*[^/]$"
63
+ },
64
+ "fileRole": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": ["role", "withinFeature"],
68
+ "properties": {
69
+ "role": {
70
+ "$ref": "#/$defs/identifier"
71
+ },
72
+ "withinFeature": {
73
+ "$ref": "#/$defs/featureDirectory"
74
+ }
75
+ }
76
+ },
77
+ "boundary": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["id", "mode", "from", "deny"],
81
+ "properties": {
82
+ "id": {
83
+ "$ref": "#/$defs/identifier"
84
+ },
85
+ "mode": {
86
+ "enum": ["direct", "transitive"]
87
+ },
88
+ "from": {
89
+ "type": "array",
90
+ "minItems": 1,
91
+ "uniqueItems": true,
92
+ "items": {
93
+ "$ref": "#/$defs/identifier"
94
+ }
95
+ },
96
+ "deny": {
97
+ "type": "array",
98
+ "minItems": 1,
99
+ "uniqueItems": true,
100
+ "items": {
101
+ "$ref": "#/$defs/identifier"
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "ownershipRule": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": ["id", "kind", "suffixes", "withinFeature"],
110
+ "properties": {
111
+ "id": {
112
+ "$ref": "#/$defs/identifier"
113
+ },
114
+ "kind": {
115
+ "enum": ["i18n", "test"]
116
+ },
117
+ "suffixes": {
118
+ "type": "array",
119
+ "minItems": 1,
120
+ "uniqueItems": true,
121
+ "items": {
122
+ "type": "string",
123
+ "pattern": "^\\.[A-Za-z0-9._-]+$"
124
+ }
125
+ },
126
+ "withinFeature": {
127
+ "$ref": "#/$defs/featureDirectory"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "route-index-v1.schema.json",
4
+ "title": "Mensor RouteIndex v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "producer", "routes"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "producer": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["name", "version"],
14
+ "properties": {
15
+ "name": {
16
+ "type": "string",
17
+ "pattern": "^[a-z0-9](?:[a-z0-9._/-]{0,127})$"
18
+ },
19
+ "version": {
20
+ "type": "string",
21
+ "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9._+-]{0,127})$"
22
+ }
23
+ }
24
+ },
25
+ "routes": {
26
+ "type": "array",
27
+ "maxItems": 10000,
28
+ "items": { "$ref": "#/$defs/route" }
29
+ }
30
+ },
31
+ "$defs": {
32
+ "position": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["line", "character"],
36
+ "properties": {
37
+ "line": { "type": "integer", "minimum": 0 },
38
+ "character": { "type": "integer", "minimum": 0 }
39
+ }
40
+ },
41
+ "range": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["start", "end"],
45
+ "properties": {
46
+ "start": { "$ref": "#/$defs/position" },
47
+ "end": { "$ref": "#/$defs/position" }
48
+ }
49
+ },
50
+ "source": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["file", "contentDigest", "range"],
54
+ "properties": {
55
+ "file": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "pattern": "^(?!/)(?![A-Za-z]:)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f]).+$"
59
+ },
60
+ "contentDigest": {
61
+ "type": "string",
62
+ "pattern": "^sha256:[0-9a-f]{64}$"
63
+ },
64
+ "range": { "$ref": "#/$defs/range" }
65
+ }
66
+ },
67
+ "route": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": ["method", "path", "source"],
71
+ "properties": {
72
+ "method": { "enum": ["GET", "POST"] },
73
+ "path": { "type": "string", "pattern": "^/[^?#]*$" },
74
+ "source": { "$ref": "#/$defs/source" }
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,5 @@
1
+ export { isJsonValue, parseJsonc } from "./jsonc.js";
2
+ export { parseRouteIndex, serializeRouteIndex } from "./route-index.js";
3
+ export { parseDiagnosticReport, parseFeatureContract, parseProjectContract, } from "./validate.js";
4
+ export type { ActionContract, BoundaryContract, ContractFailure, ContractIssue, ContractIssueCode, ContractResult, ContractSuccess, ContentDigest, Diagnostic, DiagnosticReport, FeatureContract, FileOwnershipMismatchDiagnostic, FileOwnershipMismatchFacts, FileRoleContract, FileRoleMismatchDiagnostic, FileRoleMismatchFacts, FormBinding, FormCodec, FormActionMismatchDiagnostic, FormActionMismatchFacts, FormControlCodecMismatchDiagnostic, FormControlCodecMismatchFacts, FormControlUnsupportedDiagnostic, FormControlUnsupportedFacts, FormFieldMissingDiagnostic, FormFieldMissingFacts, FormFieldUnexpectedDiagnostic, FormFieldUnexpectedFacts, FormMethodMismatchDiagnostic, FormMethodMismatchFacts, HandlerExportMissingDiagnostic, HandlerExportMissingFacts, ModuleBoundaryViolationDiagnostic, ModuleBoundaryViolationFacts, ModuleDynamicImportUnsupportedDiagnostic, ModuleDynamicImportUnsupportedFacts, IgnoredFormField, IndexedRoute, JsonObject, JsonPrimitive, JsonValue, ObjectSchema, OwnershipRuleContract, ProjectContract, RelatedLocation, RepairInstruction, RouteIndex, RouteMissingDiagnostic, RouteMissingFacts, SourcePosition, SourceRange, StringSchema, TextDecoder, } from "./types.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,uBAAuB,EACvB,kCAAkC,EAClC,6BAA6B,EAC7B,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,EACzB,iCAAiC,EACjC,4BAA4B,EAC5B,wCAAwC,EACxC,mCAAmC,EACnC,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { isJsonValue, parseJsonc } from "./jsonc.js";
2
+ export { parseRouteIndex, serializeRouteIndex } from "./route-index.js";
3
+ export { parseDiagnosticReport, parseFeatureContract, parseProjectContract, } from "./validate.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ContractResult, JsonValue } from "./types.js";
2
+ export declare function parseJsonc(text: string): ContractResult<JsonValue>;
3
+ export declare function isJsonValue(value: unknown): value is JsonValue;
4
+ //# sourceMappingURL=jsonc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/jsonc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CA4ClE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CA2B9D"}
@@ -0,0 +1,132 @@
1
+ import { getNodeValue, parseTree, printParseErrorCode, } from "jsonc-parser";
2
+ const parseOptions = {
3
+ allowEmptyContent: false,
4
+ allowTrailingComma: false,
5
+ disallowComments: false,
6
+ };
7
+ export function parseJsonc(text) {
8
+ const parseErrors = [];
9
+ const root = parseTree(text, parseErrors, parseOptions);
10
+ const syntaxIssues = deduplicateIssues(parseErrors.map(toSyntaxIssue));
11
+ if (root === undefined) {
12
+ return {
13
+ ok: false,
14
+ issues: syntaxIssues.length > 0
15
+ ? sortIssues(syntaxIssues)
16
+ : [
17
+ {
18
+ code: "jsonc.empty",
19
+ message: "The JSONC document is empty.",
20
+ offset: 0,
21
+ length: 0,
22
+ },
23
+ ],
24
+ };
25
+ }
26
+ const duplicateIssues = findDuplicateKeyIssues(root);
27
+ const issues = sortIssues([...syntaxIssues, ...duplicateIssues]);
28
+ if (issues.length > 0) {
29
+ return { ok: false, issues };
30
+ }
31
+ const value = getNodeValue(root);
32
+ if (!isJsonValue(value)) {
33
+ return {
34
+ ok: false,
35
+ issues: [
36
+ {
37
+ code: "jsonc.syntax",
38
+ message: "The parsed document contains a non-JSON value.",
39
+ offset: root.offset,
40
+ length: root.length,
41
+ },
42
+ ],
43
+ };
44
+ }
45
+ return { ok: true, value };
46
+ }
47
+ export function isJsonValue(value) {
48
+ if (value === null ||
49
+ typeof value === "string" ||
50
+ typeof value === "boolean") {
51
+ return true;
52
+ }
53
+ if (typeof value === "number") {
54
+ return Number.isFinite(value);
55
+ }
56
+ if (Array.isArray(value)) {
57
+ return value.every(isJsonValue);
58
+ }
59
+ if (typeof value !== "object") {
60
+ return false;
61
+ }
62
+ const prototype = Object.getPrototypeOf(value);
63
+ if (prototype !== Object.prototype && prototype !== null) {
64
+ return false;
65
+ }
66
+ return Object.values(value).every(isJsonValue);
67
+ }
68
+ function toSyntaxIssue(error) {
69
+ return {
70
+ code: "jsonc.syntax",
71
+ message: `Invalid JSONC: ${printParseErrorCode(error.error)}.`,
72
+ offset: error.offset,
73
+ length: error.length,
74
+ };
75
+ }
76
+ function findDuplicateKeyIssues(root) {
77
+ const issues = [];
78
+ visitNode(root, issues);
79
+ return issues;
80
+ }
81
+ function visitNode(node, issues) {
82
+ if (node.type === "object") {
83
+ const seen = new Set();
84
+ for (const property of node.children ?? []) {
85
+ const keyNode = property.children?.[0];
86
+ const valueNode = property.children?.[1];
87
+ if (keyNode?.type !== "string" || typeof keyNode.value !== "string") {
88
+ continue;
89
+ }
90
+ if (seen.has(keyNode.value)) {
91
+ issues.push({
92
+ code: "jsonc.duplicate_key",
93
+ message: `Duplicate object key: ${JSON.stringify(keyNode.value)}.`,
94
+ offset: keyNode.offset,
95
+ length: keyNode.length,
96
+ });
97
+ }
98
+ else {
99
+ seen.add(keyNode.value);
100
+ }
101
+ if (valueNode !== undefined) {
102
+ visitNode(valueNode, issues);
103
+ }
104
+ }
105
+ return;
106
+ }
107
+ if (node.type === "array") {
108
+ for (const child of node.children ?? []) {
109
+ visitNode(child, issues);
110
+ }
111
+ }
112
+ }
113
+ function sortIssues(issues) {
114
+ return [...issues].sort((left, right) => {
115
+ const offsetOrder = (left.offset ?? 0) - (right.offset ?? 0);
116
+ return (offsetOrder ||
117
+ (left.length ?? 0) - (right.length ?? 0) ||
118
+ left.code.localeCompare(right.code) ||
119
+ left.message.localeCompare(right.message));
120
+ });
121
+ }
122
+ function deduplicateIssues(issues) {
123
+ const unique = new Map();
124
+ for (const issue of sortIssues(issues)) {
125
+ const key = `${issue.code}\u0000${issue.offset ?? 0}\u0000${issue.length ?? 0}`;
126
+ if (!unique.has(key)) {
127
+ unique.set(key, issue);
128
+ }
129
+ }
130
+ return [...unique.values()];
131
+ }
132
+ //# sourceMappingURL=jsonc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonc.js","sourceRoot":"","sources":["../../src/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AAItB,MAAM,YAAY,GAAG;IACnB,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,KAAK;IACzB,gBAAgB,EAAE,KAAK;CACf,CAAC;AAEX,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IAEvE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EACJ,YAAY,CAAC,MAAM,GAAG,CAAC;gBACrB,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC;gBAC1B,CAAC,CAAC;oBACE;wBACE,IAAI,EAAE,aAAa;wBACnB,OAAO,EAAE,8BAA8B;wBACvC,MAAM,EAAE,CAAC;wBACT,MAAM,EAAE,CAAC;qBACV;iBACF;SACR,CAAC;IACJ,CAAC;IAED,MAAM,eAAe,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,GAAG,YAAY,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC;IACjE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,KAAK,GAAY,YAAY,CAAC,IA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KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ContractResult, RouteIndex } from "./types.js";
2
+ export declare function parseRouteIndex(text: string): ContractResult<RouteIndex>;
3
+ export declare function serializeRouteIndex(value: unknown): string;
4
+ //# sourceMappingURL=route-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-index.d.ts","sourceRoot":"","sources":["../../src/route-index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,cAAc,EAEd,UAAU,EAGX,MAAM,YAAY,CAAC;AAIpB,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAqBxE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAY1D"}