Socket
Socket
Sign inDemoInstall

@sa11y/format

Package Overview
Dependencies
3
Maintainers
0
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.9.5-alpha.4 to 6.9.5

6

dist/result.d.ts
import { AxeResults } from '@sa11y/common';
import { NodeResult, Result } from 'axe-core';
import { NodeResult, Result, CheckResult } from 'axe-core';
export declare class A11yResults {

@@ -39,2 +39,5 @@ private static consolidated;

readonly none: string;
readonly relatedNodeAny: string;
readonly relatedNodeAll: string;
readonly relatedNodeNone: string;
private readonly wcagData;

@@ -46,2 +49,3 @@ constructor(violation: Result, node: NodeResult);

static sort(results: A11yResult[]): A11yResult[];
formatRelatedNodes(node: CheckResult[]): string;
}

@@ -48,0 +52,0 @@ /**

@@ -6,3 +6,3 @@ "use strict";

const defaultImpact = 'minor'; // if impact is undefined
const formatSpacing = '\t'.repeat(12);
const formatSpacing = '\t'.repeat(6);
// Helper object to sort violations by impact order

@@ -70,3 +70,3 @@ const impactOrder = {

this.id = violation.id;
this.description = violation.help;
this.description = violation.description;
this.wcagData = new preset_rules_1.WcagMetadata(violation);

@@ -85,2 +85,5 @@ this.wcag = this.wcagData.toString();

this.none = node.none?.map((item) => `${formatSpacing}• ${item.message}`).join('\n');
this.relatedNodeAny = this.formatRelatedNodes(node.any);
this.relatedNodeAll = this.formatRelatedNodes(node.all);
this.relatedNodeNone = this.formatRelatedNodes(node.none);
}

@@ -99,2 +102,10 @@ /**

}
formatRelatedNodes(node) {
return node
?.map((item) => item.relatedNodes && item.relatedNodes.length > 0
? item.relatedNodes.map((relatedNode) => `${formatSpacing}• ${relatedNode.html}`).join('\n')
: null)
.filter(Boolean)
.join('\n');
}
}

@@ -101,0 +112,0 @@ exports.A11yResult = A11yResult;

10

package.json
{
"name": "@sa11y/format",
"version": "6.9.5-alpha.4",
"version": "6.9.5",
"description": "Accessibility results re-formatter",

@@ -27,4 +27,4 @@ "license": "BSD-3-Clause",

"dependencies": {
"@sa11y/common": "6.9.5-alpha.4",
"@sa11y/preset-rules": "6.9.5-alpha.4",
"@sa11y/common": "6.9.5",
"@sa11y/preset-rules": "6.9.5",
"axe-core": "4.9.0"

@@ -34,3 +34,3 @@ },

"@jest/globals": "28.1.3",
"@sa11y/test-utils": "6.9.5-alpha.4"
"@sa11y/test-utils": "6.9.5"
},

@@ -43,3 +43,3 @@ "publishConfig": {

},
"gitHead": "f76314d90c55041be24e945d6cd424f59a38c368"
"gitHead": "20778083b656180c2b077a4a7148cf813c05d040"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc