Skip to content

Commit

Permalink
fix undefined group in final results (#28)
Browse files Browse the repository at this point in the history
this closes #27
  • Loading branch information
drodil authored Mar 1, 2024
1 parent 5b176c6 commit df3f475
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async function analyse(input?: string | string[], opts: T.Options = {}): Promise
}
// Set parent to result group if it is present
// Is nullish if either `opts.childLanguages` is set or if there is no group
const finalResult = !opts.childLanguages && result && langData[result].group || result;
const finalResult = !opts.childLanguages && result && langData[result] && langData[result].group || result;
if (!fileAssociations[file].includes(finalResult))
fileAssociations[file].push(finalResult);
extensions[file] = paths.extname(file).toLowerCase();
Expand Down

0 comments on commit df3f475

Please sign in to comment.