Skip to content

Commit

Permalink
feat: deprecate sri-history.json file (#3646)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored Sep 7, 2022
1 parent d36d455 commit 6f6a89e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/sri-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
*
* When running `npm run release`, this script will execute and
* update sri-history.json with the SRIs of axe{.*}.js.
* @deprecated
*/
var path = require('path');
var fs = require('fs');
var sriToolbox = require('sri-toolbox');

// Check if we should be validating or updating
var validate = process.argv.some(function(arg) {
var validate = process.argv.some(function (arg) {
return arg === '--validate';
});

Expand All @@ -27,11 +28,11 @@ if (typeof axeHistory[axeVersion] !== 'object') {
var versionSRIs = axeHistory[axeVersion];

// List all axe files (including minified and localized axe files)
var axeFiles = fs.readdirSync(root).filter(function(file) {
var axeFiles = fs.readdirSync(root).filter(function (file) {
return file.match(/^axe(\.[a-z.-]+)?\.js$/);
});

axeFiles.forEach(function(axeFile) {
axeFiles.forEach(function (axeFile) {
var axeSource = fs.readFileSync(path.join(root, axeFile), 'utf-8');
var axeIntegrity = sriToolbox.generate({ algorithms: ['sha256'] }, axeSource);

Expand Down

0 comments on commit 6f6a89e

Please sign in to comment.