@sigloch/graph-api-core 5.8.0 → 5.8.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/dist/format-e-codec.js +15 -2
- package/package.json +1 -1
package/dist/format-e-codec.js
CHANGED
|
@@ -137,6 +137,14 @@ export class FormatECodec {
|
|
|
137
137
|
}
|
|
138
138
|
continue;
|
|
139
139
|
}
|
|
140
|
+
// CR-SM-369: a `### <TYPE>` header outside `## Nodes` was swallowed by the `#` skip
|
|
141
|
+
// below — the node lines after it then failed as a bare "Unrecognized line". One
|
|
142
|
+
// canonical form (the serializer writes `## Nodes`), so the header is an error that
|
|
143
|
+
// names the section, not a second accepted spelling.
|
|
144
|
+
if (typeSection) {
|
|
145
|
+
errors.push(`Type section "### ${typeSection[1]}" outside "## Nodes" — "### <TYPE>" and its node lines (+ ~ - !) belong under "## Nodes", edges under "## Edges"`);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
140
148
|
if (line.startsWith('#'))
|
|
141
149
|
continue;
|
|
142
150
|
// Merge operations
|
|
@@ -168,8 +176,13 @@ export class FormatECodec {
|
|
|
168
176
|
}
|
|
169
177
|
continue;
|
|
170
178
|
}
|
|
171
|
-
|
|
172
|
-
|
|
179
|
+
// CR-SM-369: every fall-through names the section the line belongs in.
|
|
180
|
+
if (section === 'edges') {
|
|
181
|
+
errors.push(`Line under "## Edges" is not an edge (expected "<source> -<arrow>-> <target>"): "${line}" — node lines (+ ~ - !) belong under "## Nodes" + "### <TYPE>"`);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
errors.push(`Line outside any section: "${line}" — node lines (+ ~ - !) belong under "## Nodes" + "### <TYPE>", edges under "## Edges"`);
|
|
185
|
+
}
|
|
173
186
|
}
|
|
174
187
|
return { operations, errors };
|
|
175
188
|
}
|