@nielspeter/eess 0.4.0 → 0.5.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/README.md +94 -1
- package/dist/baseline-generator.d.ts +9 -0
- package/dist/baseline-generator.d.ts.map +1 -1
- package/dist/baseline-generator.js +9 -0
- package/dist/baseline-generator.js.map +1 -1
- package/dist/baseline.d.ts +1 -1
- package/dist/cardinality.d.ts.map +1 -1
- package/dist/cardinality.js +20 -5
- package/dist/cardinality.js.map +1 -1
- package/dist/cli-config.d.ts +106 -0
- package/dist/cli-config.d.ts.map +1 -0
- package/dist/cli-config.js +231 -0
- package/dist/cli-config.js.map +1 -0
- package/dist/collect-result.d.ts +94 -0
- package/dist/collect-result.d.ts.map +1 -0
- package/dist/collect-result.js +142 -0
- package/dist/collect-result.js.map +1 -0
- package/dist/combinators.d.ts +14 -0
- package/dist/combinators.d.ts.map +1 -1
- package/dist/combinators.js +53 -16
- package/dist/combinators.js.map +1 -1
- package/dist/condition.d.ts +37 -0
- package/dist/condition.d.ts.map +1 -1
- package/dist/condition.js +48 -1
- package/dist/condition.js.map +1 -1
- package/dist/correspondence.d.ts +30 -0
- package/dist/correspondence.d.ts.map +1 -1
- package/dist/correspondence.js +36 -1
- package/dist/correspondence.js.map +1 -1
- package/dist/dedupe-config-findings.d.ts.map +1 -1
- package/dist/dedupe-config-findings.js +27 -0
- package/dist/dedupe-config-findings.js.map +1 -1
- package/dist/diff-aware.d.ts +8 -9
- package/dist/diff-aware.d.ts.map +1 -1
- package/dist/diff-aware.js +38 -17
- package/dist/diff-aware.js.map +1 -1
- package/dist/emitter-findings.d.ts +167 -0
- package/dist/emitter-findings.d.ts.map +1 -0
- package/dist/emitter-findings.js +237 -0
- package/dist/emitter-findings.js.map +1 -0
- package/dist/errors.d.ts +48 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +61 -0
- package/dist/errors.js.map +1 -1
- package/dist/exclusion-comments.d.ts +36 -1
- package/dist/exclusion-comments.d.ts.map +1 -1
- package/dist/exclusion-comments.js +185 -37
- package/dist/exclusion-comments.js.map +1 -1
- package/dist/execute-rule.d.ts +12 -3
- package/dist/execute-rule.d.ts.map +1 -1
- package/dist/execute-rule.js +184 -7
- package/dist/execute-rule.js.map +1 -1
- package/dist/file-walk.d.ts +22 -0
- package/dist/file-walk.d.ts.map +1 -0
- package/dist/file-walk.js +51 -0
- package/dist/file-walk.js.map +1 -0
- package/dist/format-json.d.ts +13 -0
- package/dist/format-json.d.ts.map +1 -1
- package/dist/format-json.js +24 -0
- package/dist/format-json.js.map +1 -1
- package/dist/index.d.ts +14 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -41
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +55 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +92 -0
- package/dist/internal.js.map +1 -0
- package/dist/mask-non-comment.d.ts +49 -0
- package/dist/mask-non-comment.d.ts.map +1 -0
- package/dist/mask-non-comment.js +261 -0
- package/dist/mask-non-comment.js.map +1 -0
- package/dist/owns-empty-discovery.d.ts.map +1 -1
- package/dist/owns-empty-discovery.js +12 -4
- package/dist/owns-empty-discovery.js.map +1 -1
- package/dist/path-suffix.d.ts +57 -0
- package/dist/path-suffix.d.ts.map +1 -0
- package/dist/path-suffix.js +73 -0
- package/dist/path-suffix.js.map +1 -0
- package/dist/predicate.d.ts +12 -0
- package/dist/predicate.d.ts.map +1 -1
- package/dist/predicate.js +20 -1
- package/dist/predicate.js.map +1 -1
- package/dist/preset-dispatch.d.ts +6 -34
- package/dist/preset-dispatch.d.ts.map +1 -1
- package/dist/preset-dispatch.js +30 -52
- package/dist/preset-dispatch.js.map +1 -1
- package/dist/report.d.ts +31 -7
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +174 -15
- package/dist/report.js.map +1 -1
- package/dist/rule-builder-like.d.ts +8 -2
- package/dist/rule-builder-like.d.ts.map +1 -1
- package/dist/rule-builder.d.ts +15 -0
- package/dist/rule-builder.d.ts.map +1 -1
- package/dist/rule-builder.js +41 -36
- package/dist/rule-builder.js.map +1 -1
- package/dist/rule-description.d.ts +50 -0
- package/dist/rule-description.d.ts.map +1 -1
- package/dist/rule-description.js +58 -0
- package/dist/rule-description.js.map +1 -1
- package/dist/selection-memo.d.ts +1 -3
- package/dist/selection-memo.d.ts.map +1 -1
- package/dist/selection-memo.js +1 -3
- package/dist/selection-memo.js.map +1 -1
- package/dist/silent-exclusion.d.ts +12 -0
- package/dist/silent-exclusion.d.ts.map +1 -1
- package/dist/silent-exclusion.js +22 -0
- package/dist/silent-exclusion.js.map +1 -1
- package/dist/terminal-builder.d.ts +29 -15
- package/dist/terminal-builder.d.ts.map +1 -1
- package/dist/terminal-builder.js +97 -51
- package/dist/terminal-builder.js.map +1 -1
- package/dist/vacuity-findings.d.ts +0 -6
- package/dist/vacuity-findings.d.ts.map +1 -1
- package/dist/vacuity-findings.js +27 -57
- package/dist/vacuity-findings.js.map +1 -1
- package/dist/violation.d.ts +22 -1
- package/dist/violation.d.ts.map +1 -1
- package/dist/violation.js.map +1 -1
- package/dist/watch.d.ts +71 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +129 -0
- package/dist/watch.js.map +1 -0
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -5,16 +5,13 @@
|
|
|
5
5
|
// defineCondition extension points. Nothing here depends on ts-morph or any
|
|
6
6
|
// dialect-specific parser.
|
|
7
7
|
export { not, and, or } from './combinators.js';
|
|
8
|
-
export { byCodepoint, severityFor, remedyRepeatsMessage } from './violation.js';
|
|
9
|
-
export { applyFixes } from './apply-fixes.js';
|
|
10
|
-
export { UNSUPPRESSABLE } from './unsuppressable.js';
|
|
11
8
|
// Rule builder, terminal builder, error
|
|
12
9
|
export { RuleBuilder } from './rule-builder.js';
|
|
13
10
|
export { TerminalBuilder } from './terminal-builder.js';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export { ArchRuleError } from './errors.js';
|
|
11
|
+
export { collectResult, mergeCollectResults, hasEvidence } from './collect-result.js';
|
|
12
|
+
export { EMITTER_NO_RECEIPT, EMITTER_PASS_WITHOUT_EVIDENCE, EMITTER_EXPIRED_DECLARATION, EMITTER_CONTRADICTORY_EVIDENCE, EMITTER_SOURCE_EMPTY, } from './emitter-findings.js';
|
|
13
|
+
export { assertsCardinality } from './cardinality.js';
|
|
14
|
+
export { ArchRuleError, isArchRuleError, ArchConfigError, isArchConfigError } from './errors.js';
|
|
18
15
|
// Code frame & formatting
|
|
19
16
|
export { generateCodeFrame } from './code-frame.js';
|
|
20
17
|
export { formatViolations, formatViolationsPlain } from './format.js';
|
|
@@ -24,47 +21,22 @@ export { detectFormat, isCI } from './environment.js';
|
|
|
24
21
|
// Custom predicate/condition factories
|
|
25
22
|
export { definePredicate, defineCondition } from './define.js';
|
|
26
23
|
// Preset dispatch — generic per-rule severity/override infrastructure for presets
|
|
27
|
-
export { dispatchRule, validateOverrides
|
|
28
|
-
export { reportViolations, finishPreset
|
|
29
|
-
// Matching engine — shared by correspondence() and eess-ts's crossLayer
|
|
30
|
-
export { matchSelections } from './matching.js';
|
|
24
|
+
export { dispatchRule, validateOverrides } from './preset-dispatch.js';
|
|
25
|
+
export { reportViolations, finishPreset } from './report.js';
|
|
31
26
|
// Cross-validation — bind two element Selections and assert they correspond
|
|
32
27
|
export { correspondence, CorrespondenceBuilder } from './correspondence.js';
|
|
33
|
-
// Lower-level building blocks (used by dialects and covered by kernel tests)
|
|
34
|
-
export { applyFilters } from './execute-rule.js';
|
|
35
|
-
export { escapeGitHub } from './format-github.js';
|
|
36
|
-
export { hashViolation } from './baseline.js';
|
|
37
|
-
export { discoverIdentityRoot, normalizeIdentityText } from './identity-root.js';
|
|
38
|
-
export { writeStderr } from './stderr.js';
|
|
39
|
-
export { bold, red, dim, yellow, cyan, gray } from './ansi.js';
|
|
40
28
|
// Exclusions
|
|
41
29
|
export { parseExclusionComments, isExcludedByComment } from './exclusion-comments.js';
|
|
42
|
-
export { silent
|
|
30
|
+
export { silent } from './silent-exclusion.js';
|
|
43
31
|
// Baseline & diff-aware
|
|
44
32
|
export { withBaseline, generateBaseline, Baseline } from './baseline.js';
|
|
45
33
|
export { collectViolations } from './baseline-generator.js';
|
|
46
34
|
export { diffAware, DiffFilter } from './diff-aware.js';
|
|
47
|
-
// Edge coverage — allowlist conditions disclose when they tested nothing
|
|
48
|
-
export { recordEdgeCoverage, untestedRules, edgeCoverageNotice, resetEdgeCoverage, } from './edge-coverage.js';
|
|
49
|
-
export { isFaultPosition, countDeclaredGlobs, isGlobNode, isOpaqueGlob, globAnyOf, globNode, stampGlobs, negateGlobs, combineGlobs, } from './glob-site.js';
|
|
50
|
-
export { viewsFor } from './path-universe.js';
|
|
51
|
-
export { isAnchored, isProjectRelative } from './project-relative.js';
|
|
52
|
-
export { isRecord, isNullaryCallable } from './type-guards.js';
|
|
53
|
-
export { shallowClone } from './shallow-clone.js';
|
|
54
|
-
export { suppressionNotice, activeNotice, resetDiffDisclosureForTests } from './diff-disclosure.js';
|
|
55
|
-
export { resetCommentSuppression, recordCommentSuppression, commentSuppressions, commentSuppressionNotice, } from './comment-suppression.js';
|
|
56
|
-
export { dedupeConfigFindings } from './dedupe-config-findings.js';
|
|
57
|
-
export { assertionLessViolation } from './terminal-builder.js';
|
|
58
|
-
export { toPortablePath } from './identity-root.js';
|
|
59
|
-
export { isDescribable } from './rule-description.js';
|
|
60
|
-
export { resetStderrGuardForTests } from './stderr.js';
|
|
61
|
-
export { DECLARE_INSTEAD } from './unsuppressable.js';
|
|
62
|
-
export { UNSUPPRESSABLE_MECHANISMS } from './unsuppressable.js';
|
|
63
|
-
export { subjectOf } from './violation.js';
|
|
64
|
-
export { identityCollisions } from './violation.js';
|
|
65
|
-
export { resetIdentityCollisions } from './violation.js';
|
|
66
|
-
export { disambiguateIdentities } from './violation.js';
|
|
67
|
-
export { isArchRuleError } from './errors.js';
|
|
68
35
|
export { setCorrespondence } from './correspondence-core.js';
|
|
69
|
-
|
|
36
|
+
// Glob declaration — the constructors a user-written `definePredicate` needs to
|
|
37
|
+
// declare what it matches on. The types are above; these build them. ADR-011's
|
|
38
|
+
// first cut moved them behind `/internal` and left `packages/ts/src/index.ts`'s
|
|
39
|
+
// comment about them standing over the types alone, so the documented extension
|
|
40
|
+
// path required the internal entry point.
|
|
41
|
+
export { globAnyOf, globNode } from './glob-site.js';
|
|
70
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,2BAA2B;AAK3B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,2BAA2B;AAK3B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAM/C,wCAAwC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAIvD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACrF,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,iB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js';
|
|
2
|
+
export type { Describable } from './rule-description.js';
|
|
3
|
+
export type { OnDisk, DiskSet } from './disk-set.js';
|
|
4
|
+
export type { Pair, MatchResult, MatchOptions } from './matching.js';
|
|
5
|
+
export { DECLARE_INSTEAD } from './unsuppressable.js';
|
|
6
|
+
export { UNSUPPRESSABLE } from './unsuppressable.js';
|
|
7
|
+
export { UNSUPPRESSABLE_MECHANISMS } from './unsuppressable.js';
|
|
8
|
+
export { applyFilters } from './execute-rule.js';
|
|
9
|
+
export { applyFixes } from './apply-fixes.js';
|
|
10
|
+
export { assertionLessViolation } from './terminal-builder.js';
|
|
11
|
+
export { bold, red, dim, yellow, cyan, gray } from './ansi.js';
|
|
12
|
+
export { byCodepoint, severityFor, remedyRepeatsMessage } from './violation.js';
|
|
13
|
+
export { dedupeConfigFindings } from './dedupe-config-findings.js';
|
|
14
|
+
export { isEmitterFinding, EMITTER_IDS } from './emitter-findings.js';
|
|
15
|
+
export { disambiguateIdentities } from './violation.js';
|
|
16
|
+
export { discoverIdentityRoot, normalizeIdentityText } from './identity-root.js';
|
|
17
|
+
export { escapeGitHub } from './format-github.js';
|
|
18
|
+
export { hashViolation } from './baseline.js';
|
|
19
|
+
export { identityCollisions } from './violation.js';
|
|
20
|
+
export { isAnchored, isProjectRelative } from './project-relative.js';
|
|
21
|
+
export { isDescribable } from './rule-description.js';
|
|
22
|
+
export { isFaultPosition, countDeclaredGlobs, isGlobNode, isOpaqueGlob, stampGlobs, negateGlobs, combineGlobs, } from './glob-site.js';
|
|
23
|
+
export { isRecord, isNullaryCallable } from './type-guards.js';
|
|
24
|
+
export { isSilent } from './silent-exclusion.js';
|
|
25
|
+
export { marksAssertsCardinality } from './cardinality.js';
|
|
26
|
+
export { marksOwnEmptyDiscovery, ownsEmptyDiscovery } from './owns-empty-discovery.js';
|
|
27
|
+
export { matchSelections } from './matching.js';
|
|
28
|
+
export { recordEdgeCoverage, untestedRules, edgeCoverageNotice, resetEdgeCoverage, } from './edge-coverage.js';
|
|
29
|
+
export { registerCacheReset, clearRegisteredCaches } from './cache-registry.js';
|
|
30
|
+
export { resetCommentSuppression, recordCommentSuppression, commentSuppressions, commentSuppressionNotice, } from './comment-suppression.js';
|
|
31
|
+
export { resetIdentityCollisions } from './violation.js';
|
|
32
|
+
export { resetStderrGuardForTests } from './stderr.js';
|
|
33
|
+
export { selectionMemo } from './selection-memo.js';
|
|
34
|
+
export { shallowClone } from './shallow-clone.js';
|
|
35
|
+
export { subjectOf } from './violation.js';
|
|
36
|
+
export { suppressionNotice, activeNotice, resetDiffDisclosureForTests } from './diff-disclosure.js';
|
|
37
|
+
export { toPortablePath } from './identity-root.js';
|
|
38
|
+
export { viewsFor } from './path-universe.js';
|
|
39
|
+
export { pathSuffixIndex } from './path-suffix.js';
|
|
40
|
+
export type { PathSuffixIndex, PathSuffixMatch } from './path-suffix.js';
|
|
41
|
+
export { violationsEmittedCount } from './report.js';
|
|
42
|
+
export { writeStderr } from './stderr.js';
|
|
43
|
+
export { RunScheduler, watchAndRerun } from './watch.js';
|
|
44
|
+
export type { WatchOptions } from './watch.js';
|
|
45
|
+
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, isTypeScriptSpecifierMiss, enableTypeScriptSpecifierResolution, requireRuleFiles, } from './cli-config.js';
|
|
46
|
+
export type { SharedCliConfig } from './cli-config.js';
|
|
47
|
+
export { walkFiles, toPosix } from './file-walk.js';
|
|
48
|
+
export { declaredGlobsOf } from './rule-builder.js';
|
|
49
|
+
export { recordExclusions } from './silent-exclusion.js';
|
|
50
|
+
export { selectMatching, matchingElements } from './correspondence.js';
|
|
51
|
+
export { recordPredicate } from './predicate.js';
|
|
52
|
+
export { evaluateConditions, conditionContextFrom } from './condition.js';
|
|
53
|
+
export { ruleDescriptionOf, ruleDescriptionFrom } from './rule-description.js';
|
|
54
|
+
export { assertHomogeneous } from './combinators.js';
|
|
55
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAMzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAM9C,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,mCAAmC,EACnC,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAInD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAIxD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAItE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAIzE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// @nielspeter/eess/internal — family plumbing (ADR-011).
|
|
2
|
+
//
|
|
3
|
+
// NOT public API. These symbols exist so the sibling dialects can share the
|
|
4
|
+
// kernel's engine without each reimplementing it; a consumer writing rules never
|
|
5
|
+
// names them, and nothing here is taught by `docs/` or a package README.
|
|
6
|
+
//
|
|
7
|
+
// The boundary is enforced on this side of the line only: a dialect may import
|
|
8
|
+
// from here, and its barrel must never re-export what it finds. It cannot be
|
|
9
|
+
// enforced on the consumer's side — a subpath export is published and resolvable
|
|
10
|
+
// by anyone, which ADR-011's Enforcement table records as `manual` rather than
|
|
11
|
+
// pretending otherwise.
|
|
12
|
+
//
|
|
13
|
+
// Moving a symbol OUT of here and onto the root is additive. Moving one IN is a
|
|
14
|
+
// breaking change and needs a changeset that says so.
|
|
15
|
+
export { DECLARE_INSTEAD } from './unsuppressable.js';
|
|
16
|
+
export { UNSUPPRESSABLE } from './unsuppressable.js';
|
|
17
|
+
export { UNSUPPRESSABLE_MECHANISMS } from './unsuppressable.js';
|
|
18
|
+
export { applyFilters } from './execute-rule.js';
|
|
19
|
+
export { applyFixes } from './apply-fixes.js';
|
|
20
|
+
export { assertionLessViolation } from './terminal-builder.js';
|
|
21
|
+
export { bold, red, dim, yellow, cyan, gray } from './ansi.js';
|
|
22
|
+
export { byCodepoint, severityFor, remedyRepeatsMessage } from './violation.js';
|
|
23
|
+
export { dedupeConfigFindings } from './dedupe-config-findings.js';
|
|
24
|
+
// The emitter's own findings, for a dialect door that must tell "this receipt
|
|
25
|
+
// carried no evidence" apart from "this rule matched nothing". They are
|
|
26
|
+
// different faults with different remedies, and a door that refuses on the
|
|
27
|
+
// second is a false positive — measured: one dead preset glob blocked every fix
|
|
28
|
+
// in a run. Internal, not root: an adopter has no reason to mint or classify an
|
|
29
|
+
// emitter finding, which is proposal 009's subject.
|
|
30
|
+
export { isEmitterFinding, EMITTER_IDS } from './emitter-findings.js';
|
|
31
|
+
export { disambiguateIdentities } from './violation.js';
|
|
32
|
+
export { discoverIdentityRoot, normalizeIdentityText } from './identity-root.js';
|
|
33
|
+
export { escapeGitHub } from './format-github.js';
|
|
34
|
+
export { hashViolation } from './baseline.js';
|
|
35
|
+
export { identityCollisions } from './violation.js';
|
|
36
|
+
export { isAnchored, isProjectRelative } from './project-relative.js';
|
|
37
|
+
export { isDescribable } from './rule-description.js';
|
|
38
|
+
export { isFaultPosition, countDeclaredGlobs, isGlobNode, isOpaqueGlob, stampGlobs, negateGlobs, combineGlobs, } from './glob-site.js';
|
|
39
|
+
export { isRecord, isNullaryCallable } from './type-guards.js';
|
|
40
|
+
export { isSilent } from './silent-exclusion.js';
|
|
41
|
+
export { marksAssertsCardinality } from './cardinality.js';
|
|
42
|
+
export { marksOwnEmptyDiscovery, ownsEmptyDiscovery } from './owns-empty-discovery.js';
|
|
43
|
+
export { matchSelections } from './matching.js';
|
|
44
|
+
export { recordEdgeCoverage, untestedRules, edgeCoverageNotice, resetEdgeCoverage, } from './edge-coverage.js';
|
|
45
|
+
export { registerCacheReset, clearRegisteredCaches } from './cache-registry.js';
|
|
46
|
+
export { resetCommentSuppression, recordCommentSuppression, commentSuppressions, commentSuppressionNotice, } from './comment-suppression.js';
|
|
47
|
+
export { resetIdentityCollisions } from './violation.js';
|
|
48
|
+
export { resetStderrGuardForTests } from './stderr.js';
|
|
49
|
+
export { selectionMemo } from './selection-memo.js';
|
|
50
|
+
export { shallowClone } from './shallow-clone.js';
|
|
51
|
+
export { subjectOf } from './violation.js';
|
|
52
|
+
export { suppressionNotice, activeNotice, resetDiffDisclosureForTests } from './diff-disclosure.js';
|
|
53
|
+
export { toPortablePath } from './identity-root.js';
|
|
54
|
+
export { viewsFor } from './path-universe.js';
|
|
55
|
+
// Bug 0257: one suffix resolver, called by eess-md and eess-crossvalidate.
|
|
56
|
+
export { pathSuffixIndex } from './path-suffix.js';
|
|
57
|
+
export { violationsEmittedCount } from './report.js';
|
|
58
|
+
export { writeStderr } from './stderr.js';
|
|
59
|
+
// Watch-mode scheduling and the watch loop, shared by every dialect CLI. Family
|
|
60
|
+
// plumbing rather than public API (ADR-011): a consumer writing rules never
|
|
61
|
+
// calls this; a dialect's `--watch` does. Unified here because the two copies
|
|
62
|
+
// drifted and one of them kept a bug the other had fixed — see `watch.ts`.
|
|
63
|
+
export { RunScheduler, watchAndRerun } from './watch.js';
|
|
64
|
+
// The dialect-independent halves of CLI config handling — finding the file,
|
|
65
|
+
// validating what a loaded module claims, and classifying Node's module-format
|
|
66
|
+
// refusal. Family plumbing (ADR-011): a consumer writing rules never calls
|
|
67
|
+
// these; every dialect's CLI does, and did so from its own copy until now.
|
|
68
|
+
export { findConfigFile, extractSharedConfig, isModuleFormatRefusal, isTypeScriptSpecifierMiss, enableTypeScriptSpecifierResolution, requireRuleFiles, } from './cli-config.js';
|
|
69
|
+
// Recursive file discovery for the dialects that read a directory tree rather
|
|
70
|
+
// than a TypeScript project (`eess-md`, `eess-crossvalidate`). Each carried its
|
|
71
|
+
// own copy at 99% similarity.
|
|
72
|
+
export { walkFiles, toPosix } from './file-walk.js';
|
|
73
|
+
// The globs a rule declares, stamped with their origin. Family plumbing — a
|
|
74
|
+
// dialect's own rule-declaration layer calls it; a consumer writing rules does not.
|
|
75
|
+
export { declaredGlobsOf } from './rule-builder.js';
|
|
76
|
+
// Recording exclusion patterns into a builder's state. Family plumbing: the
|
|
77
|
+
// dialects' builders call it, a consumer writing rules does not.
|
|
78
|
+
export { recordExclusions } from './silent-exclusion.js';
|
|
79
|
+
// Applying a rule's predicates to its elements. Family plumbing: the dialects'
|
|
80
|
+
// builders call it, a consumer writing rules does not.
|
|
81
|
+
export { selectMatching, matchingElements } from './correspondence.js';
|
|
82
|
+
// Recording a predicate on a builder, diagnosing one that arrived after
|
|
83
|
+
// `.should()`. Family plumbing.
|
|
84
|
+
export { recordPredicate } from './predicate.js';
|
|
85
|
+
// Running a rule's conditions over its selected elements, carrying the evidence
|
|
86
|
+
// count ADR-010 requires. Family plumbing: dialect builders call it.
|
|
87
|
+
export { evaluateConditions, conditionContextFrom } from './condition.js';
|
|
88
|
+
// Assembling a rule's English description from what it declared. Family
|
|
89
|
+
// plumbing: every dialect builder renders one, a consumer does not.
|
|
90
|
+
export { ruleDescriptionOf, ruleDescriptionFrom } from './rule-description.js';
|
|
91
|
+
export { assertHomogeneous } from './combinators.js';
|
|
92
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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ving length and
|
|
3
|
+
* lines so reported positions are unchanged.
|
|
4
|
+
*
|
|
5
|
+
* Bug 0154: `parseExclusionComments` scanned raw source line by line with a bare
|
|
6
|
+
* regex, so text that merely LOOKED like `// eess-exclude …` — inside a string,
|
|
7
|
+
* a template literal, or a block comment describing the grammar — was parsed as
|
|
8
|
+
* a real waiver and silently suppressed a genuine finding on the next line. That
|
|
9
|
+
* is a suppression nobody wrote, which is the worst direction a suppression
|
|
10
|
+
* system can fail in.
|
|
11
|
+
*
|
|
12
|
+
* **Text-only, deliberately.** The kernel cannot import ts-morph (ADR-002/007
|
|
13
|
+
* confine it to `eess-ts`), so this is a hand-rolled single-pass scanner rather
|
|
14
|
+
* than an AST walk. The failure direction is what makes that acceptable: a
|
|
15
|
+
* mis-lex can only ever *hide* a directive — a waiver stops working, loudly, and
|
|
16
|
+
* the violation it was hiding comes back — never invent one.
|
|
17
|
+
*
|
|
18
|
+
* Line comments are deliberately NOT blanked: they are the thing being looked
|
|
19
|
+
* for. Everything else that can contain `//` is.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Blank strings, template literals, regex literals and block comments.
|
|
23
|
+
*
|
|
24
|
+
* @param sourceText the raw file text
|
|
25
|
+
* @returns text of identical length and line structure, with those spans spaced out
|
|
26
|
+
*/
|
|
27
|
+
export declare function maskNonCommentSpans(sourceText: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* The markdown answer to the question `maskNonCommentSpans` asks of code.
|
|
30
|
+
*
|
|
31
|
+
* A `.md` file has no string or template literals, so running the JS/TS lexer
|
|
32
|
+
* over one is a category error — and a costly one, because markdown is
|
|
33
|
+
* backtick-dense: a single unbalanced backtick in prose opened a "template
|
|
34
|
+
* literal" that swallowed the rest of the file, silencing every real directive
|
|
35
|
+
* after it. Fail-closed, so no invented suppression, but a waiver that stops
|
|
36
|
+
* working for a reason nobody can see is its own defect.
|
|
37
|
+
*
|
|
38
|
+
* What markdown DOES have is code spans, and they mean the same thing a string
|
|
39
|
+
* literal means in code: this is an example of the grammar, not an instance of
|
|
40
|
+
* it. Fenced blocks (``` or ~~~) and inline spans are blanked; prose is left
|
|
41
|
+
* alone. Length- and line-preserving, so reported positions do not move.
|
|
42
|
+
*
|
|
43
|
+
* An unterminated fence blanks to end-of-file. That is the fail-closed
|
|
44
|
+
* direction: text under a fence that was opened and never closed is more likely
|
|
45
|
+
* an example than a waiver, and the cost is a directive that does not apply
|
|
46
|
+
* rather than one that applies where nobody asked.
|
|
47
|
+
*/
|
|
48
|
+
export declare function maskMarkdownCodeSpans(sourceText: string): string;
|
|
49
|
+
//# sourceMappingURL=mask-non-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-non-comment.d.ts","sourceRoot":"","sources":["../src/mask-non-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkCH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyF9D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyChE"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blank every span a directive must NOT be read from, preserving length and
|
|
3
|
+
* lines so reported positions are unchanged.
|
|
4
|
+
*
|
|
5
|
+
* Bug 0154: `parseExclusionComments` scanned raw source line by line with a bare
|
|
6
|
+
* regex, so text that merely LOOKED like `// eess-exclude …` — inside a string,
|
|
7
|
+
* a template literal, or a block comment describing the grammar — was parsed as
|
|
8
|
+
* a real waiver and silently suppressed a genuine finding on the next line. That
|
|
9
|
+
* is a suppression nobody wrote, which is the worst direction a suppression
|
|
10
|
+
* system can fail in.
|
|
11
|
+
*
|
|
12
|
+
* **Text-only, deliberately.** The kernel cannot import ts-morph (ADR-002/007
|
|
13
|
+
* confine it to `eess-ts`), so this is a hand-rolled single-pass scanner rather
|
|
14
|
+
* than an AST walk. The failure direction is what makes that acceptable: a
|
|
15
|
+
* mis-lex can only ever *hide* a directive — a waiver stops working, loudly, and
|
|
16
|
+
* the violation it was hiding comes back — never invent one.
|
|
17
|
+
*
|
|
18
|
+
* Line comments are deliberately NOT blanked: they are the thing being looked
|
|
19
|
+
* for. Everything else that can contain `//` is.
|
|
20
|
+
*/
|
|
21
|
+
/** Replace a span with spaces, keeping newlines so line numbers do not move. */
|
|
22
|
+
function blank(text, start, end) {
|
|
23
|
+
let out = '';
|
|
24
|
+
for (let i = start; i < end; i++) {
|
|
25
|
+
out += text[i] === '\n' ? '\n' : ' ';
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A `/` here starts a regex literal rather than dividing.
|
|
31
|
+
*
|
|
32
|
+
* Decided by the previous significant character: after a value (identifier,
|
|
33
|
+
* literal, `)`, `]`) a `/` divides; after an operator, `(`, `,`, `=` or nothing
|
|
34
|
+
* it opens a regex. Getting this wrong is safe in one direction only — treating
|
|
35
|
+
* a division as a regex blanks source that could then hide a directive, so the
|
|
36
|
+
* bias is toward NOT opening a regex when unsure.
|
|
37
|
+
*/
|
|
38
|
+
function opensRegex(text, at) {
|
|
39
|
+
let i = at - 1;
|
|
40
|
+
while (i >= 0) {
|
|
41
|
+
const c = text[i];
|
|
42
|
+
if (c === undefined)
|
|
43
|
+
return true;
|
|
44
|
+
if (c === ' ' || c === '\t' || c === '\r' || c === '\n') {
|
|
45
|
+
i -= 1;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
return !/[A-Za-z0-9_$)\]]/.test(c);
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Blank strings, template literals, regex literals and block comments.
|
|
54
|
+
*
|
|
55
|
+
* @param sourceText the raw file text
|
|
56
|
+
* @returns text of identical length and line structure, with those spans spaced out
|
|
57
|
+
*/
|
|
58
|
+
export function maskNonCommentSpans(sourceText) {
|
|
59
|
+
let out = '';
|
|
60
|
+
let i = 0;
|
|
61
|
+
const n = sourceText.length;
|
|
62
|
+
while (i < n) {
|
|
63
|
+
const c = sourceText[i];
|
|
64
|
+
const next = sourceText[i + 1];
|
|
65
|
+
// Line comment — left intact; this is what the directive parser reads.
|
|
66
|
+
if (c === '/' && next === '/') {
|
|
67
|
+
const end = sourceText.indexOf('\n', i);
|
|
68
|
+
const stop = end === -1 ? n : end;
|
|
69
|
+
out += sourceText.slice(i, stop);
|
|
70
|
+
i = stop;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
// Block comment — blanked. A grammar description inside JSDoc is prose.
|
|
74
|
+
if (c === '/' && next === '*') {
|
|
75
|
+
const close = sourceText.indexOf('*/', i + 2);
|
|
76
|
+
const stop = close === -1 ? n : close + 2;
|
|
77
|
+
out += blank(sourceText, i, stop);
|
|
78
|
+
i = stop;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
// String or template literal — blanked whole, interpolations included. A
|
|
82
|
+
// `${…}` may itself contain a quote, so scanning it as code would need a
|
|
83
|
+
// nesting stack for no benefit: nothing inside a template is a directive.
|
|
84
|
+
if (c === '"' || c === "'" || c === '`') {
|
|
85
|
+
const quote = c;
|
|
86
|
+
let j = i + 1;
|
|
87
|
+
while (j < n) {
|
|
88
|
+
const d = sourceText[j];
|
|
89
|
+
if (d === '\\') {
|
|
90
|
+
j += 2;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (d === quote) {
|
|
94
|
+
j += 1;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
// An unterminated single- or double-quoted string ends at the newline;
|
|
98
|
+
// a template legitimately spans lines.
|
|
99
|
+
if (d === '\n' && quote !== '`')
|
|
100
|
+
break;
|
|
101
|
+
j += 1;
|
|
102
|
+
}
|
|
103
|
+
out += blank(sourceText, i, j);
|
|
104
|
+
i = j;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// Regex literal — blanked. `/…\/…/` can contain `//`.
|
|
108
|
+
if (c === '/' && opensRegex(sourceText, i)) {
|
|
109
|
+
let j = i + 1;
|
|
110
|
+
let inClass = false;
|
|
111
|
+
let closed = false;
|
|
112
|
+
while (j < n) {
|
|
113
|
+
const d = sourceText[j];
|
|
114
|
+
if (d === '\\') {
|
|
115
|
+
j += 2;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (d === '\n')
|
|
119
|
+
break;
|
|
120
|
+
if (d === '[')
|
|
121
|
+
inClass = true;
|
|
122
|
+
else if (d === ']')
|
|
123
|
+
inClass = false;
|
|
124
|
+
else if (d === '/' && !inClass) {
|
|
125
|
+
j += 1;
|
|
126
|
+
closed = true;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
j += 1;
|
|
130
|
+
}
|
|
131
|
+
// Only blank when it really closed on the same line; an unterminated
|
|
132
|
+
// `/` was division after all, and blanking to end-of-line could hide a
|
|
133
|
+
// trailing directive.
|
|
134
|
+
if (closed) {
|
|
135
|
+
out += blank(sourceText, i, j);
|
|
136
|
+
i = j;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
out += c;
|
|
141
|
+
i += 1;
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The markdown answer to the question `maskNonCommentSpans` asks of code.
|
|
147
|
+
*
|
|
148
|
+
* A `.md` file has no string or template literals, so running the JS/TS lexer
|
|
149
|
+
* over one is a category error — and a costly one, because markdown is
|
|
150
|
+
* backtick-dense: a single unbalanced backtick in prose opened a "template
|
|
151
|
+
* literal" that swallowed the rest of the file, silencing every real directive
|
|
152
|
+
* after it. Fail-closed, so no invented suppression, but a waiver that stops
|
|
153
|
+
* working for a reason nobody can see is its own defect.
|
|
154
|
+
*
|
|
155
|
+
* What markdown DOES have is code spans, and they mean the same thing a string
|
|
156
|
+
* literal means in code: this is an example of the grammar, not an instance of
|
|
157
|
+
* it. Fenced blocks (``` or ~~~) and inline spans are blanked; prose is left
|
|
158
|
+
* alone. Length- and line-preserving, so reported positions do not move.
|
|
159
|
+
*
|
|
160
|
+
* An unterminated fence blanks to end-of-file. That is the fail-closed
|
|
161
|
+
* direction: text under a fence that was opened and never closed is more likely
|
|
162
|
+
* an example than a waiver, and the cost is a directive that does not apply
|
|
163
|
+
* rather than one that applies where nobody asked.
|
|
164
|
+
*/
|
|
165
|
+
export function maskMarkdownCodeSpans(sourceText) {
|
|
166
|
+
const lines = sourceText.split('\n');
|
|
167
|
+
const out = [];
|
|
168
|
+
let fenceChar;
|
|
169
|
+
let fenceLength = 0;
|
|
170
|
+
for (const line of lines) {
|
|
171
|
+
const opener = /^\s*(`{3,}|~{3,})/.exec(line);
|
|
172
|
+
const marker = opener === null ? undefined : opener[1];
|
|
173
|
+
if (fenceChar !== undefined) {
|
|
174
|
+
// Inside a fence: blank everything, the closing marker line included.
|
|
175
|
+
out.push(' '.repeat(line.length));
|
|
176
|
+
if (marker !== undefined && marker.charAt(0) === fenceChar && marker.length >= fenceLength) {
|
|
177
|
+
fenceChar = undefined;
|
|
178
|
+
fenceLength = 0;
|
|
179
|
+
}
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (marker !== undefined) {
|
|
183
|
+
fenceChar = marker.charAt(0);
|
|
184
|
+
fenceLength = marker.length;
|
|
185
|
+
out.push(' '.repeat(line.length));
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
// Markdown's THIRD code construct: a 4-space (or tab) indented block. Missed
|
|
189
|
+
// by the first version, which handled fences and inline spans only — so an
|
|
190
|
+
// indented example of a directive was read as a live waiver. Deliberately
|
|
191
|
+
// over-broad (a wrapped list item indents too): over-masking hides a
|
|
192
|
+
// directive, which is loud; under-masking invents one, which is silent.
|
|
193
|
+
if (/^(?: {4}|\t)/.test(line)) {
|
|
194
|
+
out.push(' '.repeat(line.length));
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
// Outside a fence: blank BALANCED inline spans only. An odd backtick is
|
|
198
|
+
// prose, and treating it as an opener is exactly the bug this replaces.
|
|
199
|
+
out.push(blankInlineCodeSpans(line));
|
|
200
|
+
}
|
|
201
|
+
return out.join('\n');
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Blank code spans on one line, matching backtick RUNS the way CommonMark does:
|
|
205
|
+
* an opening run of N backticks is closed by the next run of exactly N.
|
|
206
|
+
*
|
|
207
|
+
* The first version paired backticks one at a time, which left the contents of
|
|
208
|
+
* any run of two or more exposed — so a directive inside ``…`` survived masking
|
|
209
|
+
* and was read as a live waiver. That is a suppression nobody wrote, the one
|
|
210
|
+
* direction this whole module exists to prevent (bug 0154), reintroduced by the
|
|
211
|
+
* fix for it. Multi-tick runs are not exotic here: they are the repo's own
|
|
212
|
+
* convention for code containing a backtick.
|
|
213
|
+
*
|
|
214
|
+
* An unclosed run is left as ordinary text, so a stray tick in prose still
|
|
215
|
+
* cannot swallow the rest of the line.
|
|
216
|
+
*/
|
|
217
|
+
function blankInlineCodeSpans(line) {
|
|
218
|
+
const runs = [];
|
|
219
|
+
let i = 0;
|
|
220
|
+
while (i < line.length) {
|
|
221
|
+
if (line.charAt(i) !== '`') {
|
|
222
|
+
i += 1;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
const start = i;
|
|
226
|
+
while (i < line.length && line.charAt(i) === '`')
|
|
227
|
+
i += 1;
|
|
228
|
+
runs.push({ start, length: i - start });
|
|
229
|
+
}
|
|
230
|
+
if (runs.length < 2)
|
|
231
|
+
return line;
|
|
232
|
+
let out = line;
|
|
233
|
+
let openIndex = 0;
|
|
234
|
+
while (openIndex < runs.length) {
|
|
235
|
+
const open = runs[openIndex];
|
|
236
|
+
if (open === undefined)
|
|
237
|
+
break;
|
|
238
|
+
let closeIndex = -1;
|
|
239
|
+
for (let j = openIndex + 1; j < runs.length; j++) {
|
|
240
|
+
const candidate = runs[j];
|
|
241
|
+
if (candidate !== undefined && candidate.length === open.length) {
|
|
242
|
+
closeIndex = j;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (closeIndex === -1) {
|
|
247
|
+
// No matching close: this run is prose, not a delimiter.
|
|
248
|
+
openIndex += 1;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const close = runs[closeIndex];
|
|
252
|
+
if (close === undefined)
|
|
253
|
+
break;
|
|
254
|
+
const from = open.start;
|
|
255
|
+
const to = close.start + close.length;
|
|
256
|
+
out = out.slice(0, from) + ' '.repeat(to - from) + out.slice(to);
|
|
257
|
+
openIndex = closeIndex + 1;
|
|
258
|
+
}
|
|
259
|
+
return out;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=mask-non-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-non-comment.js","sourceRoot":"","sources":["../src/mask-non-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gFAAgF;AAChF,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACrD,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA;IACtC,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,IAAY,EAAE,EAAU;IAC1C,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACd,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACd,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,IAAI,CAAC,KAAK,SAAS;YA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;QACV,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;QAC9B,IAAI,KAAK,KAAK,SAAS;YAAE,MAAK;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA;QACrC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAChE,SAAS,GAAG,UAAU,GAAG,CAAC,CAAA;IAC5B,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owns-empty-discovery.d.ts","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"owns-empty-discovery.d.ts","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"AAoEA,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAGxE;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -51,10 +51,18 @@
|
|
|
51
51
|
* and a test asserts that constructor emits no own symbols. `PairCondition` has no
|
|
52
52
|
* sanctioned constructor, so there is nothing to make the analogous guarantee.
|
|
53
53
|
*
|
|
54
|
-
* A module-level `WeakSet`
|
|
55
|
-
* object, so it cannot be read off one, copied, or forged
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* A module-level `WeakSet` closes that hole for the KEY: membership is not a
|
|
55
|
+
* property of the object, so it cannot be read off one, copied, or forged.
|
|
56
|
+
*
|
|
57
|
+
* It does not close it for the CALL, and the clause that used to say so — "a
|
|
58
|
+
* caller would need this module's binding, and it is not exported" — was already
|
|
59
|
+
* false when it was written: `marksOwnEmptyDiscovery` was exported from the
|
|
60
|
+
* kernel root. It now sits behind `@nielspeter/eess/internal`, which is narrower
|
|
61
|
+
* and still reachable. See `cardinality.ts` for the same limitation stated in
|
|
62
|
+
* full; the two markers share it.
|
|
63
|
+
*
|
|
64
|
+
* `WeakSet` rather than `Set` so a condition is not retained after its rule is
|
|
65
|
+
* discarded.
|
|
58
66
|
*/
|
|
59
67
|
const OWNERS = new WeakSet();
|
|
60
68
|
/** Declare that this condition reports an empty discovery population itself. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owns-empty-discovery.js","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"owns-empty-discovery.js","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,MAAM,GAAG,IAAI,OAAO,EAAU,CAAA;AAEpC,gFAAgF;AAChF,MAAM,UAAU,sBAAsB,CAAmB,SAAY;IACnE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACrB,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC9B,CAAC;AAED;;;;;;;GAOG"}
|