@orkestrel/guide 0.0.21 → 0.0.22
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/src/core/index.cjs +19 -1
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +16 -0
- package/dist/src/core/index.d.ts +16 -0
- package/dist/src/core/index.js +19 -2
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +18 -1
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js +18 -1
- package/dist/src/server/index.js.map +1 -1
- package/package.json +3 -3
package/dist/src/server/index.js
CHANGED
|
@@ -893,6 +893,23 @@ function findMissingSymbols(symbols, source) {
|
|
|
893
893
|
return findMissing(symbols.map(computeSymbolKey), source.map(computeSymbolKey));
|
|
894
894
|
}
|
|
895
895
|
/**
|
|
896
|
+
* Checks whether a source declares at least one behavioural member — a `class` or `interface`
|
|
897
|
+
* in its surface that carries a call-signature member — so a guide owes a `## Methods` group only
|
|
898
|
+
* where the source has one to document.
|
|
899
|
+
*
|
|
900
|
+
* @param source - The reflected source under parity
|
|
901
|
+
* @returns True if a surface `class` or `interface` declares a member; false otherwise
|
|
902
|
+
*
|
|
903
|
+
* @example
|
|
904
|
+
* ```ts
|
|
905
|
+
* hasBehaviouralSurface(createSource({ files: { 'src/types.ts': 'export interface Widget { render(): void }' }, module: 'src' })) // true
|
|
906
|
+
* hasBehaviouralSurface(createSource({ files: { 'src/constants.ts': 'export const NAMES = Object.freeze({})' }, module: 'src' })) // false
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
function hasBehaviouralSurface(source) {
|
|
910
|
+
return source.surface().some((symbol) => (symbol.keyword === "class" || symbol.keyword === "interface") && source.methods(symbol.name).length > 0);
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
896
913
|
* Finds the names in `names` that have no example — a fence containing the name at a
|
|
897
914
|
* word boundary in `fences`, or a membership in `examples`, both count as
|
|
898
915
|
* "has an example"; presence-only, fence and JSDoc content are never checked.
|
|
@@ -3308,7 +3325,7 @@ var Parity = class Parity {
|
|
|
3308
3325
|
text: `${row.entry.spec} has no ## ${heading} section.`
|
|
3309
3326
|
});
|
|
3310
3327
|
}
|
|
3311
|
-
if (row.guide.methods().length === 0) findings.push({
|
|
3328
|
+
if (row.guide.methods().length === 0 && hasBehaviouralSurface(row.source)) findings.push({
|
|
3312
3329
|
spec: row.entry.spec,
|
|
3313
3330
|
text: `${row.entry.spec} has no documented method groups.`
|
|
3314
3331
|
});
|