Skip to content

Commit

Permalink
(fix prettier) Array is going to be allocated sooner or later anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Jan 14, 2020
1 parent 54acfbe commit 94c62b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createNodeRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function createNodeRegistry() {
/** @type {Map<MDASTNode, RegisteredNodeData>} */
const nodeMap = new Map();
/** @type {ConditionalTheme[]} */
let themes;
let themes = [];
/** @type {Map<string, { colorMap: string[], settings: Record<string, string> }>} */
const themeColors = new Map();
/** @type {Map<string, Map<string, string>>} */
Expand Down Expand Up @@ -52,7 +52,7 @@ function createNodeRegistry() {
);
},
forEachNode: nodeMap.forEach.bind(nodeMap),
getAllPossibleThemes: () => (themes || []).map(theme => ({ theme, settings: themeColors.get(theme.identifier).settings })),
getAllPossibleThemes: () => themes.map(theme => ({ theme, settings: themeColors.get(theme.identifier).settings })),
getTokenStylesForTheme: themeIdentifier => {
/** @type {ReturnType<NodeRegistry['getTokenStylesForTheme']>} */
const result = [];
Expand Down

0 comments on commit 94c62b4

Please sign in to comment.