@sa11y/common
Advanced tools
Comparing version 6.3.0-alpha.1 to 6.3.0
@@ -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. |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15450
233
0
5
+ Addedaxe-core@4.7.0(transitive)
- Removedaxe-core@4.8.3(transitive)
Updatedaxe-core@4.7.0