forked from algorithm-visualizer/algorithm-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (21 loc) · 628 Bytes
/
index.js
File metadata and controls
26 lines (21 loc) · 628 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
const isScratchPaper = (category, algorithm) => {
return category == 'scratch';
};
const getAlgorithmDir = (category, algorithm) => {
if (isScratchPaper(category)) return './algorithm/scratch_paper/';
return `./algorithm/${category}/${algorithm}/`;
};
const getFileDir = (category, algorithm, file) => {
if (isScratchPaper(category)) return './algorithm/scratch_paper/';
return `./algorithm/${category}/${algorithm}/${file}/`;
};
const renderMathJax = () =>{
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
};
module.exports = {
isScratchPaper,
getAlgorithmDir,
getFileDir,
renderMathJax
};