Skip to content

Commit

Permalink
TypeScript tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhlauke committed Dec 29, 2023
1 parent 599bd96 commit 86b7c36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/createCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export function createCatalog(
catalogs: any,
components: any,
terms: any,
title: string,
lang: string
title: any,
lang: any
): any {
return {
title: title,
Expand All @@ -31,17 +31,16 @@ function getComponents(components: any): any {

function getChapters(catalogs: any): any {
let chapters: string[] = [];
for(var index in catalogs) {
for(const index in catalogs) {
if (!validateCatalogDataFiles(catalogs[index])) return;
chapters = chapters.concat(catalogs[index].chapters);
// console.dir(catalogs[index].chapters);
}
return chapters;
}

function getStandards(catalogs: any): any {
let standard: string[] = [];
for(var index in catalogs) {
for(const index in catalogs) {
if (!validateCatalogDataFiles(catalogs[index])) return;
standard = standard.concat(catalogs[index].standard);
}
Expand Down
14 changes: 7 additions & 7 deletions src/librarian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ if (argv.catalog) {
const catalog = argv.catalog;

// Load data files.
let wcag20 = yaml.load(
const wcag20 = yaml.load(
fs.readFileSync("./catalog/data/wcag-2.0.yaml").toString()
);
let wcag21 = yaml.load(
const wcag21 = yaml.load(
fs.readFileSync("./catalog/data/wcag-2.1.yaml").toString()
);
let wcag22 = yaml.load(
const wcag22 = yaml.load(
fs.readFileSync("./catalog/data/wcag-2.2.yaml").toString()
);
let section508 = yaml.load(
const section508 = yaml.load(
fs.readFileSync("./catalog/data/508.yaml").toString()
);
let en301549 = yaml.load(
const en301549 = yaml.load(
fs.readFileSync("./catalog/data/en-301-549.yaml").toString()
);
let components = yaml.load(
const components = yaml.load(
fs.readFileSync("./catalog/data/components.yaml").toString()
);
let terms = yaml.load(
const terms = yaml.load(
fs.readFileSync("./catalog/data/terms.yaml").toString()
);

Expand Down

0 comments on commit 86b7c36

Please sign in to comment.