Skip to content

Commit

Permalink
Clean up (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyinkin committed Apr 7, 2023
1 parent 457bff3 commit e7e19e7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tool/src/common_modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ import { Mode } from "./types.js";
export const commonModes = importCommonModes();

function importCommonModes(): Map<string, Mode> {
return new Map<string, Mode>([
...(Object.entries(hljs).filter(([key, value]) => isMode(key, value)) as [
string,
Mode,
][]),
]);
const allExported = Object.entries(hljs);
const modeArray = allExported.filter(([key, value]) => isMode(key, value));
return new Map<string, Mode>(modeArray as [string, Mode][]);
}

function isMode(key: string, value: any): boolean {
Expand Down

0 comments on commit e7e19e7

Please sign in to comment.