Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sa11y/common

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sa11y/common - npm Package Compare versions

Comparing version 6.3.0-alpha.1 to 6.3.0

6

dist/format.d.ts

@@ -9,8 +9,4 @@ import { AxeResults } from './axe';

}
type MultiArray<T> = [T, T, ...T[]];
type BaseSelector = string;
type ShadowDomSelector = MultiArray<BaseSelector>;
type CrossTreeSelector = BaseSelector | ShadowDomSelector;
type RuleID = string;
type CssSelectors = CrossTreeSelector[];
type CssSelectors = string[];
/**

@@ -17,0 +13,0 @@ * Exception list of map of rule to corresponding css targets that needs to be filtered from a11y results.

5

dist/helpers.d.ts

@@ -1,7 +0,4 @@

/**
* Convenience wrapper to prefix a standard header for console log messages.
* Logging is enabled only when environment variable `SA11Y_DEBUG` is set.
*/
export declare function log(...args: unknown[]): void;
export declare function useFilesToBeExempted(): string[];
export declare function useCustomRules(): Promise<string[]>;
//# sourceMappingURL=helpers.d.ts.map

@@ -8,4 +8,27 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useFilesToBeExempted = exports.log = void 0;
exports.useCustomRules = exports.useFilesToBeExempted = exports.log = void 0;
/**

@@ -15,2 +38,3 @@ * Convenience wrapper to prefix a standard header for console log messages.

*/
const fs = __importStar(require("fs/promises"));
function log(...args) {

@@ -40,2 +64,19 @@ // Probably not worth it to mock and test console logging for this helper util

exports.useFilesToBeExempted = useFilesToBeExempted;
async function useCustomRules() {
const filePath = process.env.SA11Y_CUSTOM_RULES ?? '';
if (filePath !== '') {
try {
// Read the file asynchronously
const data = await fs.readFile(filePath, 'utf-8');
const { rules } = JSON.parse(data);
// Access the rules array
return rules;
}
catch (err) {
console.error('Error reading the custom ruleset file:', err);
}
}
return [];
}
exports.useCustomRules = useCustomRules;
//# sourceMappingURL=helpers.js.map
export { A11yConfig, AxeResults, axeRuntimeExceptionMsgPrefix, axeVersion, getAxeRules, getViolations } from './axe';
export { WdioAssertFunction, WdioOptions } from './wdio';
export { errMsgHeader, ExceptionList } from './format';
export { log, useFilesToBeExempted } from './helpers';
export { log, useFilesToBeExempted, useCustomRules } from './helpers';
//# sourceMappingURL=index.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.useFilesToBeExempted = exports.log = exports.errMsgHeader = exports.getViolations = exports.getAxeRules = exports.axeVersion = exports.axeRuntimeExceptionMsgPrefix = void 0;
exports.useCustomRules = exports.useFilesToBeExempted = exports.log = exports.errMsgHeader = exports.getViolations = exports.getAxeRules = exports.axeVersion = exports.axeRuntimeExceptionMsgPrefix = void 0;
var axe_1 = require("./axe");

@@ -21,2 +21,3 @@ Object.defineProperty(exports, "axeRuntimeExceptionMsgPrefix", { enumerable: true, get: function () { return axe_1.axeRuntimeExceptionMsgPrefix; } });

Object.defineProperty(exports, "useFilesToBeExempted", { enumerable: true, get: function () { return helpers_1.useFilesToBeExempted; } });
Object.defineProperty(exports, "useCustomRules", { enumerable: true, get: function () { return helpers_1.useCustomRules; } });
//# sourceMappingURL=index.js.map
{
"name": "@sa11y/common",
"version": "6.3.0-alpha.1",
"version": "6.3.0",
"description": "Common utilities, constants, error messages for @sa11y",

@@ -19,3 +19,3 @@ "license": "BSD-3-Clause",

"dependencies": {
"axe-core": "4.8.3"
"axe-core": "4.7.0"
},

@@ -31,3 +31,3 @@ "devDependencies": {

},
"gitHead": "dbd1205148577947e7d26919f9ad998a340a5662"
"gitHead": "3e9639864e77cf4eaa90769c000c8386f27d6e01"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc