driftdetect-detectors 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.
- package/dist/accessibility/alt-text.d.ts +63 -0
- package/dist/accessibility/alt-text.d.ts.map +1 -0
- package/dist/accessibility/alt-text.js +100 -0
- package/dist/accessibility/alt-text.js.map +1 -0
- package/dist/accessibility/aria-roles.d.ts +65 -0
- package/dist/accessibility/aria-roles.d.ts.map +1 -0
- package/dist/accessibility/aria-roles.js +87 -0
- package/dist/accessibility/aria-roles.js.map +1 -0
- package/dist/accessibility/focus-management.d.ts +62 -0
- package/dist/accessibility/focus-management.d.ts.map +1 -0
- package/dist/accessibility/focus-management.js +88 -0
- package/dist/accessibility/focus-management.js.map +1 -0
- package/dist/accessibility/heading-hierarchy.d.ts +66 -0
- package/dist/accessibility/heading-hierarchy.d.ts.map +1 -0
- package/dist/accessibility/heading-hierarchy.js +94 -0
- package/dist/accessibility/heading-hierarchy.js.map +1 -0
- package/dist/accessibility/index.d.ts +25 -0
- package/dist/accessibility/index.d.ts.map +1 -0
- package/dist/accessibility/index.js +21 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/accessibility/keyboard-nav.d.ts +63 -0
- package/dist/accessibility/keyboard-nav.d.ts.map +1 -0
- package/dist/accessibility/keyboard-nav.js +86 -0
- package/dist/accessibility/keyboard-nav.js.map +1 -0
- package/dist/accessibility/semantic-html.d.ts +76 -0
- package/dist/accessibility/semantic-html.d.ts.map +1 -0
- package/dist/accessibility/semantic-html.js +204 -0
- package/dist/accessibility/semantic-html.js.map +1 -0
- package/dist/api/client-patterns.d.ts +121 -0
- package/dist/api/client-patterns.d.ts.map +1 -0
- package/dist/api/client-patterns.js +478 -0
- package/dist/api/client-patterns.js.map +1 -0
- package/dist/api/error-format.d.ts +140 -0
- package/dist/api/error-format.d.ts.map +1 -0
- package/dist/api/error-format.js +614 -0
- package/dist/api/error-format.js.map +1 -0
- package/dist/api/http-methods.d.ts +255 -0
- package/dist/api/http-methods.d.ts.map +1 -0
- package/dist/api/http-methods.js +890 -0
- package/dist/api/http-methods.js.map +1 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +37 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pagination.d.ts +133 -0
- package/dist/api/pagination.d.ts.map +1 -0
- package/dist/api/pagination.js +521 -0
- package/dist/api/pagination.js.map +1 -0
- package/dist/api/response-envelope.d.ts +261 -0
- package/dist/api/response-envelope.d.ts.map +1 -0
- package/dist/api/response-envelope.js +1050 -0
- package/dist/api/response-envelope.js.map +1 -0
- package/dist/api/retry-patterns.d.ts +117 -0
- package/dist/api/retry-patterns.d.ts.map +1 -0
- package/dist/api/retry-patterns.js +480 -0
- package/dist/api/retry-patterns.js.map +1 -0
- package/dist/api/route-structure.d.ts +128 -0
- package/dist/api/route-structure.d.ts.map +1 -0
- package/dist/api/route-structure.js +738 -0
- package/dist/api/route-structure.js.map +1 -0
- package/dist/auth/audit-logging.d.ts +80 -0
- package/dist/auth/audit-logging.d.ts.map +1 -0
- package/dist/auth/audit-logging.js +370 -0
- package/dist/auth/audit-logging.js.map +1 -0
- package/dist/auth/index.d.ts +33 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +49 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/middleware-usage.d.ts +65 -0
- package/dist/auth/middleware-usage.d.ts.map +1 -0
- package/dist/auth/middleware-usage.js +192 -0
- package/dist/auth/middleware-usage.js.map +1 -0
- package/dist/auth/permission-checks.d.ts +60 -0
- package/dist/auth/permission-checks.d.ts.map +1 -0
- package/dist/auth/permission-checks.js +159 -0
- package/dist/auth/permission-checks.js.map +1 -0
- package/dist/auth/rbac-patterns.d.ts +68 -0
- package/dist/auth/rbac-patterns.d.ts.map +1 -0
- package/dist/auth/rbac-patterns.js +143 -0
- package/dist/auth/rbac-patterns.js.map +1 -0
- package/dist/auth/resource-ownership.d.ts +77 -0
- package/dist/auth/resource-ownership.d.ts.map +1 -0
- package/dist/auth/resource-ownership.js +324 -0
- package/dist/auth/resource-ownership.js.map +1 -0
- package/dist/auth/token-handling.d.ts +64 -0
- package/dist/auth/token-handling.d.ts.map +1 -0
- package/dist/auth/token-handling.js +151 -0
- package/dist/auth/token-handling.js.map +1 -0
- package/dist/base/ast-detector.d.ts +421 -0
- package/dist/base/ast-detector.d.ts.map +1 -0
- package/dist/base/ast-detector.js +699 -0
- package/dist/base/ast-detector.js.map +1 -0
- package/dist/base/base-detector.d.ts +366 -0
- package/dist/base/base-detector.d.ts.map +1 -0
- package/dist/base/base-detector.js +170 -0
- package/dist/base/base-detector.js.map +1 -0
- package/dist/base/index.d.ts +12 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +17 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/regex-detector.d.ts +421 -0
- package/dist/base/regex-detector.d.ts.map +1 -0
- package/dist/base/regex-detector.js +537 -0
- package/dist/base/regex-detector.js.map +1 -0
- package/dist/base/structural-detector.d.ts +424 -0
- package/dist/base/structural-detector.d.ts.map +1 -0
- package/dist/base/structural-detector.js +731 -0
- package/dist/base/structural-detector.js.map +1 -0
- package/dist/base/types.d.ts +53 -0
- package/dist/base/types.d.ts.map +1 -0
- package/dist/base/types.js +5 -0
- package/dist/base/types.js.map +1 -0
- package/dist/components/component-structure.d.ts +163 -0
- package/dist/components/component-structure.d.ts.map +1 -0
- package/dist/components/component-structure.js +500 -0
- package/dist/components/component-structure.js.map +1 -0
- package/dist/components/composition.d.ts +287 -0
- package/dist/components/composition.d.ts.map +1 -0
- package/dist/components/composition.js +1123 -0
- package/dist/components/composition.js.map +1 -0
- package/dist/components/duplicate-detection.d.ts +251 -0
- package/dist/components/duplicate-detection.d.ts.map +1 -0
- package/dist/components/duplicate-detection.js +804 -0
- package/dist/components/duplicate-detection.js.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/near-duplicate.d.ts +402 -0
- package/dist/components/near-duplicate.d.ts.map +1 -0
- package/dist/components/near-duplicate.js +1090 -0
- package/dist/components/near-duplicate.js.map +1 -0
- package/dist/components/props-patterns.d.ts +194 -0
- package/dist/components/props-patterns.d.ts.map +1 -0
- package/dist/components/props-patterns.js +795 -0
- package/dist/components/props-patterns.js.map +1 -0
- package/dist/components/ref-forwarding.d.ts +250 -0
- package/dist/components/ref-forwarding.d.ts.map +1 -0
- package/dist/components/ref-forwarding.js +832 -0
- package/dist/components/ref-forwarding.js.map +1 -0
- package/dist/components/state-patterns.d.ts +291 -0
- package/dist/components/state-patterns.d.ts.map +1 -0
- package/dist/components/state-patterns.js +970 -0
- package/dist/components/state-patterns.js.map +1 -0
- package/dist/config/config-validation.d.ts +74 -0
- package/dist/config/config-validation.d.ts.map +1 -0
- package/dist/config/config-validation.js +446 -0
- package/dist/config/config-validation.js.map +1 -0
- package/dist/config/default-values.d.ts +72 -0
- package/dist/config/default-values.d.ts.map +1 -0
- package/dist/config/default-values.js +386 -0
- package/dist/config/default-values.js.map +1 -0
- package/dist/config/env-naming.d.ts +73 -0
- package/dist/config/env-naming.d.ts.map +1 -0
- package/dist/config/env-naming.js +429 -0
- package/dist/config/env-naming.js.map +1 -0
- package/dist/config/environment-detection.d.ts +72 -0
- package/dist/config/environment-detection.d.ts.map +1 -0
- package/dist/config/environment-detection.js +400 -0
- package/dist/config/environment-detection.js.map +1 -0
- package/dist/config/feature-flags.d.ts +72 -0
- package/dist/config/feature-flags.d.ts.map +1 -0
- package/dist/config/feature-flags.js +384 -0
- package/dist/config/feature-flags.js.map +1 -0
- package/dist/config/index.d.ts +27 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +43 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/required-optional.d.ts +71 -0
- package/dist/config/required-optional.d.ts.map +1 -0
- package/dist/config/required-optional.js +344 -0
- package/dist/config/required-optional.js.map +1 -0
- package/dist/data-access/connection-pooling.d.ts +63 -0
- package/dist/data-access/connection-pooling.d.ts.map +1 -0
- package/dist/data-access/connection-pooling.js +297 -0
- package/dist/data-access/connection-pooling.js.map +1 -0
- package/dist/data-access/dto-patterns.d.ts +64 -0
- package/dist/data-access/dto-patterns.d.ts.map +1 -0
- package/dist/data-access/dto-patterns.js +291 -0
- package/dist/data-access/dto-patterns.js.map +1 -0
- package/dist/data-access/index.d.ts +31 -0
- package/dist/data-access/index.d.ts.map +1 -0
- package/dist/data-access/index.js +49 -0
- package/dist/data-access/index.js.map +1 -0
- package/dist/data-access/n-plus-one.d.ts +60 -0
- package/dist/data-access/n-plus-one.d.ts.map +1 -0
- package/dist/data-access/n-plus-one.js +264 -0
- package/dist/data-access/n-plus-one.js.map +1 -0
- package/dist/data-access/query-patterns.d.ts +64 -0
- package/dist/data-access/query-patterns.d.ts.map +1 -0
- package/dist/data-access/query-patterns.js +314 -0
- package/dist/data-access/query-patterns.js.map +1 -0
- package/dist/data-access/repository-pattern.d.ts +62 -0
- package/dist/data-access/repository-pattern.d.ts.map +1 -0
- package/dist/data-access/repository-pattern.js +257 -0
- package/dist/data-access/repository-pattern.js.map +1 -0
- package/dist/data-access/transaction-patterns.d.ts +61 -0
- package/dist/data-access/transaction-patterns.d.ts.map +1 -0
- package/dist/data-access/transaction-patterns.js +277 -0
- package/dist/data-access/transaction-patterns.js.map +1 -0
- package/dist/data-access/validation-patterns.d.ts +62 -0
- package/dist/data-access/validation-patterns.d.ts.map +1 -0
- package/dist/data-access/validation-patterns.js +301 -0
- package/dist/data-access/validation-patterns.js.map +1 -0
- package/dist/documentation/deprecation.d.ts +62 -0
- package/dist/documentation/deprecation.d.ts.map +1 -0
- package/dist/documentation/deprecation.js +83 -0
- package/dist/documentation/deprecation.js.map +1 -0
- package/dist/documentation/example-code.d.ts +64 -0
- package/dist/documentation/example-code.d.ts.map +1 -0
- package/dist/documentation/example-code.js +79 -0
- package/dist/documentation/example-code.js.map +1 -0
- package/dist/documentation/index.d.ts +22 -0
- package/dist/documentation/index.d.ts.map +1 -0
- package/dist/documentation/index.js +19 -0
- package/dist/documentation/index.js.map +1 -0
- package/dist/documentation/jsdoc-patterns.d.ts +72 -0
- package/dist/documentation/jsdoc-patterns.d.ts.map +1 -0
- package/dist/documentation/jsdoc-patterns.js +92 -0
- package/dist/documentation/jsdoc-patterns.js.map +1 -0
- package/dist/documentation/readme-structure.d.ts +67 -0
- package/dist/documentation/readme-structure.d.ts.map +1 -0
- package/dist/documentation/readme-structure.js +76 -0
- package/dist/documentation/readme-structure.js.map +1 -0
- package/dist/documentation/todo-patterns.d.ts +67 -0
- package/dist/documentation/todo-patterns.d.ts.map +1 -0
- package/dist/documentation/todo-patterns.js +73 -0
- package/dist/documentation/todo-patterns.js.map +1 -0
- package/dist/errors/async-errors.d.ts +72 -0
- package/dist/errors/async-errors.d.ts.map +1 -0
- package/dist/errors/async-errors.js +214 -0
- package/dist/errors/async-errors.js.map +1 -0
- package/dist/errors/circuit-breaker.d.ts +53 -0
- package/dist/errors/circuit-breaker.d.ts.map +1 -0
- package/dist/errors/circuit-breaker.js +241 -0
- package/dist/errors/circuit-breaker.js.map +1 -0
- package/dist/errors/error-codes.d.ts +73 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +211 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/error-logging.d.ts +73 -0
- package/dist/errors/error-logging.d.ts.map +1 -0
- package/dist/errors/error-logging.js +256 -0
- package/dist/errors/error-logging.js.map +1 -0
- package/dist/errors/error-propagation.d.ts +73 -0
- package/dist/errors/error-propagation.d.ts.map +1 -0
- package/dist/errors/error-propagation.js +244 -0
- package/dist/errors/error-propagation.js.map +1 -0
- package/dist/errors/exception-hierarchy.d.ts +75 -0
- package/dist/errors/exception-hierarchy.d.ts.map +1 -0
- package/dist/errors/exception-hierarchy.js +259 -0
- package/dist/errors/exception-hierarchy.js.map +1 -0
- package/dist/errors/index.d.ts +31 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +49 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/try-catch-placement.d.ts +73 -0
- package/dist/errors/try-catch-placement.d.ts.map +1 -0
- package/dist/errors/try-catch-placement.js +214 -0
- package/dist/errors/try-catch-placement.js.map +1 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/context-fields.d.ts +48 -0
- package/dist/logging/context-fields.d.ts.map +1 -0
- package/dist/logging/context-fields.js +160 -0
- package/dist/logging/context-fields.js.map +1 -0
- package/dist/logging/correlation-ids.d.ts +44 -0
- package/dist/logging/correlation-ids.d.ts.map +1 -0
- package/dist/logging/correlation-ids.js +144 -0
- package/dist/logging/correlation-ids.js.map +1 -0
- package/dist/logging/health-checks.d.ts +45 -0
- package/dist/logging/health-checks.d.ts.map +1 -0
- package/dist/logging/health-checks.js +165 -0
- package/dist/logging/health-checks.js.map +1 -0
- package/dist/logging/index.d.ts +31 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +49 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/log-levels.d.ts +46 -0
- package/dist/logging/log-levels.d.ts.map +1 -0
- package/dist/logging/log-levels.js +178 -0
- package/dist/logging/log-levels.js.map +1 -0
- package/dist/logging/metric-naming.d.ts +46 -0
- package/dist/logging/metric-naming.d.ts.map +1 -0
- package/dist/logging/metric-naming.js +157 -0
- package/dist/logging/metric-naming.js.map +1 -0
- package/dist/logging/pii-redaction.d.ts +44 -0
- package/dist/logging/pii-redaction.d.ts.map +1 -0
- package/dist/logging/pii-redaction.js +166 -0
- package/dist/logging/pii-redaction.js.map +1 -0
- package/dist/logging/structured-format.d.ts +53 -0
- package/dist/logging/structured-format.d.ts.map +1 -0
- package/dist/logging/structured-format.js +235 -0
- package/dist/logging/structured-format.js.map +1 -0
- package/dist/performance/bundle-size.d.ts +79 -0
- package/dist/performance/bundle-size.d.ts.map +1 -0
- package/dist/performance/bundle-size.js +276 -0
- package/dist/performance/bundle-size.js.map +1 -0
- package/dist/performance/caching-patterns.d.ts +78 -0
- package/dist/performance/caching-patterns.d.ts.map +1 -0
- package/dist/performance/caching-patterns.js +257 -0
- package/dist/performance/caching-patterns.js.map +1 -0
- package/dist/performance/code-splitting.d.ts +86 -0
- package/dist/performance/code-splitting.d.ts.map +1 -0
- package/dist/performance/code-splitting.js +447 -0
- package/dist/performance/code-splitting.js.map +1 -0
- package/dist/performance/debounce-throttle.d.ts +75 -0
- package/dist/performance/debounce-throttle.d.ts.map +1 -0
- package/dist/performance/debounce-throttle.js +232 -0
- package/dist/performance/debounce-throttle.js.map +1 -0
- package/dist/performance/index.d.ts +28 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +39 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/lazy-loading.d.ts +75 -0
- package/dist/performance/lazy-loading.d.ts.map +1 -0
- package/dist/performance/lazy-loading.js +233 -0
- package/dist/performance/lazy-loading.js.map +1 -0
- package/dist/performance/memoization.d.ts +75 -0
- package/dist/performance/memoization.d.ts.map +1 -0
- package/dist/performance/memoization.js +251 -0
- package/dist/performance/memoization.js.map +1 -0
- package/dist/registry/detector-registry.d.ts +266 -0
- package/dist/registry/detector-registry.d.ts.map +1 -0
- package/dist/registry/detector-registry.js +526 -0
- package/dist/registry/detector-registry.js.map +1 -0
- package/dist/registry/index.d.ts +10 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/loader.d.ts +232 -0
- package/dist/registry/loader.d.ts.map +1 -0
- package/dist/registry/loader.js +419 -0
- package/dist/registry/loader.js.map +1 -0
- package/dist/registry/types.d.ts +111 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +19 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/security/csp-headers.d.ts +78 -0
- package/dist/security/csp-headers.d.ts.map +1 -0
- package/dist/security/csp-headers.js +401 -0
- package/dist/security/csp-headers.js.map +1 -0
- package/dist/security/csrf-protection.d.ts +72 -0
- package/dist/security/csrf-protection.d.ts.map +1 -0
- package/dist/security/csrf-protection.js +344 -0
- package/dist/security/csrf-protection.js.map +1 -0
- package/dist/security/index.d.ts +30 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +48 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/input-sanitization.d.ts +74 -0
- package/dist/security/input-sanitization.d.ts.map +1 -0
- package/dist/security/input-sanitization.js +373 -0
- package/dist/security/input-sanitization.js.map +1 -0
- package/dist/security/rate-limiting.d.ts +81 -0
- package/dist/security/rate-limiting.d.ts.map +1 -0
- package/dist/security/rate-limiting.js +535 -0
- package/dist/security/rate-limiting.js.map +1 -0
- package/dist/security/secret-management.d.ts +83 -0
- package/dist/security/secret-management.d.ts.map +1 -0
- package/dist/security/secret-management.js +547 -0
- package/dist/security/secret-management.js.map +1 -0
- package/dist/security/sql-injection.d.ts +76 -0
- package/dist/security/sql-injection.d.ts.map +1 -0
- package/dist/security/sql-injection.js +383 -0
- package/dist/security/sql-injection.js.map +1 -0
- package/dist/security/xss-prevention.d.ts +80 -0
- package/dist/security/xss-prevention.d.ts.map +1 -0
- package/dist/security/xss-prevention.js +416 -0
- package/dist/security/xss-prevention.js.map +1 -0
- package/dist/structural/barrel-exports.d.ts +178 -0
- package/dist/structural/barrel-exports.d.ts.map +1 -0
- package/dist/structural/barrel-exports.js +553 -0
- package/dist/structural/barrel-exports.js.map +1 -0
- package/dist/structural/circular-deps.d.ts +140 -0
- package/dist/structural/circular-deps.d.ts.map +1 -0
- package/dist/structural/circular-deps.js +422 -0
- package/dist/structural/circular-deps.js.map +1 -0
- package/dist/structural/co-location.d.ts +202 -0
- package/dist/structural/co-location.d.ts.map +1 -0
- package/dist/structural/co-location.js +640 -0
- package/dist/structural/co-location.js.map +1 -0
- package/dist/structural/directory-structure.d.ts +151 -0
- package/dist/structural/directory-structure.d.ts.map +1 -0
- package/dist/structural/directory-structure.js +457 -0
- package/dist/structural/directory-structure.js.map +1 -0
- package/dist/structural/file-naming.d.ts +61 -0
- package/dist/structural/file-naming.d.ts.map +1 -0
- package/dist/structural/file-naming.js +231 -0
- package/dist/structural/file-naming.js.map +1 -0
- package/dist/structural/import-ordering.d.ts +212 -0
- package/dist/structural/import-ordering.d.ts.map +1 -0
- package/dist/structural/import-ordering.js +821 -0
- package/dist/structural/import-ordering.js.map +1 -0
- package/dist/structural/index.d.ts +23 -0
- package/dist/structural/index.d.ts.map +1 -0
- package/dist/structural/index.js +26 -0
- package/dist/structural/index.js.map +1 -0
- package/dist/structural/module-boundaries.d.ts +164 -0
- package/dist/structural/module-boundaries.d.ts.map +1 -0
- package/dist/structural/module-boundaries.js +616 -0
- package/dist/structural/module-boundaries.js.map +1 -0
- package/dist/structural/package-boundaries.d.ts +182 -0
- package/dist/structural/package-boundaries.d.ts.map +1 -0
- package/dist/structural/package-boundaries.js +602 -0
- package/dist/structural/package-boundaries.js.map +1 -0
- package/dist/styling/class-naming.d.ts +263 -0
- package/dist/styling/class-naming.d.ts.map +1 -0
- package/dist/styling/class-naming.js +892 -0
- package/dist/styling/class-naming.js.map +1 -0
- package/dist/styling/color-usage.d.ts +213 -0
- package/dist/styling/color-usage.d.ts.map +1 -0
- package/dist/styling/color-usage.js +732 -0
- package/dist/styling/color-usage.js.map +1 -0
- package/dist/styling/design-tokens.d.ts +212 -0
- package/dist/styling/design-tokens.d.ts.map +1 -0
- package/dist/styling/design-tokens.js +748 -0
- package/dist/styling/design-tokens.js.map +1 -0
- package/dist/styling/index.d.ts +16 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +56 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/responsive.d.ts +304 -0
- package/dist/styling/responsive.d.ts.map +1 -0
- package/dist/styling/responsive.js +888 -0
- package/dist/styling/responsive.js.map +1 -0
- package/dist/styling/spacing-scale.d.ts +248 -0
- package/dist/styling/spacing-scale.d.ts.map +1 -0
- package/dist/styling/spacing-scale.js +865 -0
- package/dist/styling/spacing-scale.js.map +1 -0
- package/dist/styling/tailwind-patterns.d.ts +305 -0
- package/dist/styling/tailwind-patterns.d.ts.map +1 -0
- package/dist/styling/tailwind-patterns.js +1181 -0
- package/dist/styling/tailwind-patterns.js.map +1 -0
- package/dist/styling/typography.d.ts +281 -0
- package/dist/styling/typography.d.ts.map +1 -0
- package/dist/styling/typography.js +1004 -0
- package/dist/styling/typography.js.map +1 -0
- package/dist/styling/z-index-scale.d.ts +270 -0
- package/dist/styling/z-index-scale.d.ts.map +1 -0
- package/dist/styling/z-index-scale.js +714 -0
- package/dist/styling/z-index-scale.js.map +1 -0
- package/dist/testing/co-location.d.ts +42 -0
- package/dist/testing/co-location.d.ts.map +1 -0
- package/dist/testing/co-location.js +134 -0
- package/dist/testing/co-location.js.map +1 -0
- package/dist/testing/describe-naming.d.ts +47 -0
- package/dist/testing/describe-naming.d.ts.map +1 -0
- package/dist/testing/describe-naming.js +150 -0
- package/dist/testing/describe-naming.js.map +1 -0
- package/dist/testing/file-naming.d.ts +44 -0
- package/dist/testing/file-naming.d.ts.map +1 -0
- package/dist/testing/file-naming.js +131 -0
- package/dist/testing/file-naming.js.map +1 -0
- package/dist/testing/fixture-patterns.d.ts +52 -0
- package/dist/testing/fixture-patterns.d.ts.map +1 -0
- package/dist/testing/fixture-patterns.js +228 -0
- package/dist/testing/fixture-patterns.js.map +1 -0
- package/dist/testing/index.d.ts +31 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +49 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-patterns.d.ts +53 -0
- package/dist/testing/mock-patterns.d.ts.map +1 -0
- package/dist/testing/mock-patterns.js +264 -0
- package/dist/testing/mock-patterns.js.map +1 -0
- package/dist/testing/setup-teardown.d.ts +55 -0
- package/dist/testing/setup-teardown.d.ts.map +1 -0
- package/dist/testing/setup-teardown.js +262 -0
- package/dist/testing/setup-teardown.js.map +1 -0
- package/dist/testing/test-structure.d.ts +51 -0
- package/dist/testing/test-structure.d.ts.map +1 -0
- package/dist/testing/test-structure.js +225 -0
- package/dist/testing/test-structure.js.map +1 -0
- package/dist/types/any-usage.d.ts +99 -0
- package/dist/types/any-usage.d.ts.map +1 -0
- package/dist/types/any-usage.js +641 -0
- package/dist/types/any-usage.js.map +1 -0
- package/dist/types/file-location.d.ts +76 -0
- package/dist/types/file-location.d.ts.map +1 -0
- package/dist/types/file-location.js +395 -0
- package/dist/types/file-location.js.map +1 -0
- package/dist/types/generic-patterns.d.ts +97 -0
- package/dist/types/generic-patterns.d.ts.map +1 -0
- package/dist/types/generic-patterns.js +615 -0
- package/dist/types/generic-patterns.js.map +1 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +43 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface-vs-type.d.ts +81 -0
- package/dist/types/interface-vs-type.d.ts.map +1 -0
- package/dist/types/interface-vs-type.js +440 -0
- package/dist/types/interface-vs-type.js.map +1 -0
- package/dist/types/naming-conventions.d.ts +84 -0
- package/dist/types/naming-conventions.d.ts.map +1 -0
- package/dist/types/naming-conventions.js +455 -0
- package/dist/types/naming-conventions.js.map +1 -0
- package/dist/types/type-assertions.d.ts +98 -0
- package/dist/types/type-assertions.d.ts.map +1 -0
- package/dist/types/type-assertions.js +639 -0
- package/dist/types/type-assertions.js.map +1 -0
- package/dist/types/utility-types.d.ts +110 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/types/utility-types.js +547 -0
- package/dist/types/utility-types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exception Hierarchy Detector - Exception taxonomy detection
|
|
3
|
+
*
|
|
4
|
+
* Detects exception hierarchy patterns including:
|
|
5
|
+
* - AppError base class inheritance
|
|
6
|
+
* - Custom error class definitions
|
|
7
|
+
* - Error class naming conventions
|
|
8
|
+
* - Error inheritance chains
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Throwing raw Error instead of custom errors
|
|
12
|
+
* - Inconsistent error class naming
|
|
13
|
+
* - Missing error inheritance
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.1 - Exception hierarchy patterns
|
|
16
|
+
*/
|
|
17
|
+
import { RegexDetector } from '../base/index.js';
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Constants
|
|
20
|
+
// ============================================================================
|
|
21
|
+
export const APP_ERROR_PATTERNS = [
|
|
22
|
+
// JavaScript/TypeScript
|
|
23
|
+
/class\s+AppError\s+extends\s+Error/gi,
|
|
24
|
+
/class\s+BaseError\s+extends\s+Error/gi,
|
|
25
|
+
/class\s+ApplicationError\s+extends\s+Error/gi,
|
|
26
|
+
// Python
|
|
27
|
+
/class\s+AppError\s*\(\s*Exception\s*\)/gi,
|
|
28
|
+
/class\s+BaseError\s*\(\s*Exception\s*\)/gi,
|
|
29
|
+
/class\s+ApplicationError\s*\(\s*Exception\s*\)/gi,
|
|
30
|
+
];
|
|
31
|
+
export const CUSTOM_ERROR_PATTERNS = [
|
|
32
|
+
// JavaScript/TypeScript
|
|
33
|
+
/class\s+(\w+Error)\s+extends\s+(?:App|Base|Application)?Error/gi,
|
|
34
|
+
/class\s+(\w+Exception)\s+extends\s+(?:App|Base|Application)?Error/gi,
|
|
35
|
+
// Python
|
|
36
|
+
/class\s+(\w+Error)\s*\(\s*(?:App|Base|Application)?Error\s*\)/gi,
|
|
37
|
+
/class\s+(\w+Exception)\s*\(\s*(?:App|Base|Application)?Exception\s*\)/gi,
|
|
38
|
+
/class\s+(\w+Error)\s*\(\s*Exception\s*\)/gi,
|
|
39
|
+
];
|
|
40
|
+
export const ERROR_INHERITANCE_PATTERNS = [
|
|
41
|
+
// JavaScript/TypeScript
|
|
42
|
+
/class\s+(\w+)\s+extends\s+(\w+Error)/gi,
|
|
43
|
+
/class\s+(\w+)\s+extends\s+(\w+Exception)/gi,
|
|
44
|
+
// Python
|
|
45
|
+
/class\s+(\w+)\s*\(\s*(\w+Error)\s*\)/gi,
|
|
46
|
+
/class\s+(\w+)\s*\(\s*(\w+Exception)\s*\)/gi,
|
|
47
|
+
];
|
|
48
|
+
export const ERROR_FACTORY_PATTERNS = [
|
|
49
|
+
// JavaScript/TypeScript
|
|
50
|
+
/function\s+create\w*Error\s*\(/gi,
|
|
51
|
+
/const\s+create\w*Error\s*=/gi,
|
|
52
|
+
/export\s+(?:function|const)\s+\w*Error(?:Factory)?\s*[=(]/gi,
|
|
53
|
+
// Python
|
|
54
|
+
/def\s+create_\w*error\s*\(/gi,
|
|
55
|
+
/def\s+make_\w*error\s*\(/gi,
|
|
56
|
+
];
|
|
57
|
+
export const RAW_ERROR_PATTERNS = [
|
|
58
|
+
// JavaScript/TypeScript
|
|
59
|
+
/throw\s+new\s+Error\s*\(/gi,
|
|
60
|
+
/throw\s+Error\s*\(/gi,
|
|
61
|
+
// Python
|
|
62
|
+
/raise\s+Exception\s*\(/gi,
|
|
63
|
+
/raise\s+RuntimeError\s*\(/gi,
|
|
64
|
+
/raise\s+ValueError\s*\(/gi,
|
|
65
|
+
];
|
|
66
|
+
export const EXCLUDED_FILE_PATTERNS = [
|
|
67
|
+
/\.test\.[jt]sx?$/,
|
|
68
|
+
/\.spec\.[jt]sx?$/,
|
|
69
|
+
/node_modules\//,
|
|
70
|
+
/\.d\.ts$/,
|
|
71
|
+
];
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// Helper Functions
|
|
74
|
+
// ============================================================================
|
|
75
|
+
export function shouldExcludeFile(filePath) {
|
|
76
|
+
return EXCLUDED_FILE_PATTERNS.some(p => p.test(filePath));
|
|
77
|
+
}
|
|
78
|
+
function isInsideComment(content, index) {
|
|
79
|
+
const before = content.slice(0, index);
|
|
80
|
+
const lastNewline = before.lastIndexOf('\n');
|
|
81
|
+
const line = before.slice(lastNewline + 1);
|
|
82
|
+
if (line.includes('//') && index - lastNewline - 1 > line.indexOf('//'))
|
|
83
|
+
return true;
|
|
84
|
+
return before.lastIndexOf('/*') > before.lastIndexOf('*/');
|
|
85
|
+
}
|
|
86
|
+
function getPosition(content, index) {
|
|
87
|
+
const before = content.slice(0, index);
|
|
88
|
+
return { line: before.split('\n').length, column: index - before.lastIndexOf('\n') };
|
|
89
|
+
}
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Detection Functions
|
|
92
|
+
// ============================================================================
|
|
93
|
+
export function detectAppErrorClasses(content, file) {
|
|
94
|
+
const results = [];
|
|
95
|
+
const lines = content.split('\n');
|
|
96
|
+
for (const pattern of APP_ERROR_PATTERNS) {
|
|
97
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
98
|
+
let match;
|
|
99
|
+
while ((match = regex.exec(content)) !== null) {
|
|
100
|
+
if (isInsideComment(content, match.index))
|
|
101
|
+
continue;
|
|
102
|
+
const { line, column } = getPosition(content, match.index);
|
|
103
|
+
results.push({
|
|
104
|
+
type: 'app-error-class',
|
|
105
|
+
file, line, column,
|
|
106
|
+
matchedText: match[0],
|
|
107
|
+
className: match[0].match(/class\s+(\w+)/)?.[1],
|
|
108
|
+
context: lines[line - 1] || '',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return results;
|
|
113
|
+
}
|
|
114
|
+
export function detectCustomErrorClasses(content, file) {
|
|
115
|
+
const results = [];
|
|
116
|
+
const lines = content.split('\n');
|
|
117
|
+
for (const pattern of CUSTOM_ERROR_PATTERNS) {
|
|
118
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
119
|
+
let match;
|
|
120
|
+
while ((match = regex.exec(content)) !== null) {
|
|
121
|
+
if (isInsideComment(content, match.index))
|
|
122
|
+
continue;
|
|
123
|
+
const { line, column } = getPosition(content, match.index);
|
|
124
|
+
const classMatch = match[0].match(/class\s+(\w+)\s+extends\s+(\w+)/);
|
|
125
|
+
results.push({
|
|
126
|
+
type: 'custom-error-class',
|
|
127
|
+
file, line, column,
|
|
128
|
+
matchedText: match[0],
|
|
129
|
+
className: classMatch?.[1],
|
|
130
|
+
baseClass: classMatch?.[2],
|
|
131
|
+
context: lines[line - 1] || '',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return results;
|
|
136
|
+
}
|
|
137
|
+
export function detectErrorInheritance(content, file) {
|
|
138
|
+
const results = [];
|
|
139
|
+
const lines = content.split('\n');
|
|
140
|
+
for (const pattern of ERROR_INHERITANCE_PATTERNS) {
|
|
141
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
142
|
+
let match;
|
|
143
|
+
while ((match = regex.exec(content)) !== null) {
|
|
144
|
+
if (isInsideComment(content, match.index))
|
|
145
|
+
continue;
|
|
146
|
+
const { line, column } = getPosition(content, match.index);
|
|
147
|
+
const classMatch = match[0].match(/class\s+(\w+)\s+extends\s+(\w+)/);
|
|
148
|
+
results.push({
|
|
149
|
+
type: 'error-inheritance',
|
|
150
|
+
file, line, column,
|
|
151
|
+
matchedText: match[0],
|
|
152
|
+
className: classMatch?.[1],
|
|
153
|
+
baseClass: classMatch?.[2],
|
|
154
|
+
context: lines[line - 1] || '',
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return results;
|
|
159
|
+
}
|
|
160
|
+
export function detectErrorFactories(content, file) {
|
|
161
|
+
const results = [];
|
|
162
|
+
const lines = content.split('\n');
|
|
163
|
+
for (const pattern of ERROR_FACTORY_PATTERNS) {
|
|
164
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
165
|
+
let match;
|
|
166
|
+
while ((match = regex.exec(content)) !== null) {
|
|
167
|
+
if (isInsideComment(content, match.index))
|
|
168
|
+
continue;
|
|
169
|
+
const { line, column } = getPosition(content, match.index);
|
|
170
|
+
results.push({
|
|
171
|
+
type: 'error-factory',
|
|
172
|
+
file, line, column,
|
|
173
|
+
matchedText: match[0],
|
|
174
|
+
context: lines[line - 1] || '',
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return results;
|
|
179
|
+
}
|
|
180
|
+
export function detectRawErrorViolations(patterns, content, file) {
|
|
181
|
+
const violations = [];
|
|
182
|
+
const lines = content.split('\n');
|
|
183
|
+
const hasCustomErrors = patterns.length > 0;
|
|
184
|
+
// Only flag raw errors if the file has custom error classes
|
|
185
|
+
if (!hasCustomErrors)
|
|
186
|
+
return violations;
|
|
187
|
+
for (const pattern of RAW_ERROR_PATTERNS) {
|
|
188
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
189
|
+
let match;
|
|
190
|
+
while ((match = regex.exec(content)) !== null) {
|
|
191
|
+
if (isInsideComment(content, match.index))
|
|
192
|
+
continue;
|
|
193
|
+
const { line, column } = getPosition(content, match.index);
|
|
194
|
+
violations.push({
|
|
195
|
+
type: 'raw-error-throw',
|
|
196
|
+
file, line, column,
|
|
197
|
+
endLine: line,
|
|
198
|
+
endColumn: column + match[0].length,
|
|
199
|
+
value: match[0],
|
|
200
|
+
issue: 'Throwing raw Error instead of custom error class',
|
|
201
|
+
suggestedFix: 'Use a custom error class that extends AppError',
|
|
202
|
+
lineContent: lines[line - 1] || '',
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return violations;
|
|
207
|
+
}
|
|
208
|
+
// ============================================================================
|
|
209
|
+
// Main Analysis Function
|
|
210
|
+
// ============================================================================
|
|
211
|
+
export function analyzeExceptionHierarchy(content, file) {
|
|
212
|
+
if (shouldExcludeFile(file)) {
|
|
213
|
+
return { patterns: [], violations: [], hasCustomErrors: false, hasAppError: false, errorClasses: [], confidence: 1.0 };
|
|
214
|
+
}
|
|
215
|
+
const appErrors = detectAppErrorClasses(content, file);
|
|
216
|
+
const customErrors = detectCustomErrorClasses(content, file);
|
|
217
|
+
const inheritance = detectErrorInheritance(content, file);
|
|
218
|
+
const factories = detectErrorFactories(content, file);
|
|
219
|
+
const allPatterns = [...appErrors, ...customErrors, ...inheritance, ...factories];
|
|
220
|
+
const violations = detectRawErrorViolations(allPatterns, content, file);
|
|
221
|
+
const errorClasses = allPatterns
|
|
222
|
+
.filter(p => p.className)
|
|
223
|
+
.map(p => p.className)
|
|
224
|
+
.filter((v, i, a) => a.indexOf(v) === i);
|
|
225
|
+
const confidence = allPatterns.length > 0 ? Math.max(0.5, 1 - violations.length * 0.1) : 1.0;
|
|
226
|
+
return {
|
|
227
|
+
patterns: allPatterns,
|
|
228
|
+
violations,
|
|
229
|
+
hasCustomErrors: customErrors.length > 0 || inheritance.length > 0,
|
|
230
|
+
hasAppError: appErrors.length > 0,
|
|
231
|
+
errorClasses,
|
|
232
|
+
confidence,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// ============================================================================
|
|
236
|
+
// Detector Class
|
|
237
|
+
// ============================================================================
|
|
238
|
+
export class ExceptionHierarchyDetector extends RegexDetector {
|
|
239
|
+
id = 'errors/exception-hierarchy';
|
|
240
|
+
name = 'Exception Hierarchy Detector';
|
|
241
|
+
description = 'Detects exception hierarchy and custom error patterns';
|
|
242
|
+
category = 'errors';
|
|
243
|
+
subcategory = 'hierarchy';
|
|
244
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
245
|
+
async detect(context) {
|
|
246
|
+
const { content, file } = context;
|
|
247
|
+
if (shouldExcludeFile(file))
|
|
248
|
+
return this.createEmptyResult();
|
|
249
|
+
const analysis = analyzeExceptionHierarchy(content, file);
|
|
250
|
+
return this.createResult([], [], analysis.confidence);
|
|
251
|
+
}
|
|
252
|
+
generateQuickFix() {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
export function createExceptionHierarchyDetector() {
|
|
257
|
+
return new ExceptionHierarchyDetector();
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=exception-hierarchy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exception-hierarchy.js","sourceRoot":"","sources":["../../src/errors/exception-hierarchy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,aAAa,EAA+C,MAAM,kBAAkB,CAAC;AAkD9F,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,wBAAwB;IACxB,sCAAsC;IACtC,uCAAuC;IACvC,8CAA8C;IAC9C,SAAS;IACT,0CAA0C;IAC1C,2CAA2C;IAC3C,kDAAkD;CAC1C,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB;IACxB,iEAAiE;IACjE,qEAAqE;IACrE,SAAS;IACT,iEAAiE;IACjE,yEAAyE;IACzE,4CAA4C;CACpC,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,wBAAwB;IACxB,wCAAwC;IACxC,4CAA4C;IAC5C,SAAS;IACT,wCAAwC;IACxC,4CAA4C;CACpC,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,wBAAwB;IACxB,kCAAkC;IAClC,8BAA8B;IAC9B,6DAA6D;IAC7D,SAAS;IACT,8BAA8B;IAC9B,4BAA4B;CACpB,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,wBAAwB;IACxB,4BAA4B;IAC5B,sBAAsB;IACtB,SAAS;IACT,0BAA0B;IAC1B,6BAA6B;IAC7B,2BAA2B;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;CACX,CAAC;AAEF,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAA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AAU;QACV,eAAe,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;QAClE,WAAW,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;QACjC,YAAY;QACZ,UAAU;KACX,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,OAAO,0BAA2B,SAAQ,aAAa;IAClD,EAAE,GAAG,4BAA4B,CAAC;IAClC,IAAI,GAAG,8BAA8B,CAAC;IACtC,WAAW,GAAG,uDAAuD,CAAC;IACtE,QAAQ,GAAG,QAAQ,CAAC;IACpB,WAAW,GAAG,WAAW,CAAC;IAC1B,kBAAkB,GAAe,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEjF,KAAK,CAAC,MAAM,CAAC,OAAyB;QACpC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAClC,IAAI,iBAAiB,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE7D,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,UAAU,gCAAgC;IAC9C,OAAO,IAAI,0BAA0B,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error detectors module exports
|
|
3
|
+
*
|
|
4
|
+
* Detects error handling patterns including:
|
|
5
|
+
* - Exception hierarchy patterns
|
|
6
|
+
* - Error code patterns
|
|
7
|
+
* - Try/catch placement patterns
|
|
8
|
+
* - Error propagation patterns
|
|
9
|
+
* - Async error handling patterns
|
|
10
|
+
* - Circuit breaker patterns
|
|
11
|
+
* - Error logging patterns
|
|
12
|
+
*
|
|
13
|
+
* @requirements 12.1-12.8 - Error handling patterns
|
|
14
|
+
*/
|
|
15
|
+
export { type ExceptionPatternType, type ExceptionViolationType, type ExceptionPatternInfo, type ExceptionViolationInfo, type ExceptionAnalysis, APP_ERROR_PATTERNS, CUSTOM_ERROR_PATTERNS, ERROR_INHERITANCE_PATTERNS, ERROR_FACTORY_PATTERNS, RAW_ERROR_PATTERNS, shouldExcludeFile as shouldExcludeExceptionFile, detectAppErrorClasses, detectCustomErrorClasses, detectErrorInheritance, detectErrorFactories, detectRawErrorViolations, analyzeExceptionHierarchy, ExceptionHierarchyDetector, createExceptionHierarchyDetector, } from './exception-hierarchy.js';
|
|
16
|
+
export { type ErrorCodePatternType, type ErrorCodeViolationType, type ErrorCodePatternInfo, type ErrorCodeViolationInfo, type ErrorCodeAnalysis, ERROR_CODE_ENUM_PATTERNS, ERROR_CODE_CONST_PATTERNS, ERROR_CODE_USAGE_PATTERNS, ERROR_CODE_TYPE_PATTERNS, MAGIC_STRING_CODE_PATTERNS, shouldExcludeFile as shouldExcludeErrorCodeFile, detectErrorCodeEnums, detectErrorCodeConstants, detectErrorCodeUsage, detectMagicStringViolations, analyzeErrorCodes, ErrorCodesDetector, createErrorCodesDetector, } from './error-codes.js';
|
|
17
|
+
export { type TryCatchPatternType, type TryCatchViolationType, type TryCatchPatternInfo, type TryCatchViolationInfo, type TryCatchAnalysis, TRY_CATCH_PATTERNS, TRY_CATCH_FINALLY_PATTERNS, TYPED_CATCH_PATTERNS, EMPTY_CATCH_PATTERNS, shouldExcludeFile as shouldExcludeTryCatchFile, detectTryCatchBlocks, detectTryCatchFinally, detectTypedCatch, detectEmptyCatchViolations, analyzeTryCatchPlacement, TryCatchPlacementDetector, createTryCatchPlacementDetector, } from './try-catch-placement.js';
|
|
18
|
+
export { type PropagationPatternType, type PropagationViolationType, type PropagationPatternInfo, type PropagationViolationInfo, type PropagationAnalysis, RETHROW_PATTERNS, WRAP_RETHROW_PATTERNS, TRANSFORM_PATTERNS, CHAIN_PRESERVE_PATTERNS, LOST_CONTEXT_PATTERNS, shouldExcludeFile as shouldExcludePropagationFile, detectRethrowPatterns, detectWrapRethrowPatterns, detectTransformPatterns, detectChainPreservePatterns, detectLostContextViolations, analyzeErrorPropagation, ErrorPropagationDetector, createErrorPropagationDetector, } from './error-propagation.js';
|
|
19
|
+
export { type AsyncErrorPatternType, type AsyncErrorViolationType, type AsyncErrorPatternInfo, type AsyncErrorViolationInfo, type AsyncErrorAnalysis, ASYNC_TRY_CATCH_PATTERNS, PROMISE_CATCH_PATTERNS, PROMISE_FINALLY_PATTERNS, ERROR_BOUNDARY_PATTERNS, shouldExcludeFile as shouldExcludeAsyncErrorFile, detectAsyncTryCatch, detectPromiseCatch, detectPromiseFinally, detectErrorBoundaries, analyzeAsyncErrors, AsyncErrorsDetector, createAsyncErrorsDetector, } from './async-errors.js';
|
|
20
|
+
export { type CircuitBreakerPatternType, type CircuitBreakerPatternInfo, type CircuitBreakerAnalysis, CIRCUIT_BREAKER_CLASS_PATTERNS, CIRCUIT_BREAKER_LIB_PATTERNS, STATE_MANAGEMENT_PATTERNS, FAILURE_THRESHOLD_PATTERNS, RESET_TIMEOUT_PATTERNS, shouldExcludeFile as shouldExcludeCircuitBreakerFile, detectCircuitBreakerClasses, detectCircuitBreakerLibs, detectStateManagement, detectFailureThreshold, detectResetTimeout, analyzeCircuitBreaker, CircuitBreakerDetector, createCircuitBreakerDetector, } from './circuit-breaker.js';
|
|
21
|
+
export { type ErrorLoggingPatternType, type ErrorLoggingViolationType, type ErrorLoggingPatternInfo, type ErrorLoggingViolationInfo, type ErrorLoggingAnalysis, LOGGER_ERROR_PATTERNS, STRUCTURED_LOG_PATTERNS, CONTEXT_LOG_PATTERNS, STACK_TRACE_PATTERNS, CONSOLE_ERROR_PATTERNS, shouldExcludeFile as shouldExcludeErrorLoggingFile, detectLoggerError, detectStructuredLogging, detectContextLogging, detectStackTraceLogging, detectConsoleErrorViolations, analyzeErrorLogging, ErrorLoggingDetector, createErrorLoggingDetector, } from './error-logging.js';
|
|
22
|
+
export declare function createAllErrorDetectors(): {
|
|
23
|
+
exceptionHierarchy: import("./exception-hierarchy.js").ExceptionHierarchyDetector;
|
|
24
|
+
errorCodes: import("./error-codes.js").ErrorCodesDetector;
|
|
25
|
+
tryCatchPlacement: import("./try-catch-placement.js").TryCatchPlacementDetector;
|
|
26
|
+
errorPropagation: import("./error-propagation.js").ErrorPropagationDetector;
|
|
27
|
+
asyncErrors: import("./async-errors.js").AsyncErrorsDetector;
|
|
28
|
+
circuitBreaker: import("./circuit-breaker.js").CircuitBreakerDetector;
|
|
29
|
+
errorLogging: import("./error-logging.js").ErrorLoggingDetector;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,IAAI,0BAA0B,EAC/C,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,IAAI,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B,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,IAAI,+BAA+B,EACpD,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,IAAI,6BAA6B,EAClD,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAY5B,wBAAgB,uBAAuB;;;;;;;;EAUtC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error detectors module exports
|
|
3
|
+
*
|
|
4
|
+
* Detects error handling patterns including:
|
|
5
|
+
* - Exception hierarchy patterns
|
|
6
|
+
* - Error code patterns
|
|
7
|
+
* - Try/catch placement patterns
|
|
8
|
+
* - Error propagation patterns
|
|
9
|
+
* - Async error handling patterns
|
|
10
|
+
* - Circuit breaker patterns
|
|
11
|
+
* - Error logging patterns
|
|
12
|
+
*
|
|
13
|
+
* @requirements 12.1-12.8 - Error handling patterns
|
|
14
|
+
*/
|
|
15
|
+
// Exception Hierarchy Detector
|
|
16
|
+
export { APP_ERROR_PATTERNS, CUSTOM_ERROR_PATTERNS, ERROR_INHERITANCE_PATTERNS, ERROR_FACTORY_PATTERNS, RAW_ERROR_PATTERNS, shouldExcludeFile as shouldExcludeExceptionFile, detectAppErrorClasses, detectCustomErrorClasses, detectErrorInheritance, detectErrorFactories, detectRawErrorViolations, analyzeExceptionHierarchy, ExceptionHierarchyDetector, createExceptionHierarchyDetector, } from './exception-hierarchy.js';
|
|
17
|
+
// Error Codes Detector
|
|
18
|
+
export { ERROR_CODE_ENUM_PATTERNS, ERROR_CODE_CONST_PATTERNS, ERROR_CODE_USAGE_PATTERNS, ERROR_CODE_TYPE_PATTERNS, MAGIC_STRING_CODE_PATTERNS, shouldExcludeFile as shouldExcludeErrorCodeFile, detectErrorCodeEnums, detectErrorCodeConstants, detectErrorCodeUsage, detectMagicStringViolations, analyzeErrorCodes, ErrorCodesDetector, createErrorCodesDetector, } from './error-codes.js';
|
|
19
|
+
// Try-Catch Placement Detector
|
|
20
|
+
export { TRY_CATCH_PATTERNS, TRY_CATCH_FINALLY_PATTERNS, TYPED_CATCH_PATTERNS, EMPTY_CATCH_PATTERNS, shouldExcludeFile as shouldExcludeTryCatchFile, detectTryCatchBlocks, detectTryCatchFinally, detectTypedCatch, detectEmptyCatchViolations, analyzeTryCatchPlacement, TryCatchPlacementDetector, createTryCatchPlacementDetector, } from './try-catch-placement.js';
|
|
21
|
+
// Error Propagation Detector
|
|
22
|
+
export { RETHROW_PATTERNS, WRAP_RETHROW_PATTERNS, TRANSFORM_PATTERNS, CHAIN_PRESERVE_PATTERNS, LOST_CONTEXT_PATTERNS, shouldExcludeFile as shouldExcludePropagationFile, detectRethrowPatterns, detectWrapRethrowPatterns, detectTransformPatterns, detectChainPreservePatterns, detectLostContextViolations, analyzeErrorPropagation, ErrorPropagationDetector, createErrorPropagationDetector, } from './error-propagation.js';
|
|
23
|
+
// Async Errors Detector
|
|
24
|
+
export { ASYNC_TRY_CATCH_PATTERNS, PROMISE_CATCH_PATTERNS, PROMISE_FINALLY_PATTERNS, ERROR_BOUNDARY_PATTERNS, shouldExcludeFile as shouldExcludeAsyncErrorFile, detectAsyncTryCatch, detectPromiseCatch, detectPromiseFinally, detectErrorBoundaries, analyzeAsyncErrors, AsyncErrorsDetector, createAsyncErrorsDetector, } from './async-errors.js';
|
|
25
|
+
// Circuit Breaker Detector
|
|
26
|
+
export { CIRCUIT_BREAKER_CLASS_PATTERNS, CIRCUIT_BREAKER_LIB_PATTERNS, STATE_MANAGEMENT_PATTERNS, FAILURE_THRESHOLD_PATTERNS, RESET_TIMEOUT_PATTERNS, shouldExcludeFile as shouldExcludeCircuitBreakerFile, detectCircuitBreakerClasses, detectCircuitBreakerLibs, detectStateManagement, detectFailureThreshold, detectResetTimeout, analyzeCircuitBreaker, CircuitBreakerDetector, createCircuitBreakerDetector, } from './circuit-breaker.js';
|
|
27
|
+
// Error Logging Detector
|
|
28
|
+
export { LOGGER_ERROR_PATTERNS, STRUCTURED_LOG_PATTERNS, CONTEXT_LOG_PATTERNS, STACK_TRACE_PATTERNS, CONSOLE_ERROR_PATTERNS, shouldExcludeFile as shouldExcludeErrorLoggingFile, detectLoggerError, detectStructuredLogging, detectContextLogging, detectStackTraceLogging, detectConsoleErrorViolations, analyzeErrorLogging, ErrorLoggingDetector, createErrorLoggingDetector, } from './error-logging.js';
|
|
29
|
+
// Import factory functions for createAllErrorDetectors
|
|
30
|
+
import { createExceptionHierarchyDetector } from './exception-hierarchy.js';
|
|
31
|
+
import { createErrorCodesDetector } from './error-codes.js';
|
|
32
|
+
import { createTryCatchPlacementDetector } from './try-catch-placement.js';
|
|
33
|
+
import { createErrorPropagationDetector } from './error-propagation.js';
|
|
34
|
+
import { createAsyncErrorsDetector } from './async-errors.js';
|
|
35
|
+
import { createCircuitBreakerDetector } from './circuit-breaker.js';
|
|
36
|
+
import { createErrorLoggingDetector } from './error-logging.js';
|
|
37
|
+
// Convenience factory for all error detectors
|
|
38
|
+
export function createAllErrorDetectors() {
|
|
39
|
+
return {
|
|
40
|
+
exceptionHierarchy: createExceptionHierarchyDetector(),
|
|
41
|
+
errorCodes: createErrorCodesDetector(),
|
|
42
|
+
tryCatchPlacement: createTryCatchPlacementDetector(),
|
|
43
|
+
errorPropagation: createErrorPropagationDetector(),
|
|
44
|
+
asyncErrors: createAsyncErrorsDetector(),
|
|
45
|
+
circuitBreaker: createCircuitBreakerDetector(),
|
|
46
|
+
errorLogging: createErrorLoggingDetector(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,+BAA+B;AAC/B,OAAO,EAML,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,IAAI,0BAA0B,EAC/C,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAElC,uBAAuB;AACvB,OAAO,EAML,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,IAAI,0BAA0B,EAC/C,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,+BAA+B;AAC/B,OAAO,EAML,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,IAAI,yBAAyB,EAC9C,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,0BAA0B,CAAC;AAElC,6BAA6B;AAC7B,OAAO,EAML,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,IAAI,4BAA4B,EACjD,qBAAqB,EACr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AAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,8CAA8C;AAC9C,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,kBAAkB,EAAE,gCAAgC,EAAE;QACtD,UAAU,EAAE,wBAAwB,EAAE;QACtC,iBAAiB,EAAE,+BAA+B,EAAE;QACpD,gBAAgB,EAAE,8BAA8B,EAAE;QAClD,WAAW,EAAE,yBAAyB,EAAE;QACxC,cAAc,EAAE,4BAA4B,EAAE;QAC9C,YAAY,EAAE,0BAA0B,EAAE;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Try-Catch Placement Detector - Try/catch pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects try/catch placement patterns including:
|
|
5
|
+
* - Try/catch at function boundaries
|
|
6
|
+
* - Nested try/catch blocks
|
|
7
|
+
* - Try/catch with specific error types
|
|
8
|
+
* - Finally block usage
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Empty catch blocks
|
|
12
|
+
* - Catch-all without re-throw
|
|
13
|
+
* - Deeply nested try/catch
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.3 - Try/catch placement patterns
|
|
16
|
+
*/
|
|
17
|
+
import type { Language } from 'driftdetect-core';
|
|
18
|
+
import { RegexDetector, type DetectionContext, type DetectionResult } from '../base/index.js';
|
|
19
|
+
export type TryCatchPatternType = 'try-catch-block' | 'try-catch-finally' | 'typed-catch' | 'boundary-catch';
|
|
20
|
+
export type TryCatchViolationType = 'empty-catch' | 'catch-all-no-rethrow' | 'deeply-nested';
|
|
21
|
+
export interface TryCatchPatternInfo {
|
|
22
|
+
type: TryCatchPatternType;
|
|
23
|
+
file: string;
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
matchedText: string;
|
|
27
|
+
hasFinally?: boolean;
|
|
28
|
+
errorType?: string;
|
|
29
|
+
context?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TryCatchViolationInfo {
|
|
32
|
+
type: TryCatchViolationType;
|
|
33
|
+
file: string;
|
|
34
|
+
line: number;
|
|
35
|
+
column: number;
|
|
36
|
+
endLine: number;
|
|
37
|
+
endColumn: number;
|
|
38
|
+
value: string;
|
|
39
|
+
issue: string;
|
|
40
|
+
suggestedFix?: string;
|
|
41
|
+
lineContent: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TryCatchAnalysis {
|
|
44
|
+
patterns: TryCatchPatternInfo[];
|
|
45
|
+
violations: TryCatchViolationInfo[];
|
|
46
|
+
hasTryCatch: boolean;
|
|
47
|
+
hasFinally: boolean;
|
|
48
|
+
confidence: number;
|
|
49
|
+
}
|
|
50
|
+
export declare const TRY_CATCH_PATTERNS: readonly [RegExp, RegExp];
|
|
51
|
+
export declare const TRY_CATCH_FINALLY_PATTERNS: readonly [RegExp, RegExp];
|
|
52
|
+
export declare const TYPED_CATCH_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
53
|
+
export declare const EMPTY_CATCH_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
54
|
+
export declare const CATCH_ALL_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
55
|
+
export declare const EXCLUDED_FILE_PATTERNS: RegExp[];
|
|
56
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
57
|
+
export declare function detectTryCatchBlocks(content: string, file: string): TryCatchPatternInfo[];
|
|
58
|
+
export declare function detectTryCatchFinally(content: string, file: string): TryCatchPatternInfo[];
|
|
59
|
+
export declare function detectTypedCatch(content: string, file: string): TryCatchPatternInfo[];
|
|
60
|
+
export declare function detectEmptyCatchViolations(content: string, file: string): TryCatchViolationInfo[];
|
|
61
|
+
export declare function analyzeTryCatchPlacement(content: string, file: string): TryCatchAnalysis;
|
|
62
|
+
export declare class TryCatchPlacementDetector extends RegexDetector {
|
|
63
|
+
readonly id = "errors/try-catch-placement";
|
|
64
|
+
readonly name = "Try-Catch Placement Detector";
|
|
65
|
+
readonly description = "Detects try/catch placement patterns";
|
|
66
|
+
readonly category = "errors";
|
|
67
|
+
readonly subcategory = "try-catch";
|
|
68
|
+
readonly supportedLanguages: Language[];
|
|
69
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
70
|
+
generateQuickFix(): null;
|
|
71
|
+
}
|
|
72
|
+
export declare function createTryCatchPlacementDetector(): TryCatchPlacementDetector;
|
|
73
|
+
//# sourceMappingURL=try-catch-placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try-catch-placement.d.ts","sourceRoot":"","sources":["../../src/errors/try-catch-placement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAM9F,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,GACb,gBAAgB,CAAC;AAErB,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,sBAAsB,GACtB,eAAe,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAA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