Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Sep 13, 2024
1 parent 5334d87 commit 983a88d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24423,12 +24423,14 @@ var getPrereqs = async ({
if (content === null) {
continue;
}
const parser = source == "prereqs.json" ? parsePrereqsJSON : source == "prereqs.yml" ? parsePrereqsYAML : source.match(/\.json$/) ? parseMetaJSON : source.match(/\.ya?ml$/) ? parseMetaYAML : source.match(/makefile$/i) ? parseMakefile : source.match(/cpanfile/i) ? parseCPANfile : null;
const parser = source.match(/prereqs\.json$/) ? parsePrereqsJSON : source.match(/prereqs\.yml/) ? parsePrereqsYAML : source.match(/\.json$/) ? parseMetaJSON : source.match(/\.ya?ml$/) ? parseMetaYAML : source.match(/makefile$/i) ? parseMakefile : source.match(/cpanfile/i) ? parseCPANfile : null;
if (parser === null) {
throw new Error(`Don't know how to parse ${source}`);
}
const reqs = await parser(content);
console.log(reqs);
const filteredPrereqs = filterPrereqs({
prereqs: await parser(content),
prereqs: reqs,
phases: new Set(phases),
relationships: new Set(relationships),
features: new Set(features)
Expand Down
10 changes: 7 additions & 3 deletions src/get-prereqs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export const getPrereqs = async ({
}

const parser =
source == 'prereqs.json' ? parsePrereqsJSON
: source == 'prereqs.yml' ? parsePrereqsYAML
source.match(/prereqs\.json$/) ? parsePrereqsJSON
: source.match(/prereqs\.yml/) ? parsePrereqsYAML
: source.match(/\.json$/) ? parseMetaJSON
: source.match(/\.ya?ml$/) ? parseMetaYAML
: source.match(/makefile$/i) ? parseMakefile
Expand All @@ -137,8 +137,12 @@ export const getPrereqs = async ({
throw new Error(`Don't know how to parse ${source}`);
}

const reqs = await parser(content);

console.log(reqs);

const filteredPrereqs = filterPrereqs({
prereqs: await parser(content),
prereqs: reqs,
phases: new Set(phases),
relationships: new Set(relationships),
features: new Set(features),
Expand Down

0 comments on commit 983a88d

Please sign in to comment.